Stop the code editor's copy button collapsing to a squashed stadium - #12
Merged
Merged
Conversation
The copy affordance lives in a `sticky top-0 flex h-0 justify-end` row so it claims no layout. With no `align-items`, the flex default of `stretch` sized the button to that row's zero height: it rendered as a padding-only 24x10 stadium with the 16px copy glyph spilling out top and bottom. Pin the row to `items-start` so the button keeps its intrinsic size, and guard it with a test asserting the button stays square and still contains its own icon. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The bug
CodeEditor'scopyablebutton renders as a squashed stadium with the copy glyph spilling out of it, top and bottom.The button sits in a deliberately zero-height sticky row so it claims no layout:
That row sets no
align-items, so flexbox'sstretchdefault sized the button to the row's height — zero. The button collapsed to padding + border only (24x10), while the 16px icon inside kept its size and overflowed.The fix
Add
items-startso the button keeps its intrinsic size. One class; the sticky/zero-height behaviour it was written for is untouched.Verification
tests/interactions.spec.tsasserts the button stays square and is taller than the glyph it wraps. It fails onmain(height 10 vs icon 16) and passes with the fix.lintandtypecheckclean.🤖 Generated with Claude Code