feat(manager): design pass 1 — every page on <Page>, shared toolbars, fees under Online orders, QR codes under Tables, day stats reworked
From the owner's page-by-page review (2026-11-20): - every page root is <Page> (scrolls, fills 1080p, 16:9 centred on ultrawides); not yet: products, management/tables, stock (next pass) - /dashboard: more padding in cards (p-card), quieter secondary text, 11px uppercase labels everywhere (text-overline) - day stats: xl dialog, "● Day running · Opened …" as text, the six figures in equal boxes, "On tabs" in the payments bar, shared Tabs - /tables: Segmented List / Map / QR codes (?view=; /online/qr redirects), filter chips + zones multi-select at one height, the card itself opens the table (button removed), cards ~20% wider - /online-orders: shared Tabs with Settings (= the old /online/fees page, which redirects to ?tab=settings); orders fill the width - contacts, customers, expenses: PageHeader + Toolbar + SearchInput + multi-select Dropdowns (kinds; statuses, categories); table cells vertically centred; the Spent tip opens on hover - filterCards / filterContacts / filterExpenses take several values (unit tests added) - docs/DESIGN.md: the design language (CS-20 in the pack README) - tests/e2e/manager_layout.mjs: the page rule at 1920x1080 and 3440x1440; manager.mjs and manager_look.mjs follow the moved pages Verified: manager build + lint (0 errors), unit tests (manager 99, ui 24, i18n 31, api 25, access 8), i18n guard, manager_layout.mjs all passed, manager.mjs 228 checks all passed. Not checked: the waiter app and the terminal by eye (they only get the muted ink-2 token). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
import { useSearchParams } from 'react-router-dom'
|
||||
import { useCan, useModule } from '@xenia/access'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { Button } from '@xenia/ui'
|
||||
import { Page, Tabs } from '@xenia/ui'
|
||||
import PrintingSettings from '../printing/PrintingSettings'
|
||||
import CustomerDisplaySettings from './sections/CustomerDisplaySettings'
|
||||
import DevelopmentSettings from './sections/DevelopmentSettings'
|
||||
@@ -19,9 +19,9 @@ import VenueSettings from './sections/VenueSettings'
|
||||
|
||||
const TABS = {
|
||||
'app-info': () => <SystemSettings />,
|
||||
venue: () => <div className="max-w-3xl"><VenueSettings /></div>,
|
||||
'customer-display': () => <div className="max-w-4xl"><CustomerDisplaySettings /></div>,
|
||||
'menu-tablets': () => <div className="max-w-3xl"><MenuTabletSettings /></div>,
|
||||
venue: () => <VenueSettings />,
|
||||
'customer-display': () => <CustomerDisplaySettings />,
|
||||
'menu-tablets': () => <MenuTabletSettings />,
|
||||
security: () => <SecuritySettings />,
|
||||
operation: () => <OperationSettings />,
|
||||
colours: () => <TableColours />,
|
||||
@@ -47,16 +47,11 @@ export default function SettingsPage() {
|
||||
const active = tabs.includes(params.get('tab')) ? params.get('tab') : tabs[0]
|
||||
const Tab = TABS[active]
|
||||
return (
|
||||
<div className="h-full flex flex-col min-h-0" data-testid="settings-page">
|
||||
<div className="shrink-0 border-b border-line bg-surface px-4 lg:px-6 overflow-x-auto">
|
||||
<div className="flex gap-1 py-2" role="tablist" aria-label={t('settings.title')}>
|
||||
{tabs.map(id => (
|
||||
<Button key={id} size="sm" variant={active === id ? 'primary' : 'ghost'} role="tab" aria-selected={active === id}
|
||||
onClick={() => setParams({ tab: id }, { replace: true })} data-testid={`settings-tab-${id}`}>{t(`settings.tabs.${id}`)}</Button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-1 overflow-y-auto p-4 lg:p-6"><Tab /></div>
|
||||
</div>
|
||||
// settings are forms: the page's form width, centred (the page rule, 2026-11-20)
|
||||
<Page testId="settings-page" width="form" aria-label={t('settings.title')}
|
||||
top={<Tabs size="lg" value={active} onChange={id => setParams({ tab: id }, { replace: true })}
|
||||
tabs={tabs.map(id => ({ id, label: t(`settings.tabs.${id}`), testId: `settings-tab-${id}` }))} />}>
|
||||
<Tab />
|
||||
</Page>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function DevelopmentSettings() {
|
||||
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
||||
const spoof = s.get('dev.spoof_printing', 'false') === 'true'
|
||||
return (
|
||||
<div className="grid gap-5 max-w-3xl" data-testid="settings-development">
|
||||
<div className="grid gap-5" data-testid="settings-development">
|
||||
<p className="rounded-card bg-danger-soft text-danger-ink p-3 text-label" role="note">{t('settings.dev.warning')}</p>
|
||||
<SettingsCard title={t('settings.dev.title')}>
|
||||
<SettingRow label={t('settings.dev.spoof')} hint={t('settings.dev.spoofHint')} warning={spoof ? t('settings.dev.spoofOn') : undefined}>
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function FiscalSettings() {
|
||||
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
||||
const on = s.get('fiscal.enabled', 'false') === 'true'
|
||||
return (
|
||||
<div className="grid gap-5 max-w-3xl" data-testid="settings-fiscal">
|
||||
<div className="grid gap-5" data-testid="settings-fiscal">
|
||||
<SettingsCard title={t('settings.fiscal.title')} description={t('settings.fiscal.intro')}>
|
||||
<SettingRow label={t('settings.fiscal.enabled')} hint={t('settings.fiscal.enabledHint')}
|
||||
warning={on ? t('settings.fiscal.onWarning') : undefined}>
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function OperationSettings() {
|
||||
const chat = useModule('chat')
|
||||
const qrMenu = useModule('connect_menu')
|
||||
return (
|
||||
<div className="grid gap-5 max-w-3xl" data-testid="settings-operation">
|
||||
<div className="grid gap-5" data-testid="settings-operation">
|
||||
<RolePermissions />
|
||||
{ordering && <OrderingSettings />}
|
||||
{ordering && <TableFlags />}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { useSettings } from './useSettings'
|
||||
|
||||
export default function SecuritySettings() {
|
||||
return (
|
||||
<div className="grid gap-5 max-w-3xl" data-testid="settings-security">
|
||||
<div className="grid gap-5" data-testid="settings-security">
|
||||
<SignInSettings />
|
||||
<IdleSettings />
|
||||
<RecoveryCodes />
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function SystemSettings() {
|
||||
const counts = ['categories', 'products', 'tables', 'table_groups', 'managers', 'waiters']
|
||||
|
||||
return (
|
||||
<div className="grid gap-5 max-w-3xl" data-testid="settings-system">
|
||||
<div className="grid gap-5" data-testid="settings-system">
|
||||
<SettingsCard title={t('settings.system.title')}>
|
||||
<SettingRow label={t('settings.system.version')}>
|
||||
<span className="flex flex-wrap items-center gap-2 text-body font-semibold text-ink" data-testid="system-version">
|
||||
@@ -79,7 +79,7 @@ export default function SystemSettings() {
|
||||
<div className="grid grid-cols-2 sm:grid-cols-3 gap-3 p-5">
|
||||
{counts.map(k => (
|
||||
<div key={k} className="rounded-card bg-surface-2 p-3 grid">
|
||||
<span className="text-caption font-semibold uppercase tracking-wide text-ink-3">{t(`settings.system.counts.${k}`)}</span>
|
||||
<span className="text-overline font-semibold uppercase tracking-wide text-ink-3">{t(`settings.system.counts.${k}`)}</span>
|
||||
<span className="text-title font-semibold tabular-nums text-ink">{stats?.[k] ?? '—'}</span>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user