fix(web): render settings sections as real tabs#620
Merged
Conversation
The settings sidebar looked like tabs but was implemented as scroll anchors: every section rendered at once and clicking a section only called scrollIntoView. Two things went wrong with that. The scroll container was never height-constrained. Its parent was a plain block div, so the child's `flex-1` did nothing and the scroller sized to its content, leaving scrollHeight === clientHeight — which makes scrollIntoView a guaranteed no-op. The overflow escaped to the shell's `overflow-hidden` and was clipped instead, so on a short window (~420px) the Agents and About sections were unreachable entirely, with no scrollbar to signal it. Even with that fixed, the whole surface is only ~680px tall, so at normal desktop heights everything already fit and clicking a section still moved nothing. With no section headings in the content column either, a click produced no feedback at all. Render only the active section instead. That drops the scroll dependency, so section switching cannot silently no-op at any viewport size. The nav is now a fixed rail with only the panel scrolling, and the active section gets a heading that labels the panel via aria-labelledby. Verified in-browser across desktop, short (380px) and mobile widths. - Add a guard asserting inactive sections are absent from the DOM. - notificationSettings.test.tsx asserted across sections, so it now opens the section holding the controls under test.
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.
Switching tabs in the settings view changed the URL but not the content. It turned out to be broken in two ways.
The sidebar looked like tabs but was implemented as scroll anchors — every section rendered at once, and clicking one only called
scrollIntoView.1. The scroll container was never height-constrained
SettingsSurface.tsx:111was a plain blockdiv, so its child'sflex-1did nothing and the scroller sized to its content:scrollHeight === clientHeightmakesscrollIntoViewa guaranteed no-op. The overflow escaped up to the shell'soverflow-hidden(scrollH 971 vs clientH 420) and was clipped — at a 420px-tall window, Agents and About sat at y=621 and were unreachable by any means, with no scrollbar to signal it.2. Even scrolling correctly, it read as dead
The whole surface is ~682px tall, so at normal desktop heights everything already fit and there was nothing to scroll to. With no section headings in the content column either, clicking produced zero feedback.
Fix
Render only the active section. That removes the scroll dependency entirely, so section switching cannot silently no-op at any viewport size. The nav becomes a fixed rail with only the panel scrolling, and the active section gets a heading that labels the panel via
aria-labelledby.This also deletes the now-dead
sectionRefs/useEffect/SettingsSectionDividermachinery — net −57 lines in the component.The URL grammar is unchanged:
/settings/:sectionstill deep-links and restores, and Back/Forward still work.Verification
Driven in a real browser at three viewports. Each tab swaps its rows:
/settings/settings/notifications/settings/connections/settings/agents/settings/aboutAt 380px tall the panel now genuinely scrolls (
clientH 287 / scrollH 290) with the last row reachable. Mobile keeps its horizontal pill strip.pnpm lintclean,tsc --noEmitcleanTests
SettingsSurface.test.tsxasserting inactive sections are absent from the DOM — this is what would have caught the original bug.notificationSettings.test.tsxasserted across sections, so it now opens the section holding the controls under test.