Skip to content

feat: the copy button belongs to the field, and looks like it - #15

Merged
DoodleBears merged 1 commit into
mainfrom
feat/copy-button-in-stage
Sep 30, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
feat/copy-button-in-stage

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

The button was in the sidebar, where it read as one more control among forty — which
is what it was, as a piece of markup. The argument is not that: you tuned the field,
so the button that takes the tuning away belongs to the field.

Change outline

Moved into the sticky stage, at the bottom, spanning both columns, full width, in the
accent colour.
It also stops being a control and becomes the page's primary action:

sidebar, ghost button bottom of the stage, full-width primary
one of forty controls the page's only primary — see below

Everything else on this page exists to help you arrive at a setting. This is the one
that lets you leave with it. So it is the only primary: forty controls where one is
primary would mean nothing, and two primaries means neither is. That is a hierarchy
claim, not a styling preference.

The note line drops below the button and goes muted — it explains the button, it does not
compete with it.

the field, with the primary copy button spanning its base

Special things to note

  • Reversibility: site-only. Two CSS rules and a DOM move. Review focus is the
    hierarchy claim above — whether it should be the page's only primary is the thing to
    argue with; the styling follows from that answer.
  • The stage is a grid — auto minmax(0, 1fr) (controls | field). Without
    grid-column: 1 / -1 the button would have taken the controls column and squeezed the
    field, which is easy to miss because the field is overflow: hidden.
  • var(--accent), not a hex — dark scheme and any future theme follow. Measured on
    the built page: button 622px inside a 648px stage, the difference being the stage's
    12px padding.
  • The focus ring is offset 3px because the button is the accent; an accent outline
    on an accent fill is invisible. Easy to get wrong precisely because it only fails on
    the element you just made primary.
  • A test asserts the placement (in the stage, not in the sidebar), since placement is
    the requirement here and a visual regression is harder to catch than a DOM assertion.
  • 177 tests (was 176), oxlint 0, registry ok, both changelog ledgers.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • Moved the copy button beneath the matrix in the sticky stage, where it appears as a full-width, accent-colored primary action.
    • Updated the copy area’s layout and snippet styling, including hover and visible-focus states.

It was in the sidebar, where it read as one more control among forty — which is what it
was, as a piece of markup. But the argument is not that. You tuned THE FIELD, so the
button that takes the tuning away belongs to the field, and putting it at the bottom of
the sticky stage says that without a word: the thing you adjusted now carries the thing
that takes your adjustment away.

It also stops being a control and becomes the page's primary action. Everything else on
this page exists to help you ARRIVE at a setting — forty controls, one of them primary
would mean nothing. This is the one that lets you LEAVE with it, so it is the only
primary, full width, spanning both of the stage's columns. That is a hierarchy claim, not
a styling preference: if there are two primaries, neither is.

var(--accent) rather than a hex, so the dark scheme and any future theme follow — the
token table is the whole reason to have tokens. The focus ring is offset because the
button IS the accent, and an accent outline drawn on an accent fill is invisible; that
one is easy to get wrong precisely because it only fails on the element you just made
primary.

The grid needed one line of care: .playground-stage is `auto minmax(0, 1fr)`, so the
button would have taken the controls column and squeezed the field. `grid-column: 1 / -1`.

A test asserts the placement — in the stage, not in the sidebar — because placement is
the requirement here and a visual regression is harder to catch than a DOM assertion.
177 tests (was 176), oxlint 0, both changelog ledgers.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b15871b7-eeba-48be-b5f3-099237e875bd

📥 Commits

Reviewing files that changed from the base of the PR and between 67fe113 and 58a0a7b.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • CHANGELOG.zh.md
  • apps/site/src/components/Playground.tsx
  • apps/site/src/components/ShowcaseCopy.tsx
  • apps/site/src/styles/site.css
  • apps/site/test/playground.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The copy control moves from below the settings readout to beneath the matrix in the playground stage. Its layout and styling change, and a test checks its placement.

Changes

Showcase copy

Layer / File(s) Summary
Move copy control into the stage
apps/site/src/components/Playground.tsx, apps/site/src/components/ShowcaseCopy.tsx, apps/site/test/playground.test.tsx
ShowcaseCopy renders beneath the matrix in the stage. Its note follows the copy button. A test checks that it is inside .playground-stage and absent from .playground-side.
Restyle the copy control
apps/site/src/styles/site.css, CHANGELOG.md, CHANGELOG.zh.md
The copy area becomes full-width with stacked content. The button uses accent styling, hover feedback, and an offset focus outline. The snippet receives a border, rounded corners, and a page-background fill. The changelogs describe the updated placement and styling.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 58a0a

The copy control retains its behavior in the new stage location, with placement covered by a test and both changelogs updated. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: moving the copy button into the field area and styling it as part of that interface.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@DoodleBears
DoodleBears merged commit 7d973e0 into main Sep 30, 2026
2 checks passed
@DoodleBears
DoodleBears deleted the feat/copy-button-in-stage branch September 30, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant