Skip to content

fix(CodeBlock): file tabs are a SegmentedControl, so the selection slides - #508

Merged
lorant-one merged 2 commits into
previewfrom
fix/codeblock-tabs-segmented
Nov 13, 2026
Merged

lorant-one merged 2 commits into
previewfrom
fix/codeblock-tabs-segmented

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Requested by Lorant · project thread

What

The row of files above a multi-file CodeBlock (Preview / Store / Header4 …) was built from separate ToggleButtons, so the selected background jumped from one file to the next. It's now a SegmentedControl:

  • The selected background slides to the new file, using the control's own sliding pill. Visitors who ask for reduced motion see it move without the slide.
  • The files are real tabs (tablist / tab), and the arrow keys move between them.
  • The rail drops its own border inside the block (.tabs [role="tablist"] in CodeBlock.module.scss), so you don't get a box inside the block's border.

onInstanceChange still reports the index. The old handleContent helper looked a file up by its label, so two files with the same label picked the wrong one. It is gone, and the index is used directly.

This doesn't break anything: no prop changes, so it goes to preview, not 3.0.

Checks

  • Checked in a browser on the dev app (dark). The pill slides, and the header keeps its height.
  • Full core suite: 3679 tests pass. Two CodeBlock interaction tests looked for the files by role button; they now look for tab.
  • Typecheck is clean, and there's a changelog entry under Unreleased › Fixed.
  • The visual check will flag the CodeBlock demos as changed. That's intended, so this is labelled visual-change.

Generated by Claude Code

…ides

The row of files above the code was a set of ToggleButtons, so the selected
background jumped. It is now a SegmentedControl: the background slides, the
files are tabs with arrow-key focus, and the rail drops its border inside
the block's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
@lorant-one lorant-one self-assigned this Nov 13, 2026
@lorant-one
lorant-one merged commit 2b5a456 into preview Nov 13, 2026
9 checks passed
@lorant-one lorant-one added the approved label Nov 13, 2026 — with Claude
@lorant-one
lorant-one deleted the fix/codeblock-tabs-segmented branch November 15, 2026 10:38
lorant-one pushed a commit that referenced this pull request Nov 19, 2026
Pulse's reduced-motion fix (#509) moves to PulseRing, which StatusIndicator
pulse draws in 3.0; CodeBlock's file tabs (#508) use SegmentedControl's
onValueChange; rimraf ^6.1.4 (#529); lockfile regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YJHdG7ZbpQS64MtL5PVbT1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants