Skip to content

feat(configurator): rebuild the Components live-preview tab from scratch - #593

Merged
jackgranatowski merged 3 commits into
mainfrom
claude/button-size-visibility-issue-40xlwy
Jul 11, 2026
Merged

feat(configurator): rebuild the Components live-preview tab from scratch#593
jackgranatowski merged 3 commits into
mainfrom
claude/button-size-visibility-issue-40xlwy

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Why

Follow-up to the per-size .sf-btn work (#590, #591). The big right-hand live preview for the Components category had two problems:

  • The size-scale row rendered as near-identical buttons — the per-rung xs→xl ladder (the whole point of that section, and of the per-size knobs we just shipped) was visually invisible.
  • Its note still described the retired flatten-all globals as the primary way to size buttons, contradicting the per-size model now surfaced in the panel.

Rather than patch it, the tab was rewritten from scratch.

What

Rebuilt configurator/src/lib/preview/sections.tscomponents(), built entirely from real .sf-btn / .sf-card classes (nothing re-implemented):

  • Size scale — baseline-aligned so the xs·s·default·l·xl min-height / padding / label-size ladder reads as a clear staircase, with an accurate note pointing at the per-size knobs + Label-size multiplier (not the flatten-all globals).
  • Styles — shown on a brand family and a neutral (fill · soft · outline · gradient).
  • Full width (new) — sf-btn--block / sf-btn--block-cq.
  • Card — full slot API (new) — a rich card exercising sf-card__media, __avatar, __title, __body, __footer, with token-driven gradient media/avatar (no external asset — re-tints live with the Colors panel), beside the three shipped card modifiers.
  • Families and states retained, polished.

Verification

  • Rendered the tab and inspected it in both light and dark themes (Chromium) — size ladder now reads as a staircase; media card and all specimens theme-aware.
  • tsc clean, svelte-check 0 errors.
  • preview-coverage gate (every public class/token still appears across the tabs) + full configurator unit (164) and component (25) suites pass.

Notes

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Enhanced the Components preview with richer button size and style examples.
    • Added gradient button variations for applicable style families.
    • Added a media card example demonstrating expanded card layouts and content areas.
    • Replaced the basic card grid with a Card modifiers showcase featuring varied card treatments.

The right-hand live preview for the Components category was rewritten. The
old size-scale row read as near-identical buttons (the per-rung ladder was
invisible) and its note still described the removed flatten-all globals as the
primary sizing surface.

New Components tab (src/lib/preview/sections.ts):
- Size scale is baseline-aligned so the xs→xl min-height/padding/label ladder
  reads as a clear staircase, with an accurate note pointing at the per-size
  knobs + Label-size multiplier (not the retired flatten-all globals).
- Styles shown on a brand family and a neutral (fill/soft/outline/gradient).
- New Full-width section (sf-btn--block / sf-btn--block-cq).
- New rich card exercising the full slot API — sf-card__media, __avatar,
  __title, __body, __footer — with token-driven gradient media/avatar (no
  external asset, re-tints live), beside the three shipped card modifiers.

Verified in both light and dark themes; tsc, svelte-check, preview-coverage
and the configurator unit/component suites all pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnwqYHgHNAWPbsUJWUeY1w
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jackgranatowski, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c5c837af-e218-46ef-96f2-e50115830dda

📥 Commits

Reviewing files that changed from the base of the PR and between ad56c70 and 1fb8725.

📒 Files selected for processing (1)
  • configurator/src/lib/preview/sections.ts
📝 Walkthrough

Walkthrough

The Components preview updates button size and style specimens, adds full-slot and modifier card examples, and revises the rendered section descriptions.

Changes

Components preview

Layer / File(s) Summary
Button sizes and style families
configurator/src/lib/preview/sections.ts
Adds the BTN_SIZES mapping, changes the default size label, adjusts alignment, and generates family-specific button styles with conditional gradients.
Card slot and modifier specimens
configurator/src/lib/preview/sections.ts
Adds a media card using the full slot API and replaces the prior card grid with token-based card modifier examples.
Components page section wiring
configurator/src/lib/preview/sections.ts
Updates the Components page description and section names for the revised button and card specimens.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: codex

🚥 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%. 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 describes the main change: rebuilding the configurator Components live-preview tab.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/button-size-visibility-issue-40xlwy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot added the codex label Jul 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@configurator/src/lib/preview/sections.ts`:
- Around line 356-360: Add an sf-btn--block-cq button specimen alongside the
existing sf-btn--block examples in the widths section, using the same preview
structure and appropriate label so the rendered examples match the section note
and objectives. Keep the existing block specimens and note unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 05cbc5df-c199-4db7-ac93-bc98ab8d6959

📥 Commits

Reviewing files that changed from the base of the PR and between ebacd9a and ad56c70.

📒 Files selected for processing (1)
  • configurator/src/lib/preview/sections.ts

Comment thread configurator/src/lib/preview/sections.ts Outdated
@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown

Greptile Summary

The components() function in the live-preview gallery has been fully rewritten to address two weaknesses in the previous implementation: the size-scale row now uses align-items:flex-end so the xs→xl button ladder renders as a visible staircase, and section notes now accurately point to per-size knobs rather than the retired flatten-all globals.

  • Size / styles / widths: Size alignment fixed; styles section expanded to two rows (primary + neutral); a new "Full width" section demonstrates sf-btn--block.
  • Rich media card: A new mediaCard specimen exercises the full sf-card slot API (__media, __avatar, __title, __body, __footer) using a CSS-variable gradient so it re-tints live with the Colors panel — no external assets required.
  • Card modifiers: The existing three-card grid is retained, with tighter copy and a reduced grid min (16 → 15 rem).

Confidence Score: 4/5

Single display-only file rewrite with no token, CSS, or version changes — safe to merge.

The rewrite is clean and well-structured; the only concerns are cosmetic demo gaps in the preview page. The second block button omits a family class and may render with unexpected default colors. The sf-btn--block-cq class is documented in a note but has no visual specimen. Neither issue touches the framework CSS or any shipped token.

configurator/src/lib/preview/sections.ts — the Full width section could use a second look at the outline block button's missing family modifier and the undocumented sf-btn--block-cq specimen.

Important Files Changed

Filename Overview
configurator/src/lib/preview/sections.ts Complete rewrite of components() — size-scale alignment fixed (flex-end staircase), styles section now shows two rows (primary + neutral), new full-width and rich-media-card sections added; sf-btn--block-cq documented in note but not shown in demo, and second block button omits a family modifier.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[components] --> B[families: BTN_FAMILIES fill buttons]
    A --> C[styles: styleRow primary + styleRow neutral]
    A --> D[sizes: staircase xs s M l xl]
    A --> E[widths: sf-btn--block buttons]
    A --> F[states: default disabled loading]
    A --> G[mediaCard: media avatar title body footer]
    A --> H[cardModifiers: base bordered elevated+interactive]
    B --> Z[page Components]
    C --> Z
    D --> Z
    E --> Z
    F --> Z
    G --> Z
    H --> Z
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[components] --> B[families: BTN_FAMILIES fill buttons]
    A --> C[styles: styleRow primary + styleRow neutral]
    A --> D[sizes: staircase xs s M l xl]
    A --> E[widths: sf-btn--block buttons]
    A --> F[states: default disabled loading]
    A --> G[mediaCard: media avatar title body footer]
    A --> H[cardModifiers: base bordered elevated+interactive]
    B --> Z[page Components]
    C --> Z
    D --> Z
    E --> Z
    F --> Z
    G --> Z
    H --> Z
Loading

Reviews (1): Last reviewed commit: "feat(configurator): rebuild Components p..." | Re-trigger Greptile

section("Button families", families, `${BTN_FAMILIES.length} shipped colour families`),
section("Styles", styles, "fill · soft · outline · gradient"),
section("Size scale (xs · s · default · l · xl)", sizes, "Each rung has its own font-size, padding and min-height knob (Components panel ▸ Per-size); the Label-size multiplier scales the whole ladder proportionally."),
section("Full width", widths, "sf-btn--block stretches to the container; sf-btn--block-cq does so only in a narrow query container."),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 sf-btn--block-cq mentioned but never shown

The section note promises that sf-btn--block-cq "does so only in a narrow query container," yet neither button in widths carries that class. A developer inspecting the preview to understand how sf-btn--block-cq differs from sf-btn--block gets no visual example — just a prose claim they cannot verify in-page.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +357 to +360
const widths = well(stack("s",
`<button class="sf-btn sf-btn--primary sf-btn--block">Block — full width</button>`,
`<button class="sf-btn sf-btn--outline sf-btn--block">Block — outline</button>`,
));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Second block button is missing a family modifier

sf-btn--outline is a style modifier; without a companion family class (e.g. sf-btn--neutral) it will render with whatever the stylesheet's unresolved default is. The first block button correctly pairs sf-btn--primary with sf-btn--block, so this looks like an accidental omission rather than an intentional bare-outline demo.

Suggested change
const widths = well(stack("s",
`<button class="sf-btn sf-btn--primary sf-btn--block">Block — full width</button>`,
`<button class="sf-btn sf-btn--outline sf-btn--block">Block — outline</button>`,
));
const widths = well(stack("s",
`<button class="sf-btn sf-btn--primary sf-btn--block">Block — full width</button>`,
`<button class="sf-btn sf-btn--neutral sf-btn--outline sf-btn--block">Block — outline</button>`,
));

claude added 2 commits July 11, 2026 09:51
…block button a family

Address CodeRabbit + Greptile review on PR #593 (Components preview tab):
- Full-width section now shows sf-btn--block-cq in both contexts it's built
  for: auto width in the wide well, and stretched to 100% inside a 16rem query
  container (dashed) — the note promised it but no specimen existed. The stack
  uses align-items:flex-start so only --block (explicit 100%) and the querried
  block-cq actually stretch, keeping the contrast honest.
- The outline block button now carries a family class (sf-btn--neutral) instead
  of a bare sf-btn--outline that fell back to the default family.

Verified visually in light + dark; tsc, svelte-check, preview-coverage and the
configurator unit/component suites pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnwqYHgHNAWPbsUJWUeY1w
…ript

_s.mjs was a local Playwright screenshot helper that slipped into c2ac24e when
a cleanup rm targeted the wrong path. It is not part of the codebase.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01GnwqYHgHNAWPbsUJWUeY1w
@jackgranatowski
jackgranatowski merged commit 127ec4f into main Jul 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants