From e0f21419018c06bf52f084771b2ea8ea57cdce84 Mon Sep 17 00:00:00 2001 From: Kundencenter Date: Mon, 5 Oct 2026 13:39:10 +0200 Subject: [PATCH] =?UTF-8?q?Oberfl=C3=A4che:=20Kontraste=20nach=20WCAG,=20S?= =?UTF-8?q?VG-Icons=20statt=20Emojis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hellmodus: Status-/Hinweisfarben (ok/info/warn/err) und Akzent auf >= 4,5:1 angehoben, aktiver Eintrag der mobilen Navigation nutzt den Akzent statt Türkis - Eingabefelder und Textbereiche mit Rand >= 3:1 (--border-strong), Textbereiche einheitlich gestylt - Icon-Komponente (Lucide-Pfade) ersetzt Emojis im Darstellungsumschalter, Kundenansicht-Banner und bei Ticket-Anhängen; mobile Navigation mit Icons - Kundenansicht-Banner über Tokens statt fester Farben; Bildanhänge lazy laden Co-Authored-By: Claude Opus 5.5 --- apps/web/src/app/(app)/layout.tsx | 17 +++++++++-------- apps/web/src/app/(app)/tickets/[id]/page.tsx | 5 +++-- apps/web/src/app/globals.css | 20 +++++++++++--------- apps/web/src/components/Icon.tsx | 18 ++++++++++++++++++ apps/web/src/components/ThemeToggle.tsx | 5 +++-- 5 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 apps/web/src/components/Icon.tsx diff --git a/apps/web/src/app/(app)/layout.tsx b/apps/web/src/app/(app)/layout.tsx index 8e3d445..eeab985 100644 --- a/apps/web/src/app/(app)/layout.tsx +++ b/apps/web/src/app/(app)/layout.tsx @@ -6,6 +6,7 @@ import { api } from '@/lib/api'; import { useSession } from '@/lib/session'; import { ROLE_LABEL } from '@/components/ui'; import { ThemeToggle } from '@/components/ThemeToggle'; +import { Icon, type IconName } from '@/components/Icon'; export default function AppLayout({ children }: { children: ReactNode }) { const { me, loading, can, reload } = useSession(); const r = useRouter(); const path = usePathname(); const [open, setOpen] = useState(false); @@ -45,11 +46,11 @@ export default function AppLayout({ children }: { children: ReactNode }) { ); - const bottomLink = (href: string, label: string) => {label}; + const bottomLink = (href: string, label: string, icon: IconName) => {label}; return (<> {me.impersonating && ( -
- 👁 Ansicht als Kunde: {me.impersonating.orgName} ({me.impersonating.customerNumber}) · Grund: {me.impersonating.reason} +
+ Ansicht als Kunde: {me.impersonating.orgName} ({me.impersonating.customerNumber}) · Grund: {me.impersonating.reason}
)} @@ -57,11 +58,11 @@ export default function AppLayout({ children }: { children: ReactNode }) {
Kundencenter
{nav}
{trial && path !== '/einstellungen/lizenz' &&
{trial} Lizenz hinterlegen
}{children}
{!enrollNeeded && }
); diff --git a/apps/web/src/app/(app)/tickets/[id]/page.tsx b/apps/web/src/app/(app)/tickets/[id]/page.tsx index 7bae736..2a4310d 100644 --- a/apps/web/src/app/(app)/tickets/[id]/page.tsx +++ b/apps/web/src/app/(app)/tickets/[id]/page.tsx @@ -5,6 +5,7 @@ import Link from 'next/link'; import { api, apiUpload, errMsg } from '@/lib/api'; import { useSession } from '@/lib/session'; import { Alert, Field, TicketStatusBadge, TICKET_PRIORITY, fmt } from '@/components/ui'; +import { Icon } from '@/components/Icon'; const MAX_FILES = 5; const ALLOWED = 'image/png,image/jpeg,image/gif,image/webp,application/pdf'; @@ -14,8 +15,8 @@ function AttachmentList({ ticketId, atts }: { ticketId: string; atts: Attachment return (
{atts.map((a) => { const href = `/api/tickets/${ticketId}/attachments/${a.id}`; const kb = Math.max(1, Math.round(a.sizeBytes / 1024)); return a.contentType.startsWith('image/') - ? {a.filename} - : 📄 {a.filename} ({kb} KB); })} + ? {a.filename} + : {a.filename} ({kb} KB); })}
); } interface Msg { id: string; authorId: string; authorName: string; authorKind: 'customer' | 'staff'; body: string; internalNote: boolean; createdAt: string; attachments: Attachment[] } diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css index 6b5e02a..f2112d1 100644 --- a/apps/web/src/app/globals.css +++ b/apps/web/src/app/globals.css @@ -3,8 +3,8 @@ über prefers-color-scheme, zusätzlich manuell über [data-theme] umschaltbar (siehe ThemeToggle). */ :root { --bg: #f4f6fa; --surface: #ffffff; --surface-2: #eef1f6; --border: #e3e8f0; --text: #172033; --muted: #5b6472; - --accent: #3b6fd8; --accent2: #14b8a6; --accent-contrast: #ffffff; --focus: #3b6fd8; - --ok: #22a06b; --ok-bg: #e4f5ec; --info: #2e6fe0; --info-bg: #e7f1fc; --warn: #e59a17; --warn-bg: #fdf1dc; --err: #dc4c64; --err-bg: #fbe7ea; --lock: #4b5563; --lock-bg: #eceef2; + --accent: #2f62c9; --accent2: #0f766e; --accent-contrast: #ffffff; --focus: #2f62c9; --border-strong: #7a8599; + --ok: #17784c; --ok-bg: #e4f5ec; --info: #2257c4; --info-bg: #e7f1fc; --warn: #8a5300; --warn-bg: #fdf1dc; --err: #b52f47; --err-bg: #fbe7ea; --lock: #4b5563; --lock-bg: #eceef2; --nav-bg: #173568; --nav-text: #dbe4f7; --nav-muted: #8fa4d4; --nav-border: #24417f; --nav-hover: #1f4084; --nav-active-bg: #2a4d93; --nav-active-text: #ffffff; --shadow-sm: 0 1px 2px rgba(23, 32, 51, .04), 0 1px 1px rgba(23, 32, 51, .04); --shadow-md: 0 8px 20px rgba(23, 32, 51, .06), 0 2px 6px rgba(23, 32, 51, .04); @@ -12,13 +12,13 @@ --font: var(--font-inter), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; } @media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { - --bg: #0d1117; --surface: #161b22; --surface-2: #1c2129; --border: #262c36; --text: #e6edf3; --muted: #8b98a5; --accent: #6e8dff; --accent2: #2dd4bf; --accent-contrast: #0d1117; --focus: #6e8dff; + --bg: #0d1117; --surface: #161b22; --surface-2: #1c2129; --border: #262c36; --text: #e6edf3; --muted: #8b98a5; --accent: #6e8dff; --accent2: #2dd4bf; --accent-contrast: #0d1117; --focus: #6e8dff; --border-strong: #5f6b7c; --ok: #34d399; --ok-bg: #10281d; --info: #8ab4f8; --info-bg: #16283d; --warn: #f5b84d; --warn-bg: #3a2b0c; --err: #f1798d; --err-bg: #3b1620; --lock: #b7c0cc; --lock-bg: #232932; --nav-bg: #0a1220; --nav-text: #cdd9f0; --nav-muted: #7c8bb0; --nav-border: #1c2740; --nav-hover: #131f36; --nav-active-bg: #1d3358; --nav-active-text: #ffffff; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45); --shadow-md: 0 10px 24px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35); } } :root[data-theme='dark'] { - --bg: #0d1117; --surface: #161b22; --surface-2: #1c2129; --border: #262c36; --text: #e6edf3; --muted: #8b98a5; --accent: #6e8dff; --accent2: #2dd4bf; --accent-contrast: #0d1117; --focus: #6e8dff; + --bg: #0d1117; --surface: #161b22; --surface-2: #1c2129; --border: #262c36; --text: #e6edf3; --muted: #8b98a5; --accent: #6e8dff; --accent2: #2dd4bf; --accent-contrast: #0d1117; --focus: #6e8dff; --border-strong: #5f6b7c; --ok: #34d399; --ok-bg: #10281d; --info: #8ab4f8; --info-bg: #16283d; --warn: #f5b84d; --warn-bg: #3a2b0c; --err: #f1798d; --err-bg: #3b1620; --lock: #b7c0cc; --lock-bg: #232932; --nav-bg: #0a1220; --nav-text: #cdd9f0; --nav-muted: #7c8bb0; --nav-border: #1c2740; --nav-hover: #131f36; --nav-active-bg: #1d3358; --nav-active-text: #ffffff; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45); --shadow-md: 0 10px 24px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35); @@ -26,7 +26,7 @@ * { box-sizing: border-box; } html { color-scheme: light dark; } body { margin: 0; font: 16px/1.55 var(--font); background: var(--bg); color: var(--text); } -body, .btn, .badge, .card, input, select, a, .alert { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; } +body, .btn, .badge, .card, input, select, textarea, a, .alert { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; } h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 var(--s3); letter-spacing: -0.015em; } h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 var(--s3); } h3 { font-size: 1rem; font-weight: 600; margin: 0 0 var(--s2); } a { color: var(--accent); } p { margin: 0 0 var(--s3); } .muted { color: var(--muted); } .small { font-size: .9rem; } :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; } @@ -56,8 +56,8 @@ a { color: var(--accent); } p { margin: 0 0 var(--s3); } .muted { color: var(--m .main { padding: var(--s4) var(--s3) calc(var(--s4) + 56px); } .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-md); padding-bottom: env(safe-area-inset-bottom, 0); } .bottomnav a, .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; font-size: .72rem; color: var(--muted); text-decoration: none; background: none; border: none; font: inherit; min-height: 56px; } - .bottomnav .ic { font-size: 1.15rem; line-height: 1; } - .bottomnav a[aria-current='page'] { color: var(--accent2); font-weight: 600; } + .bottomnav .ic { width: 22px; height: 22px; } + .bottomnav a[aria-current='page'] { color: var(--accent); font-weight: 600; } } .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); box-shadow: var(--shadow-sm); } .grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } @@ -69,8 +69,8 @@ a { color: var(--accent); } p { margin: 0 0 var(--s3); } .muted { color: var(--m .btn.primary:hover { filter: brightness(1.08); } .btn.danger { color: var(--err); border-color: var(--err); } .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; } .btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; } .field { display: grid; gap: 6px; margin-bottom: var(--s3); } .field label { font-weight: 600; font-size: .9rem; } -input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); min-height: 44px; width: 100%; } -input:focus-visible, select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; } +input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); min-height: 44px; width: 100%; } +input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; } .cols { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 12px var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; } th { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); } tbody tr:hover { background: var(--surface-2); } @@ -88,5 +88,7 @@ tbody tr:hover { background: var(--surface-2); } .productcard .id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--muted); } .center { min-height: 100vh; display: grid; place-items: center; padding: var(--s3); } .auth { width: 100%; max-width: 420px; } code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; word-break: break-all; } .codes { columns: 2; background: var(--surface-2); padding: var(--s3); border-radius: var(--radius-sm); } +.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; } +.impersonate { position: sticky; top: 0; z-index: 100; width: 100%; background: var(--warn-bg); color: var(--warn); border-bottom: 2px solid var(--warn); padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; text-align: center; } .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } } diff --git a/apps/web/src/components/Icon.tsx b/apps/web/src/components/Icon.tsx new file mode 100644 index 0000000..1371588 --- /dev/null +++ b/apps/web/src/components/Icon.tsx @@ -0,0 +1,18 @@ +/** Einheitliche Strich-Icons (Pfade aus Lucide, ISC-Lizenz) statt Emojis. Immer dekorativ: Bedeutung trägt der Text daneben. */ +const PATHS = { + home: <>, + server: <>, + ticket: <>, + receipt: <>, + menu: <>, + sun: <>, + moon: <>, + monitor: <>, + eye: <>, + file: <>, +} as const; +export type IconName = keyof typeof PATHS; + +export function Icon({ name, className = 'icon' }: { name: IconName; className?: string }) { + return ; +} diff --git a/apps/web/src/components/ThemeToggle.tsx b/apps/web/src/components/ThemeToggle.tsx index b252577..62153e3 100644 --- a/apps/web/src/components/ThemeToggle.tsx +++ b/apps/web/src/components/ThemeToggle.tsx @@ -1,10 +1,11 @@ 'use client'; import { useEffect, useState } from 'react'; +import { Icon, type IconName } from '@/components/Icon'; type Theme = 'light' | 'dark' | 'system'; const KEY = 'kc-theme'; const LABEL: Record = { system: 'System', light: 'Hell', dark: 'Dunkel' }; -const ICON: Record = { system: '🌓', light: '☀️', dark: '🌙' }; +const ICON: Record = { system: 'monitor', light: 'sun', dark: 'moon' }; const NEXT: Record = { system: 'light', light: 'dark', dark: 'system' }; function apply(t: Theme) { @@ -24,7 +25,7 @@ export function ThemeToggle({ compact = false }: { compact?: boolean }) { } return ( ); }