Skip to content

fix(nav): fit the Config menu and the cluster bar to narrow windows - #2115

Merged
dawsontoth merged 5 commits into
stagefrom
claude/cluster-config-submenu-scroll-5dc518
Nov 17, 2026
Merged

dawsontoth merged 5 commits into
stagefrom
claude/cluster-config-submenu-scroll-5dc518

Conversation

@dawsontoth

@dawsontoth dawsontoth commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
A squirrel tucks signs into a pouch so a row of picture signs fits its branch

⊙ Problem

Inside a cluster, two bars break on narrower windows. Below 768px, Config lays its 16+ pages out in one row, so the whole page scrolls sideways. Up to about 1500px, the top bar's breadcrumbs and tabs don't fit: tabs run off the right edge, Config included, or their names wrap out of the bar.

💡 Solution

⚖️ Alternatives

  • Fixed breakpoints or container queries — the room needed depends on how many tabs a cluster's components add and on how long its names are, so any fixed width is wrong for some cluster.
  • Scrolling the tab row — it is the sideways scrolling this change removes.
  • Hamburger menu up to 1280px — hides every tab behind a click even where icons fit.

🔧 Changes

🤔 Which tab should stay when tabs move into More?

The last tab (Config) stays and the ones before it go first, so component tabs move before built-in ones. Keeping the active tab visible instead is a small change where the bar splits its tabs.

🤔 Should the bar's two menus stay non-modal?

A modal menu hides the page's scrollbar, which widens this fixed bar; the re-fit then unmounted the open "…" menu. Non-modal keeps the page scrollable while a menu is open. The alternative is ignoring small width changes in the fit, which is easy to revisit.

✅ Verification

  • Browser, signed in to a stage cluster with two component tabs: at 375, 768, 1024, 1280 and 1600px there is no page-level horizontal scroll and every tab is visible. The Config dropdown and the "…" menu open and navigate; dark mode checked at 375px. At 768px all nine tabs fit beside a 61px crumb. Squeezing the bar to 585, 505 and 425px moved two, four and six tabs into More with no overflow, and More opened and listed them.
  • New unit tests: the Config dropdown (current page, Overview at config/ and config, a lesser role's list); the folding breadcrumb (menu links, last crumb kept); the layout order and the bar fitting itself (icons, More, the 40px floor); and the fit hook (reset key, widening, narrowing, growth in place). Reverting the trailing-slash, widen-reset, keep-the-last-crumb, floor and grow-in-place guards each turns a test red.
  • Full gate on the commit hook: vitest (731 files), tsc -b, oxlint, dprint, commitlint.

🤖 Generated by Anthropic Claude Code (Claude Opus 5.5); posted via @dawsontoth.

Related PRs: #2104 overlaps (edits the same nav links and Config entries; rebase whichever lands second)
Complexity: medium

Review-Coverage: authored=claude; ran=cursor-composer,gemini,codex,cursor-grok; late=cursor-grok:adjudicated; adjudicated=domain; declined=muse; rounds=3; full=2 @ 05538f3

Review-Attention: read ~6m (decisions: do-less-alternative, widen-resets-to-zero, tabs-nearest-config-move-first, last-crumb-floor-40px, config-mobile-dropdown, unkeyed-probe-effect) @ 05538f3

dawsontoth and others added 5 commits November 17, 2026 12:06
Below the md breakpoint the Config page listed every page (sixteen on a
current release, plus any a component adds) as one horizontal row with
no overflow handling, so the whole page scrolled sideways. It is now one
full-width button naming the current page, which opens the full list:
Overview first, then the pages by name, the current one highlighted.
That is the shape SubNavRail already gives the org, cluster and admin
sections. The desktop sidebar is unchanged.

The button names the Overview from the same index test the redirect
uses, because an exact route match misses the `config/` the router also
sends there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At widths between md and roughly 1500px the bar's breadcrumbs and tabs
needed more room than it had: tabs ran off the right edge (Config
included), "Apps" wrapped under its icon, and at 1280px the tab names
wrapped and pushed their icons out of the bar. The room needed depends
on how many tabs a cluster's components add and on how long its names
are, so no fixed breakpoint can hold it.

The bar now measures itself (useFitLevel) and gives up, in order: the
leading crumb, folded into a "..." menu that still links to it; then the
tab names, leaving icons with tooltips; then one more crumb at a time
down to the last. Tabs never shrink, so none slides out of view, and
only the last layout lets the remaining crumb truncate.

The "..." and More menus are not modal now: a modal menu hides the
page's scrollbar, which widened the bar, and re-fitting it unmounted the
"..." menu the moment it opened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of the fitting bar found three gaps:

- With five or more component tabs at 768px, even the last layout was
  wider than the bar and clipped the tabs on the right. As a last step
  the tabs before the last one now move into More, nearest first, once
  the last crumb is down to a 10rem floor.
- The icon-only layouts started by unfolding the crumb the layout
  before had folded, which could unmount an open "..." menu. They now
  start with it folded, so a folded crumb stays folded.
- The bar never re-widened when its content shrank in place, such as
  "* Restart Requested" clearing. The reset key now includes the crumb
  labels and the restart flag.

The bar also works out its breadcrumb trail once and hands it to the new
BreadcrumbList, and a narrowing that leaves nothing overflowing no
longer re-renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second review found two gaps in the fitting bar:

- The width floor sat on the whole crumb list, so the last crumb could
  still shrink to nothing, and a "* Restart Requested" badge that
  cannot shrink could spill over the first tab without the bar ever
  overflowing. The bar now also counts a last crumb truncated below
  40px (about four letters and an ellipsis) as not fitting, and the
  badge no longer shrinks or wraps.
- Content that grew without a re-render, such as a web font loading,
  was never re-fitted. The hook now watches the bar's children too, and
  re-fits on any resize that leaves the bar not fitting.

The reset key also covers tab names and tucked tabs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A resize that left the bar not fitting rendered the same layout once
before the layout effect stepped on, and at the last layout every such
resize rendered for nothing. The resize callback now steps to the next
layout itself and returns the state unchanged when there is nowhere to
go, so React skips the render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dawsontoth
dawsontoth requested a review from a team as a code owner November 17, 2026 17:47
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 85.91% 23249 / 27059
🔵 Statements 85.72% 24678 / 28787
🔵 Functions 81.91% 6477 / 7907
🔵 Branches 81.46% 20324 / 24948
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/Breadcrumbs.tsx 100% 73.33% 100% 100%
src/features/instance/InstanceNavBar.tsx 97.82% 100% 94.44% 97.82% 235-246
src/features/instance/config/index.tsx 100% 95.16% 100% 100%
src/hooks/useFitLevel.ts 94.11% 86.36% 100% 93.54% 36, 44
Generated in workflow #2606 for commit 05538f3 by the Vitest Coverage Report Action

@dawsontoth
dawsontoth merged commit 360ecad into stage Nov 17, 2026
7 checks passed
@dawsontoth
dawsontoth deleted the claude/cluster-config-submenu-scroll-5dc518 branch November 17, 2026 19:03
@dawsontoth
dawsontoth deployed to preview-cleanup November 17, 2026 19:03 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
preview-cleanup — 05538f3b Deployed Nov 17, 2026 by dawsontoth via cleanup #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant