Let the owner manage categories, and give the menus a shelf

Categories were baked into config/<site>.site.json, so adding one meant a
rebuild and a redeploy. They are now data: data/sections.json, seeded from the
config the first time, and managed in the admin (add, rename, reorder, remove).
A category's web address is fixed when it is created because that is what a QR
code points at, and a category cannot be removed while it still holds menus.

The landing and the top bar were the ugliest parts. The landing was a column of
hairlines with tiny meta — a broadsheet, and the paper that makes this app worth
looking at was nowhere on it. It is now a shelf: each category is a row whose
right edge is a sliver of that menu's first page, bleeding off the screen, with
the shelf edge in brass and the name in heavy tight Archivo. The bar was a row
of teal pills that would not survive more categories: it now names the menu you
are reading and opens a sheet listing the rest, each with its own paper sliver,
and the current one is the only teal thing on screen. The sheet is a link to the
landing page, so navigating still works without the script.

Also fixes the category manager's own layout, which I shipped unstyled, and the
markup contract the route tests described.
This commit is contained in:
tanshu committed 2026-09-22 22:24:53 +05:30
1 parent 7bf67cc299
commit c31b73d553
25 files changed
+1225 -190

No files matched your search

+57
View File
@@ -320,3 +320,60 @@
.login input {
width: 100%;
}
/* ---------- Categories ---------- */
.catlist {
margin: 0.4rem 0 0;
padding: 0;
list-style: none;
}
.catrow {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.4rem 0.6rem;
padding: 0.5rem 0;
border-bottom: 1px solid var(--hairline-soft);
}
.catrow__name {
display: flex;
flex: 1 1 13rem;
gap: 0.4rem;
min-width: 0;
}
.catrow__name input {
flex: 1 1 auto;
min-width: 0;
padding: 0.4rem 0.5rem;
border: 1px solid var(--hairline);
background: var(--steel);
color: var(--ink);
font: inherit;
font-size: 0.95rem;
}
.catrow__url {
color: var(--ink-dim);
font-size: 0.8rem;
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.catrow__actions {
display: flex;
gap: 0.25rem;
margin-left: auto;
}
.fold--categories > summary {
color: var(--ink);
font-size: 0.95rem;
}
.fold--categories .muted {
margin: 0.5rem 0 0;
}