Repository navigation
Description
Context
Below 900px, Settings shows its sections as a horizontal tab strip. A chevron cue at the right edge tells the user there are more tabs. Script drives the cue:
useStateholdsoverflow(packages/ui-react/src/components/settings/settings-panel.tsx:57).- The scroll-into-view effect recomputes it (
setOverflow,settings-panel.tsx:90). - A separate
scrolllistener re-renders the panel on every scroll that changes the answer (cue,settings-panel.tsx:92-97). - The chevron itself is a sibling positioned over the strip (
settings-panel.tsx:155).
The same effect's ResizeObserver also keeps the selected tab in view (keepVisible, settings-panel.tsx:83-91). That part is unrelated to the cue and stays.
Guide ui-atoms/scrollability-affordance-hints puts the indicator on container-type: scroll-state plus @container scroll-state(scrollable: …), and says: "Since these are hints and not critical for functionality, it is acceptable to omit them in unsupported browsers."
Support for scroll-state container queries: Chrome Android 133, Samsung 29 (current is 30), not in Firefox (MDN browser-compat-data).
Decision taken here: no JavaScript fallback. In Firefox for Android the chevron does not appear. The strip still scrolls, the selected tab is still scrolled into view, the last visible tab is visibly cut at the edge, and arrow-key traversal is unchanged. A cue that needs a listener only in the browser that lacks the query would keep all the code this issue removes.
Scope
- Give the strip (
stripRef,settings-panel.tsx:154)container-type: scroll-state. - Replace the trailing spacer span inside the strip with the chevron cue. Keep it
aria-hiddenandpointer-events: none, and make it sticky at the inline end, the same 24px wide. It is hidden by default and shown under@container scroll-state(scrollable: inline-end). - Delete the
overflowstate, bothsetOverflowcalls, thecuelistener, and the absolutely positioned sibling at:155.
Out of scope
- The
keepVisibleResizeObserverand the arrow-key scroll logic intraverse. - A start-edge cue.
- The vertical pane layout at 900px and up.
- Any other horizontal scroller.
Acceptance criteria
-
settings-panel.tsxhas nooverflowstate and noscrolllistener. - A real-browser layout test at 360px width passes both before and after the change. It shows that behaviour is preserved, so the PR also records a mutation receipt: deleting the
@containerrule makes the test fail. The test checks:- With the first tab selected, the chevron is visible.
- After the strip is scrolled to its end, the chevron is hidden.
- At a width where every tab fits, the chevron is hidden.
- Android support: the PR states that the cue is CSS-only, shows in Chrome and Samsung, and is omitted in Firefox. The strip still scrolls there and its tabs stay reachable.
- The Settings visual baselines are unchanged at the widths they already cover.
Verification
node scripts/visual.mjs --project=ui-react-layout --filter=settings-structure
bun run visual
bun run test
bun run typecheck
bun run lint
Contract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. - This changes a published package's behaviour, so it needs a changeset.
@schlessera/brain-ui-react: patch. Firefox loses the cue, as decided above.
Activity