Skip to content

feat: the playground opens on a showcase state, not the engine's defaults - #13

Merged
DoodleBears merged 1 commit into
mainfrom
feat/showcase-defaults
Sep 30, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
feat/showcase-defaults

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

A page whose subject is a component should open on the component as someone would
actually ship it
— and shipped components are tuned, not defaulted.

Change outline

control value why
size / cols / rows 260px · 5×5 · no gap the largest box and the fewest dots that still read as a grid
dot/cell 198% past the touching point, so the dots overlap and read as one surface rather than as separate pixels
grow 3% grow is how far a dot changes size over the cycle; at 50% a dot is a pulsing blob, not a moving light
stagger 70%, pinned so choosing another motion does not silently move a slider under the visitor
silhouette / dot square · square, radius 0 rounded corners are one control away, and a rounded dot at 198% overlap hides the grid the size is there to show

The values live in a named SHOWCASE beside the component, each with the reasoning
attached. The engine's DEFAULTS are untouched — that is the library's choice and
the page is allowed to disagree — so this changes what the page shows, not what every
consumer gets.

Special things to note

  • Reversibility: one constant. Site-only, no engine or package change. Review focus is
    the reasoning in SHOWCASE, not the numbers — the numbers are the easy part to change
    and the reasoning is the part that should be argued with.
  • Five tests had encoded the old opening state, and are rewritten to derive from it
    rather than assert it. One of them was quietly wrong in a way worth naming:
    • the tighter-axis test hardcoded a 3×7 grid, which is tight on y at 55% dot/cell —
      and at the opening 198% a 3×5 is tight on y too. So "gap x only redistributes air"
      would have passed for the wrong reason. It now derives a 6×3 grid and asserts the
      two axes' roles, which are the opposite of what they were.
    • the silhouette tests hardcoded 7×7's 49 cells and DEFAULTS.silhouette; both now read
      the grid and the drawn value off the steppers.
    • the stagger label test resets first, since the dial now opens pinned.
  • The readout you pasted was internally inconsistent, and I did not try to match it:
    dot/pitch 198% with pitch 48.5 implies dot ≈ 96, not the 66.2 in the same block.
    At 260px / 5×5 / 198% the engine computes pitch 43.5 · dot 86.1, which is what ships.
    The control values were unambiguous and coherent, so those are what are set.
  • 159 tests (was 155), oxlint 0 — including three unused variables left behind by earlier
    edits — oxfmt clean, registry ok.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Changes
    • The Playground now opens with a 5×5 square showcase, featuring square dots, no gaps, 198% dot sizing, and 70% stagger. Explicit initial settings can still override these values.
    • Updated the changelog to document the showcase configuration and clarify that it does not change engine defaults.
  • Tests
    • Updated coverage for the opening configuration, shape rendering, dot sizing, and preset behavior.

…ults

A page whose subject is a component should open on the component as someone would
actually ship it, and shipped components are tuned. 5×5 with no gap at the largest
box, so the grid is legible; dot/cell at 198%, past the touching point, so the dots
OVERLAP and read as one surface instead of as separate pixels; grow at 3%, because
grow is how far a dot changes size over the cycle and at 50% a dot is a pulsing blob
rather than a moving light; stagger PINNED at 70% rather than following the preset,
so choosing another motion does not move a slider under the visitor. Square
silhouette, square dots, radius 0 — the rounded corners are one control away and a
rounded dot at 198% overlap hides the grid the size is there to show.

The engine's defaults are untouched. That is the library's choice and the page is
allowed to disagree with it, so these live in a named `SHOWCASE` beside the
component with the reasoning for each, rather than by editing `DEFAULTS` and
changing what every consumer gets.

Five tests had encoded the old opening state and were rewritten to derive from it
instead of asserting it, which is the more useful shape anyway:

- the silhouette tests read the cell count off the steppers rather than hardcoding
  7×7's 49, and assert the opening value is what is DRAWN rather than `DEFAULTS`
- the tighter-axis test derives its grid instead of hardcoding 3×7. At 55% dot/cell
  3×7 is tight on y, and at the opening 198% a 3×5 is tight on y too — so the old
  hardcoded arrangement would have made "gap x only redistributes air" pass for the
  wrong reason. 6×3 puts the tight axis back on x, and the two assertions swapped
  accordingly: gap x resizes the dot, gap y does not.
- the stagger label test resets first, because the dial now opens pinned

One new test asserts the whole opening state value by value, including that the
readout agrees with the controls — "it looks right" is not a claim a test can make,
and each number is a decision.
@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: 9a101d15-b5b8-4da1-9250-59f0f24a9dcb

📥 Commits

Reviewing files that changed from the base of the PR and between 898924f and f6e9ea8.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • CHANGELOG.zh.md
  • apps/site/src/components/Playground.tsx
  • 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; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Playground now opens with a named SHOWCASE configuration. The configuration sets its grid, dot, motion, envelope, and glyph values before applying any initial overrides. Tests and changelog entries reflect the opening settings.

Changes

Playground Showcase

Layer / File(s) Summary
Showcase configuration
apps/site/src/components/Playground.tsx, CHANGELOG.md, CHANGELOG.zh.md
The Playground initializes options from SHOWCASE before applying initial. The changelogs document the page-specific settings and note that engine defaults remain unchanged.
Showcase and geometry tests
apps/site/test/playground.test.tsx
Tests assert the opening controls and square silhouette, derive cell counts from the current grid, check gap-axis geometry, and reset stagger before checking preset behavior.

Priority: ⬇️ Low

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

Change: Feature

Merge Risk: ⚪ Minimal · up to f6e9e

The Playground opens with the documented showcase settings while engine defaults remain unchanged. No PR-introduced issue remains that should block merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (2 skipped: 2 … 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 and concisely describes the primary change: the Playground now opens with a showcase state instead of the engine defaults.
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 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (2 skipped: 2 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 19df41d into main Sep 30, 2026
2 checks passed
@DoodleBears
DoodleBears deleted the feat/showcase-defaults branch September 30, 2026 16:45
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