feat(webui): land the Phase 1 foundation on the navigation restructure

Two Vue branches were in flight and looked like competing versions of the same
change. They were not: this branch had the navigation restructure (Phase 4)
and the route table, and the other worktree had the Phase 1 foundation, still
uncommitted. Neither had ported a page. This reconciles them.

What came across from the foundation:

- lib/api.ts, the one client every request goes through, so the CSRF and
  Content-Type headers live in a single place, plus the four framework-free
  modules it needs: uuid, stream-state, format, task-meta.
- loadTaskMeta() at boot, so /api/task-meta replaces the freeze-dried
  lifecycle defaults instead of the catalogue being frozen into the bundle.
- capabilities.ts keeps the other branch's pure hiddenRoutes, but reads
  route.meta.section. The other version read route.section, which is always
  undefined for this route table, so its capability gating was silently dead.

The route table stays this branch's: internal/gateway's registry test holds it
in parity with the agent-facing page index in both directions, and the other
branch's table fails it with seven errors.

The frame is Tailwind on the shell, not a ported stylesheet. layout.css
described a shell, a topbar and a nav as authored classes, but the topbar is a
Vue component like every other surface and emits none of them, so two thirds
of that file had no consumer. What the frame needs is now the shell element's
own utilities plus the canvas, focus floor and motion preference in
style.css's base layer, where a global element rule belongs. Verified equal to
the stylesheet it replaces: 20px radius, hairline border, blur(28px)
saturate(1.2), and the narrow-screen collapse.

Also fixes the bundle freshness check failing on the first build after any
change, which had cost both branches of this port a rebuild-and-retry. ui/dist
is committed, so nothing ignores it and Tailwind's content detection scanned
it, making every build an input to the next: class strings left in the bundle
generated utilities for classes nothing references any more, so an unchanged
tree built a different bundle. Excluding it also drops ~12KB of dead CSS.
This commit is contained in:
sam committed 2026-09-20 19:14:46 +10:00
1 parent 393e30ed1a
commit ff8369c5ac
12 files changed
+598 -65

No files matched your search

+45
View File
@@ -4,6 +4,14 @@
@import "tw-animate-css";
@import "shadcn-vue/tailwind.css";
/* ui/dist is committed, so nothing ignores it and Tailwind's automatic content
detection scans it. That makes every build an input to the next one: class
strings left in the committed bundle generate utilities for classes nothing
references any more, so rebuilding an unchanged tree produced a different
bundle and tools/uidist.sh's freshness check failed on the first build after
every change. The bundle is generated, never a source. */
@source not "../dist";
/* The theme is an attribute on <html>, not a class, so the inline script in
index.html can set it before the first paint and a reload does not flash the
wrong palette. */
@@ -220,5 +228,42 @@
body {
@apply bg-background text-foreground;
@apply font-sans;
/* The luminous canvas the shell floats on. Large, off-axis and
low-frequency, so it lights the workspace rather than competing with
it, and fixed so the surface above reads as glass rather than a
scrolling image. The padding is the margin the frame sits inside. */
background:
radial-gradient(70rem 40rem at 8% -10%, var(--wash-a), transparent 62%),
radial-gradient(56rem 34rem at 92% 4%, var(--wash-b), transparent 58%),
radial-gradient(48rem 30rem at 50% 108%, var(--wash-c), transparent 60%),
var(--background);
background-attachment: fixed;
padding: 1rem;
}
/* The focus floor. A component may style its own focus state; this
guarantees that nothing is ever focused and invisible for a keyboard
user. `:focus-visible` rather than `:focus` so a mouse click does not
draw a ring around what was clicked. */
:focus-visible {
outline: 2px solid var(--primary);
outline-offset: 2px;
}
/* The frame is a desktop affordance: below this width the workspace goes
edge to edge, because a rounded card inset on a phone wastes the only
axis that matters. */
@media (max-width: 900px) {
body {
padding: 0;
}
}
/* An accessibility invariant, not a nicety: nothing animates for someone
who has asked it not to. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
}