Redesign code block controls as a header bar - #218
Merged
Merged
Conversation
MaggieAppleton
force-pushed
the
design/code-block
branch
from
September 30, 2026 10:13
eb3afb6 to
924c956
Compare
MaggieAppleton
force-pushed
the
design/code-block
branch
from
September 30, 2026 10:45
0227b49 to
404e81e
Compare
MaggieAppleton
added this pull request to stack #227
September 30, 2026 11:04
Language menu becomes a ghost button with a listbox panel, the source toggle an icon button, and the block one bordered box with a shared 0.75rem left edge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps focus geometry in theme.css instead of exempting the editor stylesheet from the focus guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Consecutive fences touched once the loose control rows became a header inside the box. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Renew reviewed dynamic exception hashes for the new CodeIcon and the edited CodeView boundary, add a reviewed exception for the new LanguageMenu portal's measured placement and presence className, and extend the legacy mono-stack exception to the new file-view selector. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The code specimen's baseline changes to match the intentional header-bar redesign (taller box for the new chrome). The table specimen's baseline also shifts by a hair: it renders below the code specimen on the same continuous audit page, and the code specimen's ~82px height growth nudges its rasterization by a sub-pixel amount even after the fixture's own fractional-scroll correction. Verified repeatable by rerunning design:browser without --update-snapshots. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Same reviewed findings, differently-shaped axe selectors: code.json's selector attribute changed from [role="group"] to [data-view="file"] because the redesign adds that attribute to the same code-preview div. Also drops one narrow-only entry (the "12" digit contrast finding, still present at wide) that no longer surfaces as a separate node, most likely merged into an adjacent span by the new header's line-wrapping at that width. chat.json's three entries are the same approved chat-timestamp/queued-status finding with two Tailwind classes reordered in axe's generated selector string; chat.tsx itself is untouched by this PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
MaggieAppleton
force-pushed
the
design/code-block
branch
from
September 30, 2026 11:14
e255798 to
b04879c
Compare
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.
Turns the loose row of code block controls into one bordered unit with a slim header, and replaces the native language
<select>with the app's own menu.Change
LanguageMenuhas a ghostbtn-smtrigger and a portalled listbox with the app's dropdown motion. It supports keyboard use (arrows, Home/End, Enter/Space, Escape, Tab, type-to-jump) and dismisses on an outside click without moving the editor caret. Read-only viewers see a plain label instead of a disabled grey field.btn-icon btn-ghostwith a newCodeIconand a tooltip, and it tints petrol while the source is open.data-focus-boundary, so focus rings draw inside the controls and the rounded box never crops them. The listbox panel has no ring of its own, because its highlighted option shows the keyboard position. That rule lives intheme.css, where the focus guard allows it.Verification
bun test,bun run typesandbun run cipass.e2e/code.e2e.tsande2e/responsive-content.e2e.tspass 15 of 15 on Chromium, including a new keyboard listbox test: ArrowDown opens the menu, Escape returns focus to the trigger, an outside click dismisses it, Tab moves to the source toggle, and Enter selects.Screenshots
Captured from the dev-only design audit page at 2x, on
mainand on this branch, with the code specimen made editable so the controls are live.Code blocks
main)Language menu open, and source shown
Diffs and diagrams
main)Taking these showed that consecutive fences now touched once the loose control rows became a header inside the box, so
eb3afb62gives code blocks the samemargin-block: 1emas tables.Review fixes
The real editor below shows a normal code title and the restored filename on an invalid diff.
🤖 Generated with Claude Code
CI navigation regression
Fixes a race inherited from #153: canonicalizing the current document URL could cancel navigation to a newly created document. The guard now tracks navigation separately from canonical URL changes. The onboarding test also uses a fresh identity for each retry.
Validated with 51 creation, onboarding and navigation browser tests, plus five repeated runs of each race-sensitive case; types, CI checks and build passed.