Repository navigation
fix(nav): fit the Config menu and the cluster bar to narrow windows - #2115
Merged
Merged
Conversation
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>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⊙ 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
🔧 Changes
src/features/instance/config/index.tsx:MobileConfigNavBaris now a dropdown, given the page list instead of rendered links. The button names the current page, matching the Overview by the same index test the redirect uses, because an exact route match missesconfig/.src/hooks/useFitLevel.ts: new hook. It steps through layouts, richest first, until an element's content fits. A wider element or a new reset key starts again from the first, and it watches the element's children so content that grows without a render still re-fits.src/components/Breadcrumbs.tsx: the trail is nowuseBreadcrumbTrail(), rendered by a newBreadcrumbList. Itscollapseprop folds leading crumbs into a non-modal "…" menu and always keeps the last crumb, which it marks for the bar to measure. The restart badge no longer shrinks or wraps.src/features/instance/InstanceNavBar.tsx:navBarLayouts()sets the order things are given up; a crumb once folded stays folded. The bar's reset key covers the path, crumb labels, tabs and restart flag. A last crumb cut below 40px counts as not fitting: once only the last crumb is left it may truncate, but below 40px the bar moves tabs into More instead. Tab names show whenever they fit, rather than from 1280px. Overflowing tabs join the More menu, which is now non-modal.🤔 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
config/andconfig, 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.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