Skip to content

Put the copy button on the title's row, and call it "Copy .md" - #74

Merged
jnahian merged 1 commit into
mainfrom
fix/copy-button-inline
Sep 6, 2026
Merged

jnahian merged 1 commit into
mainfrom
fix/copy-button-inline

Conversation

@jnahian

@jnahian jnahian commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Follow-up to #72. The button sat above the heading on a row of its own, spending vertical space on a control and reading as a banner rather than as part of the title.

Now floated, so it shares the title's first line. Floated rather than laid out in a flex row because the h1 it sits beside is rendered markdown — there is no wrapper to make a flex parent of.

Also renamed Copy markdown → Copy .md: it names the thing the button hands you, and takes the control from 141px to 88px.

On the mobile case

The original comment on this block claimed the h1 wraps on a phone and leaves no room beside it. That turned out to be wrong. Measured at 390px with the longest title on the site — "Opening and moving between files" — the first line still has 209px beside the float and the remaining lines wrap full-width below it. No breakpoint needed.

Verified

Driven in a browser at 1440px and 390px: button on the title's row at both, no collision with the heading text, label going Copy .mdCopied → back, and the click fetching /docs/navigating.md (200, 2,703 chars).

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGMQ49hvA936om3GQfNTAn

The button sat above the heading on a row of its own, which spent vertical
space on a control and read as a banner rather than as part of the title.

Floated rather than laid out in a flex row: the h1 it sits beside is rendered
markdown, so there is no wrapper to make a flex parent of. The title text flows
around it at every width — at 390px the longest title ("Opening and moving
between files") still has 209px on its first line and wraps cleanly below the
float, so this needs no breakpoint of its own. An earlier comment claimed there
was no room beside the h1 on a phone; measuring says otherwise.

"Copy .md" over "Copy markdown" — it names the thing the button hands you, and
takes the control from 141px to 88px, which is most of why the narrow case is
comfortable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JGMQ49hvA936om3GQfNTAn
@jnahian jnahian self-assigned this Sep 6, 2026
@jnahian
jnahian merged commit 7cb8837 into main Sep 6, 2026
1 check passed
@jnahian
jnahian deleted the fix/copy-button-inline branch September 6, 2026 19:29
@jnahian jnahian added the web The marketing site under web/ (and the docs pages it renders) label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web The marketing site under web/ (and the docs pages it renders)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant