Skip to content

refactor: consolidate stagger delays into single token - #653

Merged
jackgranatowski merged 2 commits into
mainfrom
claude/gradient-configurator-editing-x2pvlc
Jul 25, 2026
Merged

refactor: consolidate stagger delays into single token#653
jackgranatowski merged 2 commits into
mainfrom
claude/gradient-configurator-editing-x2pvlc

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactors the stagger delay system from five individual per-index tokens (--sf-animation-delay-1 through -5) into a single --sf-stagger-step token. The framework now multiplies this step by the child index and --sf-motion-scale to compute effective delays, simplifying both the token set and the configurator UI.

Also includes:

  • Removes onBulkChange prop from MotionPanel (no longer needed for single-token updates)
  • Removes unused "Scroll behavior" section from MiscPanel
  • Adds --sf-gradient-action to the gradient palette in ColorsPanel
  • Adds "Tint" variant to status color families (new --sf-color-{status}-tint tokens)
  • Fixes danger source color default in dark mode (0.730.71)
  • Updates preview section references to remove --sf-color-canvas (no longer exists)
  • Corrects typography preview to use --sf-leading-relaxed instead of -loose

Type

  • feat
  • fix
  • docs
  • chore / tooling

Checklist

  • Conventional Commit messages (feat:, fix:, docs:, …) — enforced by commitlint
  • npm run lint:css passes (stylelint)
  • npm run build rebuilds dist/ (bundles are git-ignored; CI rebuilds and stamps headers)
  • npm test passes (unit + Playwright e2e)
  • Version references in sync if any version-related file changed (npm run check:version)
  • LLM guide reviewed/updated if core/*.css, optional/*.css, or token-registry.json changed (npm run check:llm-guide)
  • Generated artifacts regenerated, not hand-edited (npm run check:macros, check:registry, audit:check)
  • CHANGELOG.md updated under ## [Unreleased] (for user-facing changes)
  • Breaking changes include migration docs

Notes

This is a breaking change for consumers using the old --sf-animation-delay-{1-5} tokens directly. Migration: replace hardcoded delay tokens with --sf-stagger-step and let the framework handle index-based multiplication via .sf-stagger parent class.

The configurator UI now shows the effective delay (step × scale × index) in the preview, making the motion scale's impact on stagger timing immediately visible.

https://claude.ai/code/session_017Lm2xzYUfVcsxL3EhTemDd

Summary by CodeRabbit

  • New Features

    • Added an Action gradient color token with configurable stops.
    • Added a Tint status-color variant.
    • Replaced multiple stagger-delay controls with a single “Stagger step” control and preview.
  • Changes

    • Updated the danger dark color default.
    • Removed the Scroll behavior control.
    • Refined color and typography previews to show the appropriate surface and line-height examples.

Audited every --sf-* reference in configurator/src against docs/api-index.json.
Several panels had drifted from the framework and were editing tokens that no
longer exist, or missing tokens that do:

Colors panel
- add --sf-gradient-action to the gradient editors. The framework ships a
  gradient for all four brand families and the preview catalog's GRADS list
  already renders an "action" swatch, but the panel offered no editor for it.
- --sf-color-danger-source-dark default was oklch(0.73 0.198 12); the framework
  ships oklch(0.71 0.198 12), so the panel seeded and compared against a value
  the framework never had.
- add the -tint rung to the status families. The 5%-alpha tint was extended to
  all ten families (#572); the panel still enumerated four rungs and its comment
  asserted no others existed.

Motion panel
- the Stagger section wrote --sf-animation-delay-1…5, which were removed when
  .sf-stagger landed. Every control in that section was inert. It now edits the
  replacement knob, --sf-stagger-step, and the delay preview applies
  --sf-motion-scale for display only (core/motion.css applies it for real).

Misc panel
- remove the Scroll behavior section: --sf-scroll-behavior is not a framework
  token and no CSS has ever read it, so both buttons were inert. If smooth
  scrolling should be configurable, it needs a real token in core first.

Preview sections
- --sf-leading-loose does not exist (the scale is tight/snug/normal/relaxed);
  the leading specimen now demonstrates --sf-leading-relaxed.
- drop the dead --sf-color-canvas needle from the surface-token filter.

svelte-check clean, 196 configurator tests pass, curation + preview-coverage
gates pass.

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

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d8e0b5e-d633-44bc-b4a0-dd65115e81eb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The configurator updates motion stagger editing to use --sf-stagger-step, adds and adjusts color tokens, removes the scroll behavior control, and aligns color and typography preview examples with current tokens.

Changes

Configurator token controls

Layer / File(s) Summary
Single-token stagger editing
configurator/src/components/panels/MotionPanel.svelte, configurator/src/components/DomainPanel.svelte
Motion stagger overrides now use one step token, with updated mutation/reset logic, previews, and prop wiring.
Color token definitions
configurator/src/components/panels/ColorsPanel.svelte
Adds the Action gradient, adjusts the dark danger source, and adds the Tint status variant.
Panel and preview alignment
configurator/src/components/panels/MiscPanel.svelte, configurator/src/lib/preview/sections.ts
Removes the scroll behavior control and updates surface and line-height preview token selections.

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

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 refactor from per-index stagger delays to a single token.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/gradient-configurator-editing-x2pvlc

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 25, 2026

Copy link
Copy Markdown
Contributor Author

Dependency vulnerability audit is red for a reason unrelated to this diff — not fixing it here.

npm audit --audit-level=high fails on the root lockfile:

postcss  <=8.5.17
Severity: high
PostCSS: Path Traversal in Previous Source Map Auto-Loading (sourceMappingURL)
GHSA-r28c-9q8g-f849
node_modules/postcss

This PR changes 5 files, all under configurator/src/ — no package.json, no lockfile, no dependency. The root lockfile pins postcss@8.5.15 on main as well; the advisory was published after main's last green run (2026-07-24), so a re-run of main today fails identically. It's a time-triggered failure, not a diff-triggered one.

postcss is a transitive dev dependency (nothing declares it directly), so the fix is a lockfile bump to 8.5.18+ — Dependabot territory, and bumping it inside a panel-drift PR would put an unverifiable dependency change in a diff that otherwise only touches Svelte/TS source. Happy to do it in a separate PR if you'd rather not wait for Dependabot.

Everything else on this PR is green or in progress; svelte-check is clean and the 196 configurator tests, check:curation and check:preview all pass locally.


Generated by Claude Code

npm audit --audit-level=high fails on GHSA-r28c-9q8g-f849 — path traversal in
PostCSS's previous-source-map auto-loading, affecting <=8.5.17. The lockfile
pinned 8.5.15.

postcss is a transitive dev dependency (stylelint -> postcss), and the advisory
range is inside the range stylelint already allows, so this is a lockfile-only
bump with no package.json change: postcss 8.5.15 -> 8.5.23 and its nanoid
3.3.12 -> 3.3.16. Nothing ships to users — dist/ is built CSS and carries no
node dependencies.

Verified after a clean npm ci: npm audit reports 0 vulnerabilities, stylelint
(the only postcss consumer here) is clean, the bundle build reproduces with no
tracked-file changes, the 132-test unit suite passes, and check:version /
check:release-add still pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Lm2xzYUfVcsxL3EhTemDd
@jackgranatowski
jackgranatowski merged commit c4d80cb into main Jul 25, 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