Skip to content

feat(components,configurator): per-size .sf-btn padding + min-height knobs; move flatten-all to Advanced - #591

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

feat(components,configurator): per-size .sf-btn padding + min-height knobs; move flatten-all to Advanced#591
jackgranatowski merged 2 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 v0.7.14 button label-size work. That release added per-size font-size knobs, but padding and min-height stayed global-only — an inconsistency: the per-size editor could tune one rung's label but not its box. It also surfaced the flatten-all overrides in the control panel, where they read like ordinary settings but silently collapse the .sf-btn--xs…xl ladder. This completes the per-size model and moves the flatten-all knobs to where advanced knobs belong.

Framework

  • 15 new PUBLIC per-size knobs--sf-btn-{xs,s,m,l,xl}-{padding-block,padding-inline,min-height} — joining the per-size font-size knobs. Each is initial, wired as the first arg of the matching --sf-btn-{prop}--size tier, so an unset knob falls through to that rung's own scale default. Retune one rung's font / padding / height independently, ladder intact.
  • Re-tier the flatten-all overrides (--sf-btn-font-size, --sf-btn-padding-block, --sf-btn-padding-inline, --sf-btn-min-height) to PUBLIC-ADVANCED — same SemVer guarantee, surfaced as advanced (the per-size knobs are the everyday path). Not a breaking change (tier is a documentation/SemVer signal, not a rename).

Verified in Chromium (built dist)

action result
--sf-btn-xs-padding-inline: 5rem xs padding-left → 80px, s/m/l/xl unchanged
--sf-btn-xs-min-height: 7rem xs min-height → 112px
default ladder xs < s < m < l < xl preserved; --sf-btn-font-scale still multiplies proportionally

Configurator

  • ComponentsPanel: the per-size editor now tunes font-size / padding-block / padding-inline / min-height for the selected rung. Selecting a rung drives the live preview (and the preview Size picker drives the editor) — this fixes the "live preview doesn't react to some changes" report, which was the single-preview-size limitation.
  • The flatten-all Advanced disclosure is removed from the panel; those knobs now live only in the All-tokens tab, grouped under the Advanced tier divider (from the re-tier above).

Artifacts & gates

Regenerated registry / docs / annotations / demos / audit artifacts; extended the token-api snapshot (756 tokens), empty-token coverage list, and the per-size browser test (now also asserts padding + min-height per rung).

All green: 10 CSS gates (registry 792 ids, llm-guide 524 refs / 0 undocumented, audit 756 tokens, macros, mirrors, dead-knobs, annotations, bundle-defs, lint, version 0.7.14), 109 node unit tests, 164 vitest + 25 component tests (configurator), svelte-check / tsc 0 errors, vite build OK.

Notes

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added a unified per-size button rung editor with live preview, including font scaling plus per-size controls for padding (block/inline) and minimum height.
  • Changed
    • Moved “apply to all sizes” (flatten-all) button overrides into the Advanced area.
    • Expanded and re-tired button design tokens and updated token documentation and demos to reflect the new per-size configuration.
  • Tests
    • Updated token regression and UI checks for the new button size knobs.

…knobs; move flatten-all to Advanced

Extends the per-size button model (added for label font-size in v0.7.14) to
padding and height, and reworks the configurator button panel around it.

Framework:
- Add 15 PUBLIC per-size knobs — --sf-btn-{xs,s,m,l,xl}-{padding-block,
  padding-inline,min-height} — each `initial`, wired as the first arg of the
  matching --sf-btn-{prop}--size tier so an unset knob falls through to that
  rung's scale default. Retune one rung's font/padding/height independently
  without flattening the --xs…xl ladder.
- Re-tier the flatten-all overrides (--sf-btn-font-size, --sf-btn-padding-block,
  --sf-btn-padding-inline, --sf-btn-min-height) to PUBLIC-ADVANCED — same SemVer
  guarantee, surfaced as advanced (per-size knobs are the everyday path).

Configurator:
- ComponentsPanel: the per-size editor now tunes font-size / padding-block /
  padding-inline / min-height for the selected rung, and selecting a rung drives
  the live preview (fixes "preview doesn't react" to per-rung edits). The
  flatten-all "Advanced" disclosure is removed from the panel — those knobs now
  live only in the All-tokens tab, where the tier dividers group them under
  Advanced.

Regenerate registry / docs / annotations / demos / audit artifacts; extend the
token-api snapshot, empty-token coverage list, per-size browser test (now also
asserts padding + min-height per rung), and CHANGELOG.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1cf32d18-a075-4651-b5a3-82927d88f802

📥 Commits

Reviewing files that changed from the base of the PR and between fa4b054 and 830625f.

📒 Files selected for processing (5)
  • configurator/src/components/panels/ComponentsPanel.svelte
  • configurator/src/data/api-index.generated.json
  • docs/llm-guide.md
  • docs/token-annotations.json
  • tests/tokens.spec.js
✅ Files skipped from review due to trivial changes (1)
  • docs/token-annotations.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • docs/llm-guide.md
  • tests/tokens.spec.js
  • configurator/src/components/panels/ComponentsPanel.svelte
  • configurator/src/data/api-index.generated.json

📝 Walkthrough

Walkthrough

Button sizing now exposes per-rung padding and minimum-height tokens alongside font-size controls. The configurator edits each rung with live preview, flatten-all overrides move to advanced tiering, and generated registries, demos, documentation, audits, and tests are updated.

Changes

Button sizing

Layer / File(s) Summary
Runtime token contract
optional/tokens.components.css, optional/components.css, scripts/token-tiers.js, token-registry.json
Adds per-size padding and minimum-height custom properties, resolves them in .sf-btn, classifies flatten-all tokens as PUBLIC-ADVANCED, and registers the new tokens.
Configurator rung editor
configurator/src/components/panels/ComponentsPanel.svelte
Replaces the previous label-size and advanced controls with synchronized per-rung font-size, padding, and minimum-height editing.
Override generation and demos
demos/generate.mjs, demos/ultimate-override.css, demos/full-api-demo*.html, docs/test-coverage-6-token-reference.html
Generates per-size button overrides and updates demo token lists, counts, versions, and intentionally unoverridden tokens.
API indexes and token documentation
configurator/src/data/*, docs/api-index.*, docs/token-*, docs/registry.json, docs/llm-guide.md, CHANGELOG.md
Updates generated metadata, documentation, token annotations, tier listings, registries, and changelog entries for the expanded button token set.
Audit and regression validation
reports/full-api-audit/results/tokens-report.json, tests/token-api.snapshot.json, tests/tokens.spec.js
Adds the new tokens to audit and snapshots and verifies xs padding-inline and minimum-height retuning.

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

Sequence Diagram(s)

sequenceDiagram
  participant Author as Configurator
  participant Tokens as Button token overrides
  participant CSS as .sf-btn styles
  participant Preview as Live preview
  Author->>Tokens: set rung font-size, padding, and min-height
  Tokens->>CSS: resolve per-rung custom properties
  CSS->>Preview: render updated button geometry
Loading

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 50.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 accurately summarizes the main change: per-size .sf-btn sizing knobs and moving flatten-all controls to Advanced.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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: 2

🤖 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/components/panels/ComponentsPanel.svelte`:
- Around line 340-369: Add aria-pressed to each button in the BTN_SIZE_RUNGS
group and the TEXT_STEPS group, binding it to the same selection checks used for
visual state: activeBtnRung === rung and cur === step respectively. Keep the
existing click handlers and styling unchanged.

In `@configurator/src/data/api-index.generated.json`:
- Around line 1385-1444: The generated button-token entries use an overly narrow
“Padding and radius tokens” description that excludes font-size and min-height.
Update the canonical button-token metadata to use a broader button-geometry
description, then regenerate the API index so all affected entries, including
those identified by names such as --sf-btn-l-min-height and
--sf-btn-l-padding-block, contain the corrected description.
🪄 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: d1bd4d86-cf54-4f25-9039-625d8926a0da

📥 Commits

Reviewing files that changed from the base of the PR and between 11441ea and fa4b054.

⛔ Files ignored due to path filters (1)
  • dist/css-custom-data.json is excluded by !**/dist/**
📒 Files selected for processing (24)
  • CHANGELOG.md
  • configurator/src/components/panels/ComponentsPanel.svelte
  • configurator/src/data/api-index.generated.json
  • configurator/src/data/token-registry.generated.json
  • demos/full-api-demo-with-overrides.html
  • demos/full-api-demo.html
  • demos/generate.mjs
  • demos/ultimate-override.css
  • docs/api-index.json
  • docs/api-index.md
  • docs/llm-guide.md
  • docs/registry.json
  • docs/test-coverage-6-token-reference.html
  • docs/token-annotations.json
  • docs/token-index.json
  • docs/token-index.md
  • docs/tokens.md
  • optional/components.css
  • optional/tokens.components.css
  • reports/full-api-audit/results/tokens-report.json
  • scripts/token-tiers.js
  • tests/token-api.snapshot.json
  • tests/tokens.spec.js
  • token-registry.json

Comment thread configurator/src/components/panels/ComponentsPanel.svelte
Comment thread configurator/src/data/api-index.generated.json
@greptile-apps

greptile-apps Bot commented Jul 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR extends the per-size .sf-btn knob system from font-size-only to cover padding-block, padding-inline, and min-height — 15 new PUBLIC tokens following the same initial-fallthrough pattern. The configurator's button panel is refactored to expose all four properties in a single per-rung editor, with bidirectional sync between the rung tabs and the live-preview size picker, while the flatten-all globals are retired to the All-tokens / Advanced tier.

  • CSS (optional/components.css, optional/tokens.components.css): all five size rungs now wire var(--sf-btn-{rung}-{prop}, <scale-default>) as the first arg of each --sf-btn-{prop}--size tier token; tokens.components.css declares 15 new initial knobs on :root.
  • Configurator (ComponentsPanel.svelte): RUNG_SIZING replaces the old BTN_FONT_SIZES + BUTTON_ADVANCED_TOKENS split, rungRow() generates slider config per rung/prop, and clicking a rung tab now also drives btnSize (and vice-versa) to keep the preview in sync.
  • Tokens tier (scripts/token-tiers.js): the four flatten-all overrides moved to ADVANCED; the token-registry.json, all generated docs, audit reports, and the snapshot are regenerated consistently.

Confidence Score: 4/5

Safe to merge — the CSS fallback chain is structurally correct, all five rungs are wired symmetrically, and the configurator's bidirectional rung-preview sync is a genuine fix. The only gap is cosmetic: the llm-guide lists the 15 new tokens without their initial defaults or per-rung scale fallbacks.

The CSS and token changes are well-structured and match what the configurator expects. The RUNG_SIZING numeric defaults align with the CSS fallback values, and the Playwright test correctly asserts the two new box-metric knobs. The one issue worth fixing is the llm-guide format: the new tokens are listed as space-separated names without values, breaking the established per-token documentation pattern that CLAUDE.md explicitly requires for new PUBLIC entries.

docs/llm-guide.md — the 15 new per-size padding/min-height tokens need one-per-line entries with their initial value and per-rung scale fallbacks, matching the font-size entries above them.

Important Files Changed

Filename Overview
optional/components.css Per-size knobs wired as first-arg fallbacks in all five size rungs (xs/s/m/l/xl) and the default m scope — CSS cascade logic is correct and isolated to each rung.
optional/tokens.components.css 15 new PUBLIC per-size knobs declared as initial on :root, following the same pattern as the existing font-size knobs.
configurator/src/components/panels/ComponentsPanel.svelte Per-size editor expanded to cover font-size / padding / min-height per rung; preview ↔ rung-tab bidirectional sync added; flatten-all Advanced section removed. The fontStep field in RUNG_SIZING mirrors the rung key exactly (minor redundancy), but has no functional impact.
scripts/token-tiers.js Four flatten-all button tokens moved to the ADVANCED set — correctly placed just before the --sf-is-active group, consistent with nearby ADVANCED entries.
docs/llm-guide.md 15 new per-size padding/min-height tokens added but listed in a compressed space-separated format without : initial values, breaking the one-token-per-line-with-default pattern used by the font-size entries immediately above.
tests/tokens.spec.js Box-metric assertions added for padding-inline and min-height on the xs rung; missing symmetric baseline not.toBeCloseTo for min-height, though this is effectively impossible to trigger in practice.
token-registry.json 15 new stable IDs (777–791) assigned for the per-size knobs; nextId bumped to 792; ordering is alphabetical within the new block, consistent with the generator's behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[":root override\n--sf-btn-xs-padding-inline: 5rem"] -->|set| B["var(--sf-btn-xs-padding-inline, …)"]
    C["unset / initial"] -->|falls through| B
    B --> D["--sf-btn-padding-inline--size\n(resolved in .sf-btn--xs)"]
    D --> E["--sf-btn-padding-inline\n(PUBLIC-ADVANCED flatten-all)"]
    E -->|set| F["Flat value — overrides ALL sizes"]
    E -->|initial / unset| G["--sf-btn-padding-inline--size\n(per-size tier wins)"]
    G --> H["Applied padding-inline\n(only xs rung affected)"]
    F --> H
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[":root override\n--sf-btn-xs-padding-inline: 5rem"] -->|set| B["var(--sf-btn-xs-padding-inline, …)"]
    C["unset / initial"] -->|falls through| B
    B --> D["--sf-btn-padding-inline--size\n(resolved in .sf-btn--xs)"]
    D --> E["--sf-btn-padding-inline\n(PUBLIC-ADVANCED flatten-all)"]
    E -->|set| F["Flat value — overrides ALL sizes"]
    E -->|initial / unset| G["--sf-btn-padding-inline--size\n(per-size tier wins)"]
    G --> H["Applied padding-inline\n(only xs rung affected)"]
    F --> H
Loading

Reviews (1): Last reviewed commit: "feat(components,configurator): per-size ..." | Re-trigger Greptile

Comment thread docs/llm-guide.md Outdated
Comment on lines +1118 to +1120
--sf-btn-xs-padding-block --sf-btn-s-padding-block --sf-btn-m-padding-block --sf-btn-l-padding-block --sf-btn-xl-padding-block
--sf-btn-xs-padding-inline --sf-btn-s-padding-inline --sf-btn-m-padding-inline --sf-btn-l-padding-inline --sf-btn-xl-padding-inline
--sf-btn-xs-min-height --sf-btn-s-min-height --sf-btn-m-min-height --sf-btn-l-min-height --sf-btn-xl-min-height

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 The 15 new per-size padding/min-height tokens are listed as space-separated names without : initial values, breaking the one-token-per-line-with-default pattern established by the font-size entries directly above. CLAUDE.md requires the "qualitative layer" update for new PUBLIC tokens beyond what the CI gate enforces — an LLM reading this block currently has no signal that these tokens default to initial (falls through to the rung's scale default), whereas the font-size entries each show their resolved default explicitly.

Suggested change
--sf-btn-xs-padding-block --sf-btn-s-padding-block --sf-btn-m-padding-block --sf-btn-l-padding-block --sf-btn-xl-padding-block
--sf-btn-xs-padding-inline --sf-btn-s-padding-inline --sf-btn-m-padding-inline --sf-btn-l-padding-inline --sf-btn-xl-padding-inline
--sf-btn-xs-min-height --sf-btn-s-min-height --sf-btn-m-min-height --sf-btn-l-min-height --sf-btn-xl-min-height
--sf-btn-xs-padding-block: initial /* unset → 0.125rem (rung default) */
--sf-btn-s-padding-block: initial /* unset → var(--sf-space-2xs) */
--sf-btn-m-padding-block: initial /* unset → var(--sf-space-xs) */
--sf-btn-l-padding-block: initial /* unset → var(--sf-space-s) */
--sf-btn-xl-padding-block: initial /* unset → var(--sf-space-m) */
--sf-btn-xs-padding-inline: initial /* unset → var(--sf-space-xs) */
--sf-btn-s-padding-inline: initial /* unset → var(--sf-space-s) */
--sf-btn-m-padding-inline: initial /* unset → var(--sf-space-m) */
--sf-btn-l-padding-inline: initial /* unset → var(--sf-space-l) */
--sf-btn-xl-padding-inline: initial /* unset → var(--sf-space-xl) */
--sf-btn-xs-min-height: initial /* unset → var(--sf-size-xs) */
--sf-btn-s-min-height: initial /* unset → var(--sf-size-s) */
--sf-btn-m-min-height: initial /* unset → var(--sf-size-m) */
--sf-btn-l-min-height: initial /* unset → var(--sf-size-l) */
--sf-btn-xl-min-height: initial /* unset → var(--sf-size-xl) */

Context Used: CLAUDE.md (source)

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 thread tests/tokens.spec.js
Comment on lines +337 to +340
// Per-size padding + min-height knobs retune the xs rung (5rem = 80px, 7rem = 112px).
expect(boxBefore.pi).not.toBeCloseTo(80, 0);
expect(boxAfter.pi).toBeCloseTo(80, 0);
expect(boxAfter.mh).toBeCloseTo(112, 0);

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 The padding-inline baseline check has a symmetric not.toBeCloseTo assertion, but the min-height baseline is only asserted after the knob is set. Adding the baseline check for mh mirrors the pattern used for pi and would catch a future regression where the xs default accidentally landed at 112 px.

Suggested change
// Per-size padding + min-height knobs retune the xs rung (5rem = 80px, 7rem = 112px).
expect(boxBefore.pi).not.toBeCloseTo(80, 0);
expect(boxAfter.pi).toBeCloseTo(80, 0);
expect(boxAfter.mh).toBeCloseTo(112, 0);
// Per-size padding + min-height knobs retune the xs rung (5rem = 80px, 7rem = 112px).
expect(boxBefore.pi).not.toBeCloseTo(80, 0);
expect(boxAfter.pi).toBeCloseTo(80, 0);
expect(boxBefore.mh).not.toBeCloseTo(112, 0);
expect(boxAfter.mh).toBeCloseTo(112, 0);

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!

…utton group desc, symmetric test baseline

Address CodeRabbit + Greptile review on PR #591:
- ComponentsPanel: add aria-pressed to the per-size rung tabs and label-size
  step buttons so the selected option is exposed to assistive tech.
- llm-guide: list the 15 per-size padding/min-height knobs one-per-line with
  their `initial` default + per-rung scale fallback, matching the font-size
  entries (CLAUDE.md qualitative-layer requirement).
- token-annotations: broaden the BUTTON TOKENS group description beyond
  "padding and radius" to cover the per-size font-size/min-height knobs;
  regenerated api-index/docs.
- tests: add the symmetric min-height baseline assertion (not.toBeCloseTo 112)
  mirroring the padding-inline check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnwqYHgHNAWPbsUJWUeY1w
@jackgranatowski
jackgranatowski merged commit 23962f5 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