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:
@@ -6,11 +6,10 @@ import { useState } from 'react'
|
||||
import toast from 'react-hot-toast'
|
||||
import { errorMessage } from '@xenia/api'
|
||||
import { parseNumber, useFormat, useTranslation } from '@xenia/i18n'
|
||||
import { Button, Dialog, EmptyState, Spinner, cx } from '@xenia/ui'
|
||||
import { Button, Dialog, EmptyState, Spinner, Tabs } from '@xenia/ui'
|
||||
import client from '../../api/client'
|
||||
import { useLiveQuery } from '../../live/useLiveQuery'
|
||||
import { CashTab, ChecksTab, MoneyTab, PrintersTab, StaffTab, ZonesTab } from './DaySummaryTabs'
|
||||
import { Pill } from './parts'
|
||||
|
||||
export default function DaySummaryDialog({ dayId, closing = false, onClose, onClosed }) {
|
||||
const { t } = useTranslation('manager')
|
||||
@@ -40,13 +39,13 @@ export default function DaySummaryDialog({ dayId, closing = false, onClose, onCl
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ id: 'money', label: t('overview.day.tab.money') },
|
||||
{ id: 'staff', label: t('overview.day.tab.staff'), badge: data?.waiters?.length },
|
||||
{ id: 'zones', label: t('overview.day.tab.zones'), badge: data?.zones?.length },
|
||||
{ id: 'printers', label: t('overview.day.tab.printers'), badge: data?.printers?.length },
|
||||
{ id: 'money', label: t('overview.day.tab.money'), testId: 'day-tab-money' },
|
||||
{ id: 'staff', label: t('overview.day.tab.staff'), badge: data?.waiters?.length, testId: 'day-tab-staff' },
|
||||
{ id: 'zones', label: t('overview.day.tab.zones'), badge: data?.zones?.length, testId: 'day-tab-zones' },
|
||||
{ id: 'printers', label: t('overview.day.tab.printers'), badge: data?.printers?.length, testId: 'day-tab-printers' },
|
||||
...(closing ? [
|
||||
{ id: 'cash', label: t('overview.day.tab.cash') },
|
||||
{ id: 'checks', label: t('overview.day.tab.checks'), badge: data?.checks ? data.checks.open_orders + data.checks.active_shifts : null, warn: data?.checks?.with_unpaid_items > 0 },
|
||||
{ id: 'cash', label: t('overview.day.tab.cash'), testId: 'day-tab-cash' },
|
||||
{ id: 'checks', label: t('overview.day.tab.checks'), badge: data?.checks ? data.checks.open_orders + data.checks.active_shifts : null, warn: data?.checks?.with_unpaid_items > 0, testId: 'day-tab-checks' },
|
||||
] : []),
|
||||
]
|
||||
|
||||
@@ -58,23 +57,17 @@ export default function DaySummaryDialog({ dayId, closing = false, onClose, onCl
|
||||
</>)
|
||||
|
||||
return (
|
||||
<Dialog open size="lg" onClose={onClose} footer={footer || undefined}
|
||||
<Dialog open size="xl" onClose={onClose} footer={footer || undefined}
|
||||
title={closing ? t('overview.day.closeTitle') : t('overview.day.statsTitle')}
|
||||
description={data && <span className="inline-flex items-center gap-2">
|
||||
<Pill tone={data.status === 'open' ? 'success' : 'neutral'}>{data.status === 'open' ? t('overview.day.open') : t('overview.day.closedState')}</Pill>
|
||||
{t('overview.day.openedAt', { time: formatDateTime(data.opened_at, 'datetimeShort') })}
|
||||
description={data && <span className="inline-flex flex-wrap items-center gap-x-1.5 text-label" data-testid="day-status">
|
||||
{data.status === 'open'
|
||||
? <span className="inline-flex items-center gap-1.5 font-semibold text-success-ink"><span className="w-2 h-2 rounded-full bg-success" aria-hidden="true" />{t('overview.day.open')}</span>
|
||||
: <span>{t('overview.day.closedState')}</span>}
|
||||
<span aria-hidden="true">·</span>
|
||||
<span>{t('overview.day.openedAt', { time: formatDateTime(data.opened_at, 'datetimeShort') })}</span>
|
||||
</span>}>
|
||||
<div className="grid gap-4" data-testid="day-summary">
|
||||
<div className="flex gap-1 overflow-x-auto border-b border-line -mx-1 px-1" role="tablist">
|
||||
{tabs.map(tb => (
|
||||
<button key={tb.id} type="button" role="tab" aria-selected={tab === tb.id} onClick={() => setTab(tb.id)} data-testid={`day-tab-${tb.id}`}
|
||||
className={cx('flex items-center gap-1.5 px-3 py-2 -mb-px border-b-2 text-label whitespace-nowrap transition-colors duration-fast',
|
||||
tab === tb.id ? 'border-accent text-ink font-semibold' : 'border-transparent text-ink-2 hover:text-ink')}>
|
||||
{tb.label}
|
||||
{tb.badge != null && <span className={cx('min-w-5 px-1 rounded-full text-caption font-bold tabular-nums', tb.warn ? 'bg-danger-soft text-danger-ink' : 'bg-surface-2 text-ink-2')}>{tb.badge}</span>}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<Tabs tabs={tabs} value={tab} onChange={setTab} />
|
||||
{isPending && <div className="py-10 flex justify-center"><Spinner /></div>}
|
||||
{error && <EmptyState compact title={errorMessage(error, t)} />}
|
||||
{data && (<>
|
||||
|
||||
Reference in New Issue
Block a user