feat(manager): every report on the shared controls (one toolbar height, modern dropdowns, shared tabs)

- The period: one toolbar (range / day as a Segmented, dates, quick choices, the report's own
  filters and export / print on the right), every control 44 px; the business day a searchable
  Dropdown.
- Report filters (person, category, status, waiter, table, printer) are the shared Dropdown;
  export / print buttons as tall as the rest; trends' step a Segmented.
- A report's tabs are the shared tab strip above the page; a day's and an order's sections too.
- e2e: the floor editor's edge '+' and the layout check cover products, tables set-up and the
  channel prices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 15:27:07 +02:00
co-authored by Claude Opus 5.5
parent 244e93f827
commit 9021373a6b
13 changed files with 71 additions and 93 deletions
@@ -4,7 +4,7 @@
// The period is filtered by the server (venue dates, 6.13a); categories / statuses are `finance.*` texts.
import { useState } from 'react'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, Dialog, Select } from '@xenia/ui'
import { Button, Dialog, Dropdown } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { Pill } from '../../overview/parts'
@@ -51,10 +51,10 @@ function Expenses() {
]
return (
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod} allowDay={false} right={<span className="flex gap-2 items-end">
<Select size="sm" value={status} onChange={e => setStatus(e.target.value)} aria-label={t('reports.status')}
<PeriodPicker value={period} onChange={setPeriod} allowDay={false} right={<span className="flex flex-wrap gap-2 items-center">
<Dropdown value={status} onChange={v => setStatus(v)} aria-label={t('reports.status')}
options={[{ value: '', label: t('reports.store.anyStatus') }, ...['due', 'partial', 'paid'].map(s => ({ value: s, label: t(`finance.status.${s}`) }))]} />
<Select size="sm" value={category} onChange={e => setCategory(e.target.value)} aria-label={t('reports.prod.category')}
<Dropdown value={category} onChange={v => setCategory(v)} aria-label={t('reports.prod.category')}
options={[{ value: '', label: t('reports.prod.allCategories') }, ...CATEGORIES.map(c => ({ value: c, label: catName(c) }))]} />
</span>} />
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (<>
@@ -65,7 +65,7 @@ function Expenses() {
</div>
{groups.length > 0 && (
<Panel title={t('reports.exp.split')} actions={<span className="flex gap-1">{['category', 'supplier'].map(s => (
<Button key={s} size="sm" variant={split === s ? 'primary' : 'ghost'} onClick={() => setSplit(s)}>{t(`reports.exp.by.${s}`)}</Button>))}</span>}>
<Button key={s} size="sm" variant={split === s ? 'secondary' : 'ghost'} aria-pressed={split === s} onClick={() => setSplit(s)}>{t(`reports.exp.by.${s}`)}</Button>))}</span>}>
<BarList testId="expenses-split" format={v => fmt.formatMoney(v)} rows={groups.map(g => ({ ...g, sub: g.due ? t('reports.exp.dueSub', { amount: fmt.formatMoney(g.due) }) : undefined }))} />
</Panel>
)}
@@ -5,7 +5,7 @@ import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { ArrowRight } from 'lucide-react'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, Dialog } from '@xenia/ui'
import { Button, Dialog, Tabs } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { AuditList, PriceEventList } from '../../orders/OrderHistory'
@@ -41,9 +41,7 @@ export default function OrderDialog({ order: summary, onClose }) {
<Button variant="ghost" iconEnd={<ArrowRight size={16} />} onClick={() => navigate(`/orders/${summary.id}`)}>{t('reports.openOrder')}</Button>
</>}>
<div className="grid gap-3" data-testid="report-order-dialog">
<span className="flex gap-1" role="tablist">
{TABS.map(k => <Button key={k} size="sm" variant={tab === k ? 'primary' : 'ghost'} role="tab" aria-selected={tab === k} onClick={() => setTab(k)}>{t(`reports.orderTabs.${k}`)}</Button>)}
</span>
<Tabs value={tab} onChange={setTab} tabs={TABS.map(k => ({ id: k, label: t(`reports.orderTabs.${k}`) }))} />
{!order ? <Loading /> : tab === 'lines' ? <OrderLines order={order} open={false} priceEvents={events} onPay={() => {}} onChanged={() => {}} />
: tab === 'prices' ? <PriceEventList events={events} /> : <AuditList order={order} />}
</div>
@@ -1,15 +1,15 @@
// The period a report covers (plan step 6.12a): dates (from – to, with quick choices) or one
// business day. Dates are venue calendar days; the backend reads them in venue time.
import { useId } from 'react'
// 2026-11-20: one toolbar (the shared controls, one height): range / day, the dates, the quick
// choices, then what the report adds on the right (filters, export, print).
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, Input, Select } from '@xenia/ui'
import { Button, Dropdown, Input, Segmented, Toolbar, ToolbarSpacer } from '@xenia/ui'
import { dayChoices, quickRange, rangeProblem } from './reportLogic'
import { useBusinessDays } from './useBusinessDays'
export function PeriodPicker({ value, onChange, allowDay = true, right }) {
const { t } = useTranslation('manager')
const fmt = useFormat()
const id = useId()
const today = fmt.venueToday()
const { data: days = [] } = useBusinessDays()
const set = patch => onChange({ ...value, ...patch })
@@ -17,38 +17,33 @@ export function PeriodPicker({ value, onChange, allowDay = true, right }) {
const dayLabel = d => `${fmt.formatDateTime(d.opened_at, 'datetimeShort')}${d.status === 'open' ? ` · ${t('reports.open')}` : ''}`
return (
<div className="rounded-card border border-line bg-surface shadow-raised px-4 py-3 flex flex-wrap items-end gap-3" data-testid="report-period">
<div className="rounded-card border border-line bg-surface shadow-raised px-card py-card-y grid gap-2" data-testid="report-period">
<Toolbar>
{allowDay && (
<div className="flex rounded-control border border-line overflow-hidden self-end" role="group" aria-label={t('reports.period')}>
{['range', 'day'].map(m => (
<button key={m} type="button" aria-pressed={value.mode === m} onClick={() => set({ mode: m, dayId: m === 'day' && !value.dayId ? String(days[0]?.id ?? '') : value.dayId })}
className={`px-3 py-1.5 text-label font-medium ${value.mode === m ? 'bg-accent-soft text-accent-ink' : 'bg-surface text-ink-2 hover:bg-surface-2'}`}>
{t(`reports.modes.${m}`)}
</button>
))}
</div>
<Segmented aria-label={t('reports.period')} value={value.mode}
onChange={m => set({ mode: m, dayId: m === 'day' && !value.dayId ? String(days[0]?.id ?? '') : value.dayId })}
options={['range', 'day'].map(m => ({ value: m, label: t(`reports.modes.${m}`), testId: `period-mode-${m}` }))} />
)}
{value.mode === 'range' ? (<>
<label className="grid gap-1 text-caption text-ink-2" htmlFor={`${id}-from`}>{t('reports.from')}
<Input id={`${id}-from`} type="date" value={value.from} max={today} onChange={e => set({ from: e.target.value })} data-testid="period-from" />
<label className="flex items-center gap-2 text-label text-ink-2">{t('reports.from')}
<Input type="date" className="w-44" value={value.from} max={today} onChange={e => set({ from: e.target.value })} data-testid="period-from" />
</label>
<label className="grid gap-1 text-caption text-ink-2" htmlFor={`${id}-to`}>{t('reports.to')}
<Input id={`${id}-to`} type="date" value={value.to} max={today} onChange={e => set({ to: e.target.value })} data-testid="period-to" />
<label className="flex items-center gap-2 text-label text-ink-2">{t('reports.to')}
<Input type="date" className="w-44" value={value.to} max={today} onChange={e => set({ to: e.target.value })} data-testid="period-to" />
</label>
<span className="flex flex-wrap gap-1">
{['today', 'week', 'month', 'thirty'].map(k => (
<Button key={k} size="sm" variant="ghost" onClick={() => set(quickRange(k, today))}>{t(`reports.quick.${k}`)}</Button>
<Button key={k} variant="ghost" onClick={() => set(quickRange(k, today))}>{t(`reports.quick.${k}`)}</Button>
))}
</span>
</>) : (
<label className="grid gap-1 text-caption text-ink-2 min-w-56" htmlFor={`${id}-day`}>{t('reports.businessDay')}
<Select id={`${id}-day`} value={value.dayId} onChange={e => set({ dayId: e.target.value })} data-testid="period-day"
options={dayChoices(days).map(d => ({ value: String(d.id), label: dayLabel(d) }))} placeholder={days.length ? undefined : t('reports.noDays')} />
</label>
<Dropdown className="min-w-64" value={value.dayId} onChange={v => set({ dayId: v })} aria-label={t('reports.businessDay')} data-testid="period-day" searchable
options={dayChoices(days).map(d => ({ value: String(d.id), label: dayLabel(d) }))} placeholder={days.length ? t('reports.businessDay') : t('reports.noDays')} />
)}
<span className="flex-1" />
<ToolbarSpacer />
{right}
{problem && <p role="alert" className="w-full text-label text-danger-ink">{t(`reports.rangeProblem.${problem}`)}</p>}
</Toolbar>
{problem && <p role="alert" className="text-label text-danger-ink">{t(`reports.rangeProblem.${problem}`)}</p>}
</div>
)
}
@@ -7,7 +7,7 @@ import toast from 'react-hot-toast'
import { ArrowDown, ArrowUp, Download, Info } from 'lucide-react'
import { errorMessage } from '@xenia/api'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, EmptyState, InfoTip, Page, Spinner, cx } from '@xenia/ui'
import { Button, EmptyState, InfoTip, Page, PageHeader, Spinner, Tabs, cx } from '@xenia/ui'
import client from '../../../api/client'
import { sortRows } from './reportLogic'
@@ -17,20 +17,10 @@ export function ReportPage({ title, tabs = [], children, testId }) {
const active = tabs.find(t => t.id === params.get('tab'))?.id ?? tabs[0]?.id
const tab = tabs.find(t => t.id === active)
return (
<Page testId={testId}>
<header className="flex flex-wrap items-end gap-3">
<h1 className="text-title font-semibold text-ink flex-1 min-w-0">{title}</h1>
{tabs.length > 1 && (
<nav className="flex flex-wrap gap-1" role="tablist">
{tabs.map(t => (
<Button key={t.id} size="sm" variant={t.id === active ? 'primary' : 'ghost'} role="tab" aria-selected={t.id === active}
onClick={() => setParams(p => { const n = new URLSearchParams(p); n.set('tab', t.id); return n }, { replace: true })} data-testid={`report-tab-${t.id}`}>
{t.label}
</Button>
))}
</nav>
)}
</header>
<Page testId={testId}
top={tabs.length > 1 ? <Tabs size="lg" value={active} tabs={tabs.map(t => ({ id: t.id, label: t.label, testId: `report-tab-${t.id}` }))}
onChange={id => setParams(p => { const n = new URLSearchParams(p); n.set('tab', id); return n }, { replace: true })} /> : undefined}>
<PageHeader title={title} />
{tab ? <tab.Component key={tab.id} /> : children}
</Page>
)
@@ -149,5 +139,5 @@ export function ExportButton({ endpoint, params, filename }) {
setTimeout(() => URL.revokeObjectURL(url), 1000)
} catch (err) { toast.error(errorMessage(err, t)) } finally { setBusy(false) }
}
return <Button size="sm" variant="secondary" icon={<Download size={14} />} loading={busy} onClick={run} data-testid="report-export">{t('reports.export')}</Button>
return <Button variant="secondary" icon={<Download size={16} />} loading={busy} onClick={run} data-testid="report-export">{t('reports.export')}</Button>
}
@@ -82,9 +82,9 @@ function ZoneCard({ zone: z, period }) {
{z.notification_name && <span className="text-label font-normal text-ink-2">{z.notification_name}</span>}
{z.printers.map(p => <Pill key={p.id}><Printer size={12} aria-hidden="true" />{p.name}</Pill>)}</span>}
actions={<span className="flex flex-wrap gap-1">
<Button size="sm" variant="ghost" icon={<Download size={14} />} onClick={products} disabled={!z.all_products.length}>{t('reports.zones.productsCsv')}</Button>
<Button size="sm" variant="ghost" icon={<Download size={14} />} onClick={ordersCsv} disabled={!z.all_orders.length}>{t('reports.zones.ordersCsv')}</Button>
<Button size="sm" variant="secondary" icon={<Printer size={14} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>
<Button variant="ghost" icon={<Download size={16} />} onClick={products} disabled={!z.all_products.length}>{t('reports.zones.productsCsv')}</Button>
<Button variant="ghost" icon={<Download size={16} />} onClick={ordersCsv} disabled={!z.all_orders.length}>{t('reports.zones.ordersCsv')}</Button>
<Button variant="secondary" icon={<Printer size={16} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>
</span>}>
<div className="grid gap-3 p-4 grid-cols-[repeat(auto-fill,minmax(10rem,1fr))]">
<Stat label={t('reports.zones.items')} value={fmt.formatNumber(z.item_count, { maxDecimals: 3 })} />
@@ -5,7 +5,7 @@
import { useState } from 'react'
import { Printer } from 'lucide-react'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, Select } from '@xenia/ui'
import { Button, Dropdown } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { BarList } from '../kit/charts'
@@ -67,9 +67,9 @@ function ProductsTab() {
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod} right={<span className="flex gap-2">
<ExportButton endpoint="/api/reports/products/export" params={params} filename={`products-${periodSlug(period)}.csv`} />
<Button size="sm" variant="secondary" icon={<Printer size={14} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>
<Button variant="secondary" icon={<Printer size={16} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>
</span>} />
<Select size="sm" value={category} onChange={e => setCategory(e.target.value)} aria-label={t('reports.prod.category')} className="w-64"
<Dropdown value={category} onChange={v => setCategory(v)} aria-label={t('reports.prod.category')} className="w-64"
options={[{ value: '', label: t('reports.prod.allCategories') }, ...cats.flatMap(c => [c, ...(c.subcategories ?? [])]).map(c => ({ value: String(c.id), label: c.name }))]} />
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (<>
<div className="grid gap-3 grid-cols-[repeat(auto-fill,minmax(12rem,1fr))]">
@@ -119,7 +119,7 @@ function CategoriesTab() {
]
return (
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod} right={<Button size="sm" variant="secondary" icon={<Printer size={14} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>} />
<PeriodPicker value={period} onChange={setPeriod} right={<Button variant="secondary" icon={<Printer size={16} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>} />
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (<>
{rows.length > 0 && (
<Panel title={t('reports.prod.shareTitle')}>
@@ -8,7 +8,7 @@ import { Trash2 } from 'lucide-react'
import { useCan } from '@xenia/access'
import { errorMessage } from '@xenia/api'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, Dialog, IconButton, Select } from '@xenia/ui'
import { Button, Dialog, Dropdown, IconButton } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { useDuration } from '../../overview/hooks'
@@ -40,7 +40,7 @@ function PersonFilter({ value, onChange }) {
const { t } = useTranslation('manager')
const { data: people = [] } = usePeople()
return (
<Select size="sm" value={value} onChange={e => onChange(e.target.value)} aria-label={t('reports.person')} className="w-56"
<Dropdown value={value} onChange={v => onChange(v)} aria-label={t('reports.person')} className="w-56"
options={[{ value: '', label: t('reports.store.anyone') }, ...people.map(p => ({ value: String(p.id), label: p.name }))]} />
)
}
@@ -85,7 +85,7 @@ function ShiftsTab() {
return (
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod}
right={<span className="flex gap-2 items-end"><PersonFilter value={person} onChange={setPerson} />
right={<span className="flex flex-wrap gap-2 items-center"><PersonFilter value={person} onChange={setPerson} />
<ExportButton endpoint="/api/reports/shifts/export" params={params} filename={`shifts-${periodSlug(period)}.csv`} /></span>} />
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (
<Panel padded={false} title={t('reports.staff.shiftsCount', { count: rows.length })}
@@ -9,7 +9,7 @@ import { Pencil, Trash2 } from 'lucide-react'
import { useCan } from '@xenia/access'
import { errorMessage } from '@xenia/api'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, Dialog, IconButton, Input } from '@xenia/ui'
import { Button, Dialog, IconButton, Input, Tabs } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { useDuration } from '../../overview/hooks'
@@ -148,13 +148,8 @@ function DayDialog({ day: initial, owner, onClose }) {
<Button size="sm" variant="ghost" onClick={() => setEditing(false)}>{t('reports.back')}</Button>
</div>
)}
<span className="flex gap-1" role="tablist">
{['orders', 'shifts'].map(k => (
<Button key={k} size="sm" variant={tab === k ? 'primary' : 'ghost'} role="tab" aria-selected={tab === k} onClick={() => setTab(k)}>
{t(`reports.store.dayTabs.${k}`, { count: k === 'orders' ? orders.length : shifts.length })}
</Button>
))}
</span>
<Tabs value={tab} onChange={setTab}
tabs={['orders', 'shifts'].map(k => ({ id: k, label: t(`reports.store.dayTabs.${k}`, { count: k === 'orders' ? orders.length : shifts.length }), testId: `day-tab-${k}` }))} />
{(tab === 'orders' ? loadingOrders : loadingShifts) ? <Loading /> : tab === 'orders'
? <Table columns={orderCols} rows={orders} onRow={setOrder} limit={500} />
: <Table columns={shiftCols} rows={shifts} onRow={setShift} />}
@@ -2,7 +2,7 @@
// waiter and table; products, delivery fee and refunds per order; a tap opens it; export.
import { useState } from 'react'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Select } from '@xenia/ui'
import { Dropdown, Toolbar } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { Pill } from '../../overview/parts'
@@ -48,14 +48,14 @@ export default function OrdersTab() {
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod}
right={<ExportButton endpoint="/api/reports/orders/export" params={params} filename={`orders-${periodSlug(period)}.csv`} />} />
<div className="flex flex-wrap gap-2">
<Select size="sm" value={filter.status} onChange={e => set('status', e.target.value)} aria-label={t('reports.status')}
<Toolbar>
<Dropdown value={filter.status} onChange={v => set('status', v)} aria-label={t('reports.status')}
options={[{ value: '', label: t('reports.store.anyStatus') }, ...STATUSES.map(s => ({ value: s, label: t(`overview.orderStatus.${s}`) }))]} />
<Select size="sm" value={filter.waiter_id} onChange={e => set('waiter_id', e.target.value)} aria-label={t('reports.person')}
<Dropdown value={filter.waiter_id} onChange={v => set('waiter_id', v)} aria-label={t('reports.person')}
options={[{ value: '', label: t('reports.store.anyone') }, ...waiters.map(w => ({ value: String(w.id), label: w.name }))]} />
<Select size="sm" value={filter.table_id} onChange={e => set('table_id', e.target.value)} aria-label={t('reports.place')}
<Dropdown value={filter.table_id} onChange={v => set('table_id', v)} aria-label={t('reports.place')}
options={[{ value: '', label: t('reports.store.anyTable') }, ...tables.map(x => ({ value: String(x.id), label: x.group ? `${x.name} · ${x.group}` : x.name }))]} />
</div>
</Toolbar>
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (
<Panel padded={false} title={t('reports.store.ordersCount', { count: rows.length, total: fmt.formatMoney(total) })}>
<Table columns={columns} rows={rows} onRow={setOrder} rowTestId="report-order" initialSort={{ key: 'id', dir: 'desc' }} limit={300} />
@@ -31,7 +31,7 @@ export default function TablesTab() {
]
return (
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod} right={<Button size="sm" variant="secondary" icon={<Printer size={14} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>} />
<PeriodPicker value={period} onChange={setPeriod} right={<Button variant="secondary" icon={<Printer size={16} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>} />
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (<>
<Panel padded={false} title={t('reports.tables.title')} tip={t('reports.tables.tip')}>
<Table columns={columns} rows={rows} rowKey={r => r.table_id ?? 'none'} initialSort={{ key: 'revenue', dir: 'desc' }} />
@@ -2,7 +2,7 @@
// dates, with the 7-day average for days; delivery fees beside the revenue.
import { useState } from 'react'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button } from '@xenia/ui'
import { Button, Segmented } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { TrendChart } from '../kit/charts'
@@ -35,7 +35,7 @@ export default function TrendsTab() {
return (
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod} allowDay={false}
right={<span className="flex gap-1">{STEPS.map(s => <Button key={s} size="sm" variant={step === s ? 'primary' : 'ghost'} onClick={() => setStep(s)}>{t(`reports.trends.steps.${s}`)}</Button>)}</span>} />
right={<Segmented value={step} onChange={setStep} options={STEPS.map(s => ({ value: s, label: t(`reports.trends.steps.${s}`) }))} />} />
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (<>
{rows.length > 1 && <Panel title={t('reports.trends.title')}><TrendChart points={rows.map(r => ({ label: label(r.date), revenue: r.revenue, profit: r.profit }))} showProfit={anyProfit} /></Panel>}
<Panel padded={false} title={t('reports.trends.table')}><Table columns={columns} rows={rows} rowKey={r => r.date} initialSort={{ key: 'date', dir: 'desc' }} /></Panel>
@@ -6,7 +6,7 @@ import { useState } from 'react'
import { Printer } from 'lucide-react'
import { useCan } from '@xenia/access'
import { useFormat, useTranslation } from '@xenia/i18n'
import { Button, Select } from '@xenia/ui'
import { Button, Dropdown } from '@xenia/ui'
import client from '../../../api/client'
import { useLiveQuery } from '../../../live/useLiveQuery'
import { Pill } from '../../overview/parts'
@@ -58,11 +58,11 @@ function PrintingTab() {
]
return (
<div className="grid gap-4">
<PeriodPicker value={period} onChange={setPeriod} right={<span className="flex gap-2 items-end">
<Select size="sm" value={printer} onChange={e => setPrinter(e.target.value)} aria-label={t('reports.print.printer')} className="w-48"
<PeriodPicker value={period} onChange={setPeriod} right={<span className="flex flex-wrap gap-2 items-center">
<Dropdown value={printer} onChange={v => setPrinter(v)} aria-label={t('reports.print.printer')} className="w-48"
options={[{ value: '', label: t('reports.tech.allPrinters') }, ...printers.map(p => ({ value: String(p.id), label: p.name }))]} />
<ExportButton endpoint="/api/reports/printers/export" params={params} filename={`printing-${periodSlug(period)}.csv`} />
<Button size="sm" variant="secondary" icon={<Printer size={14} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>
<Button variant="secondary" icon={<Printer size={16} />} onClick={() => setPrinting(true)}>{t('reports.print.button')}</Button>
</span>} />
{isPending ? <Loading /> : error ? <Failed error={error} retry={refetch} /> : (<>
<div className="grid gap-3 grid-cols-[repeat(auto-fill,minmax(12rem,1fr))]">
+1 -1
View File
@@ -1129,7 +1129,7 @@ try {
await page.mouse.move(mid.x, mid.y - 3)
await page.mouse.move(mid.x, mid.y, { steps: 2 })
await page.getByTestId('floor-edge-add').waitFor({ timeout: 3000 }).catch(() => {})
r.check('floor: a "+" shows on the floor's edge under the pointer', await page.getByTestId('floor-edge-add').count() === 1)
r.check('floor: a "+" shows on the edge of the floor under the pointer', await page.getByTestId('floor-edge-add').count() === 1)
await page.mouse.down()
await page.mouse.move(mid.x - 120, mid.y + 10, { steps: 6 })
await page.mouse.up()