feat(manager): the floor plan editor reworked; Management -> Tables on the page rule; area colours
- Floor editor: one toolbar over the map and the panels (grid on / off, grid resolution Ultra high ... Very low, edit the shape, Fit width / Whole plan, undo, save), panels top-aligned and sticky. - The floor's shape: a '+' on the edge under the pointer, press to add a corner (and drag it); resting on a corner shows a bubble to remove it (never below 3). - Areas: resize handles on the sides and corners, a colour (pastel, see-through; floor_items.color, migration 0041), the name repeated in the corner when tables cover it (live maps too). - Labels can be clicked again after they're placed (transparent fill, not none). - Management -> Tables: <Page> with the tabs above (?tab=), the list as a container, toolbar buttons one height. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,8 +75,8 @@ export default function TablesListTab() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full min-h-0" data-testid="tables-list">
|
||||
<div className="flex flex-wrap items-center gap-2 border-b border-line px-4 md:px-6 py-3 shrink-0">
|
||||
<div className="rounded-card border border-line bg-surface shadow-raised min-w-0" data-testid="tables-list">
|
||||
<div className="flex flex-wrap items-center gap-2 border-b border-line px-card py-card-y">
|
||||
{picking || picked.size ? (<>
|
||||
<Button size="sm" variant="ghost" icon={<X size={14} />} onClick={stopPicking}>{picked.size ? t('tablesList.picked', { count: picked.size }) : t('tablesList.pick')}</Button>
|
||||
<Button size="sm" variant="ghost" onClick={pickAll}>{t(allPicked ? 'tablesList.unpickAll' : 'tablesList.pickAll')}</Button>
|
||||
@@ -92,13 +92,13 @@ export default function TablesListTab() {
|
||||
</span>
|
||||
)}
|
||||
<span className="flex-1" />
|
||||
<Button size="sm" variant={inactive ? 'primary' : 'secondary'} aria-pressed={inactive} onClick={() => setInactive(v => !v)}>{t('tablesList.showOff')}</Button>
|
||||
{!picking && <Button size="sm" variant="secondary" onClick={() => setPicking(true)} data-testid="tables-pick">{t('tablesList.pick')}</Button>}
|
||||
<Button size="sm" variant="secondary" icon={<Plus size={14} />} onClick={() => setDialog({ kind: 'zone', zone: {} })} data-testid="zone-new">{t('tablesList.newZone')}</Button>
|
||||
<Button size="sm" icon={<Plus size={14} />} onClick={() => setDialog({ kind: 'table', table: null })} data-testid="table-new">{t('tablesList.newTable')}</Button>
|
||||
<Button variant={inactive ? 'primary' : 'secondary'} aria-pressed={inactive} onClick={() => setInactive(v => !v)}>{t('tablesList.showOff')}</Button>
|
||||
{!picking && <Button variant="secondary" onClick={() => setPicking(true)} data-testid="tables-pick">{t('tablesList.pick')}</Button>}
|
||||
<Button variant="secondary" icon={<Plus size={16} />} onClick={() => setDialog({ kind: 'zone', zone: {} })} data-testid="zone-new">{t('tablesList.newZone')}</Button>
|
||||
<Button icon={<Plus size={16} />} onClick={() => setDialog({ kind: 'table', table: null })} data-testid="table-new">{t('tablesList.newTable')}</Button>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap border-b border-line px-4 shrink-0" role="tablist" aria-label={t('tablesList.zones')}>
|
||||
<div className="flex flex-wrap border-b border-line px-card" role="tablist" aria-label={t('tablesList.zones')}>
|
||||
{tabs.map(x => {
|
||||
const i = x.zone ? zones.indexOf(x.zone) : -1
|
||||
return (
|
||||
@@ -119,7 +119,7 @@ export default function TablesListTab() {
|
||||
</div>
|
||||
|
||||
{zone && (
|
||||
<div className="flex flex-wrap items-center gap-3 px-4 md:px-6 py-2 border-b border-line shrink-0">
|
||||
<div className="flex flex-wrap items-center gap-3 px-card py-2.5 border-b border-line bg-surface-2">
|
||||
<span className="font-semibold text-ink text-label">{zone.name}</span>
|
||||
{zone.prefix && <Pill>{zone.prefix}</Pill>}
|
||||
<Button size="sm" variant="ghost" icon={<Pencil size={13} />} onClick={() => setDialog({ kind: 'zone', zone })}>{t('tablesList.editZone')}</Button>
|
||||
@@ -127,7 +127,7 @@ export default function TablesListTab() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex-1 overflow-y-auto p-4 md:p-6">
|
||||
<div className="p-card">
|
||||
{!shown.length ? <EmptyState title={t(inactive ? 'tablesList.none' : 'tablesList.noneActive')} /> : (
|
||||
<ul className="rounded-card border border-line bg-surface divide-y divide-line overflow-hidden">
|
||||
{shown.map((x, i) => {
|
||||
|
||||
Reference in New Issue
Block a user