Repository navigation
refactor(ui): adopt the priority+ tab pattern on Settings, Operations and NavBar (#1925) - #2781
Conversation
Review —
|
|
CI fix, pushed — and the break was mine.
Attributed before fixing rather than assumed: the spec passes against plain What changed. Properties 1 and 2 (links never collide with the controls; controls stay on-screen and the user menu stays hit-testable) are untouched and still pass — they were never about the mechanism. Property 3 now pins what this PR actually guarantees: links that fit render inline, the rest collapse into a counted "N more", the count agrees with what the menu holds, every hidden link carries a real href, and Escape closes it. It also pins the absence of the old mechanism — no
Verified the rewrite is not vacuous: at 640px the trigger reads The stack (#2782 → #2787) was rebased onto this commit; each PR's own diff is unchanged (verified file/line counts before and after). All eight PRs are now green. |
f70cc87 to
39bb7b1
Compare
4e6fff4 to
4458af1
Compare
/review — post-rebase (stacked on
|
|
merge-train (#2896, dry run): pushed |
39bb7b1 to
e824ed2
Compare
1b080af to
a2a60c0
Compare
|
merge-train: pushed |
e824ed2 to
26cfb9c
Compare
… and NavBar (#1925) Three audited surfaces hand-rolled a tab/nav strip instead of using the `OverflowTabs` primitive (#1114). Settings and Operations now render their tabs through it; NavBar gets the same measured priority+ split without mounting it, because its items are `<router-link>`s that must keep a real href and the primitive's are `<button>`s that emit a selection. NavBar is the case the audit called worst. Its link row was an `overflow-x-auto` scroller with the scrollbar suppressed inside the 64px bar (#1789), so an overflowed link stayed reachable but became invisible and undiscoverable — the bar gave no signal that more navigation existed. It now renders the links that fit plus a counted "N more ▾" disclosure, with the active state reflected on the trigger when the current route's link is one of the hidden ones. The fit arithmetic is SHARED, not re-derived: `utils/overflowFit.js` holds the rule verbatim from `OverflowTabs::recompute`, and both surfaces call it. It also gained a `gap` term, which NavBar needs and the tab strip does not — the tabs are padding-spaced, while the nav row carries a real flex gap that is invisible to the per-item rects, and a gap-blind sum hides ~120px on a six-link row (one whole link) and so keeps the last one inline to clip. Both new modules are pure because vitest runs `environment: 'node'` with no mount harness, so a rule inside an SFC is one no test can reach (the ent#392 precedent). `utils/navLinks.js` likewise derives the link set once — a strip that can hide a link renders the same link three times (inline, menu, hidden mirror), and three hand-written copies is three places for an active predicate or a badge to drift. Colours: the new code is semantic-token only, so the active underline moves from raw `blue-500/400` to `action-primary` (the primitive's own active token) and the Enterprise PRO pill from raw `purple-*` to `accent-purple-*`. Visible as a slight indigo shift on the nav's active indicator. Triage of the audit's nine scanner candidates: every one is a bounded wide table or a preformatted code block, where horizontal scroll inside the container is the correct treatment (design-system principle 7) — collapsing columns into a "More" menu would hide data, not navigation. None migrate; each is marked in place so a later audit does not re-flag it. The advisory two-pill strip in Audit.vue is a segmented control, a different primitive, and is recorded as such. `workspaceNewTab.spec.js` (ent#456) asserted `target`/`rel` against NavBar's template text; that truth moved into `navLinks.js`, so the NavBar half now drives the data and additionally pins that the strip binds both fields onto its links — the half a data-driven refactor can get wrong is correct data that never reaches the DOM. Baseline: NavBar raw_nongray 35 -> 19, raw_gray 125 -> 105. Edited by hand rather than regenerated, per the `refrozen` note — a wholesale run deletes that block. Fixes #1925 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Q19uRCksdn4DiRAJ55rfpZ
Caught by a live check, not by the suite: at 1440px the strip hid four of five links behind "4 more". The row and its parent cluster sized to content, so `clientWidth` reported the row's own min-content — and because the inner nav is `overflow-hidden`, that is near zero — making the fit rule correct about a container that was lying to it. The old #1789 row never needed this: a row that SCROLLS sizes to its content and lets the overflow happen, while a row that COLLAPSES has to be told how much space it actually has. `flex-1` on both supplies it; `justify-between` plus the controls' `flex-shrink-0` keeps the right-hand cluster where it was. Verified against the local dev instance across 1440/1300/1200/1100/1000/900/800/700 and back up again: one row at every width, never clipped, collapsing at 800 and 700 and re-expanding on the way back up. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Q19uRCksdn4DiRAJ55rfpZ
…ll row (#1925) `navbar-overflow.spec.js` is #1789's guard, and its third test asserts `overflow-x: auto` on the link row — the hidden-scrollbar scroller this issue deliberately replaced. It went red the moment the strip started collapsing, and I missed it because I grepped `src/` for that pattern and never `e2e/`. Confirmed it is this branch and not the tree: the spec passes against plain `origin/dev` built and served the same way, and fails here. Properties 1 and 2 — links never collide with the controls, controls stay on-screen and the user menu stays hit-testable — are unchanged and still pass; they were never about the mechanism. Property 3 now pins what #1925 actually guarantees: the links that fit render inline, the rest collapse into a counted "N more" disclosure, the count agrees with what the menu holds, every hidden link is a real href, and Escape closes it. It also pins the ABSENCE of the old mechanism — no `overflow-x: auto`, no scrollWidth past the box. A future refactor reintroducing the scroll row would restore exactly the undiscoverable-link failure this issue removed, and this is where that gets caught. `settleNav` is not politeness: the strip re-measures on a rAF after a resize, so a snapshot taken in the same tick as `setViewportSize` reports the previous split — "it fits" one frame before the links move into the menu. That is how the first version of this rewrite failed, and the fix is to sample until two reads agree rather than to widen a timeout. Verified against this branch's build: 4/4 pass, and the collapsed branch is genuinely exercised — at 640px the trigger reads "4 more" with 1 link inline and 4 in the menu, at 1440px there is no trigger and 5 links inline. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Q19uRCksdn4DiRAJ55rfpZ
…anical, per the merge-train note on the PR CodeQL js/incomplete-multi-character-sanitization (train #2896, alert 364) flagged the one-shot replace in a source-text guard. A fixpoint loop is the shape the rule accepts; behaviour on every real input is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…) — mechanical, per the merge-train note on the PR The train (#2922's source-text ratchet + this stack) found the joint break: this spec reads 20 SFCs by text and is a NEW spec with no baseline entry. It is a legitimate pin — an adoption guard over a set of call sites a mount cannot prove — so it declares itself one, per the ratchet's escape hatch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
merge-train: rebased onto
Locally on the rebased tree: rawColorRatchet, loadingGateRatchet, tabStripAdoption, navLinks, overflowFit, workspaceNewTab — 73/73. Advisory notes from validation left for a follow-up: Operations.vue keeps a wrapper |
bb1b101 to
bc287f2
Compare
…1925) — mechanical, per the merge-train note on the PR The note narrated 35 -> 19 / 125 -> 105; the entry holds 7 / 93 against dev's 23 / 113 (post-rebase compose with ent#625). Co-Authored-By: Claude Fable 5.1 <[email protected]>
bc287f2 to
1c10dd1
Compare
|
merge-train: the tab-role fix is reverted; #2960 tracks it. The |
Stacked on #2780 (
refactor/1924-confirmdialog-destructive) — review the diff of the last two commits, or rebase ontodevonce #2780 lands.Fixes #1925
What
Three audited surfaces hand-rolled a tab/nav strip instead of using the
OverflowTabsprimitive (#1114).views/Settings.vueandviews/Operations.vuerender their tabs through the primitive.components/NavBar.vuegets the same measured priority+ split without mounting it.NavBar cannot mount
OverflowTabs: the primitive's items are<button>s that emit a selection, and these are<router-link>s that must keep a real href (middle-click, Workspace's_blank, per-link active predicates, a per-link badge and a pill). So the fit arithmetic is shared instead —utils/overflowFit.jsholds the rule verbatim fromOverflowTabs::recompute, and both surfaces call it. Widening the primitive to render links would have meant ato/target/rel/custom-predicate/pill mode on a component five other strips already depend on.Why NavBar was the worst case
Its link row was an
overflow-x-autoscroller with the scrollbar suppressed inside the 64px bar (#1789). Links stayed reachable but became invisible and undiscoverable — the bar gave no signal that more navigation existed. It now renders what fits plus a counted "N more ▾", with the active state reflected on the trigger when the current route's link is one of the hidden ones, and the Operations badge riding along so a pending count is never hidden with its link.Two pure modules, because the suite has no DOM
vitestrunsenvironment: 'node'with no mount harness, so a rule inside an SFC is one no test can reach (the ent#392 precedent).utils/overflowFit.js— the fit rule. Gained agapterm that NavBar needs and the tab strip does not: the tabs are padding-spaced, while the nav row carries a real flex gap that is invisible to the per-item rects. A gap-blind sum hides ~120px on a six-link row — one whole link — and so keeps the last one inline to clip.utils/navLinks.js— the link set and its active/badge rules. A strip that can hide a link renders the same link three times (inline, menu, hidden mirror); three hand-written copies is three places for a predicate or a badge to drift.Both are driven for real by
overflowFit.spec.js(10 cases) andnavLinks.spec.js(15).tabStripAdoption.spec.jsis a ratchet only — it pins that the three surfaces stay wired and have not drifted back to a hidden-scrollbar scroller.A source-text guard that had to be retargeted
workspaceNewTab.spec.js(ent#456) assertedtarget/relagainst NavBar's template text. That truth moved intonavLinks.js, so the NavBar half now drives the data — and additionally pins that the strip binds both fields onto its links, which is the half a data-driven refactor can get wrong: correct data that never reaches the DOM.Triage of the audit's nine scanner candidates
Every one is a bounded wide table or a preformatted code block, where horizontal scroll inside the container is the correct treatment (design-system principle 7) — collapsing columns into a "More" menu would hide data, not navigation. None migrate; each is marked in place so a later audit does not re-flag it, and the ratchet fails if a marker disappears.
The advisory two-pill strip in
Audit.vueis a segmented control — two short fixed labels in a panel header, selecting which chart the panel draws. It cannot overflow, and a "More ▾" over two items would hide one behind a click for no gain. Recorded as such rather than left unexplained.Colours
New code is semantic-token only, so the nav's active underline moves from raw
blue-500/400toaction-primary(the primitive's own active token) and the Enterprise PRO pill from rawpurple-*toaccent-purple-*. Visible as a slight indigo shift on the active indicator. Baseline:NavBar.vueraw_nongray 35 → 19, raw_gray 125 → 105 — edited by hand rather than regenerated, per therefrozennote (a wholesale run deletes that block).The bug the suite could not catch
The first version hid four of five links at 1440px. The row and its parent cluster sized to content, so
clientWidthreported the row's own min-content — near zero, since the inner nav isoverflow-hidden— making the fit rule correct about a container that was lying to it. A row that scrolls sizes to its content; a row that collapses has to be told how much space it has.flex-1on both supplies it (second commit).Verification
Full frontend suite: 132 files, 2916 tests, all passing.
Against the local dev instance (this branch's bundle, real admin login), sweeping 1440 → 700 and back up:
2 more3 more 16Settings collapses to
More ▾at 560 with General · Access · Integrations · MCP Keys inline; Operations collapses its own strip at 760. No strip wrapped to a second row or clipped at any width tested.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q19uRCksdn4DiRAJ55rfpZ