Skip to content

ui-react: drive the Settings tab-strip overflow cue with a scroll-state container query #2602

Open

Description

@schlessera

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:

  • useState holds overflow (packages/ui-react/src/components/settings/settings-panel.tsx:57).
  • The scroll-into-view effect recomputes it (setOverflow, settings-panel.tsx:90).
  • A separate scroll listener 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-hidden and pointer-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 overflow state, both setOverflow calls, the cue listener, and the absolutely positioned sibling at :155.

Out of scope

  • The keepVisible ResizeObserver and the arrow-key scroll logic in traverse.
  • A start-edge cue.
  • The vertical pane layout at 900px and up.
  • Any other horizontal scroller.

Acceptance criteria

  • settings-panel.tsx has no overflow state and no scroll listener.
  • 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 @container rule 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 contract label, a CONTRACT: 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

  1. added
    type: refactor
    area: ui-react
    priority: p3
    agent-ready
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-reactpriority: p3type: refactor

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions