Skip to content

Fix Svelte 5 reactivity and improve mobile UI - #309

Merged
jackgranatowski merged 2 commits into
mainfrom
claude/adoring-mendel-s6yld4
Jun 11, 2026
Merged

Fix Svelte 5 reactivity and improve mobile UI#309
jackgranatowski merged 2 commits into
mainfrom
claude/adoring-mendel-s6yld4

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR addresses Svelte 5 state proxy reactivity issues and refines the mobile experience with improved spacing, typography, and responsive behavior.

Key Changes

Reactivity Fixes

  • Replace in operator with property access: Changed all t.name in overrides checks to overrides[t.name] != null throughout the codebase (DomainPanel, QuickKnobs, ScaleGenerator, TokenRow, TokenGroup). This ensures Svelte 5's state proxy get trap is triggered on every key check, maintaining proper reactivity.
  • Added explanatory comments documenting why property access is necessary for Svelte 5 compatibility.

QuickKnobs Enhancements

  • Added encode/decode function support for knobs to handle complex CSS expressions (e.g., calc() with dark-mode logic).
  • Shadow strength knob now uses encode to wrap values in calc(${v} + var(--sf-is-dark) * 0.17) and decode to extract the base number from the expression.
  • Updated dragCommit to apply encoding when storing override values.

UI/Layout Improvements

  • DomainPanel header: Reduced padding (18px → 14px vertical, adjusted horizontal), changed alignment from flex-start to center, reduced icon size (36px → 32px), decreased font sizes (18px → 16px for title, 13px → 12px for blurb).
  • Mobile responsiveness: Enhanced media query for screens ≤600px with better padding, hidden blurb text, full-width action strip, and collapsed usage filter buttons.
  • QuickKnobs grid: Adjusted column widths and reduced gap (14px → 12px) for better spacing.
  • TokenRow mobile: Added media query to hide secondary metadata badges and reduce description font size on phones.

Scale Generator

  • Updated default ratios to match framework baseline: type and display now use ratioMin: 1.25 (was 1.2), space uses baseMax: 2.0 (was 1.5) and ratioMin: 1.25 (was 1.5).
  • Improved comments to clarify that defaults mirror core/tokens.css @Property initial-values.

Typography Scale

  • Adjusted TEXT_STEPS indices: 2xs (idx -4 → -3), xs (idx -3 → -2), s (idx -2 → -1) to align with framework updates.

Domain Configuration

  • Reorganized typography essentials: removed --sf-font-display and --sf-tracking-normal, kept core font and sizing tokens.
  • Updated spacing essentials: replaced --sf-space-content with --sf-space-s and --sf-space-l for better granularity.
  • Renamed generator type from advancedGenerators to basicGenerators for typography.
  • Reordered state/effects essentials to prioritize --sf-blur-m and --sf-opacity-disabled.

Build/Release

  • Updated release workflow to include configurator/src/data/api-index.generated.json in git commits.
  • Bumped framework version reference to 0.5.33.

Implementation Details

The reactivity fix is critical for Svelte 5 compatibility—the state proxy's get trap must be invoked to track dependencies, which only happens with property access syntax, not the in operator. The encode/decode pattern for knobs enables round-trip preservation of complex CSS expressions while allowing slider interaction on the underlying numeric value.

https://claude.ai/code/session_0194pdid9nK6cmJXon9JgNAh

Summary by CodeRabbit

Release Notes

  • Improvements
    • Enhanced responsive design with refined sidebar widths and mobile layout optimizations.
    • Adjusted typography scale step ranges for improved visual hierarchy.
    • Updated default scale generation settings for ratio and spacing to align with framework baseline.
    • Improved panel layout with tighter spacing and refined component styling.

Issue #1 — shadow-strength knob preserves dark-mode adaptation
The --sf-shadow-strength knob previously wrote a plain number override,
silently replacing the calc(0.08 + var(--sf-is-dark) * 0.17) default and
losing the automatic dark-mode boost. Added encode/decode hooks to the
knob definition so the slider writes calc(<val> + var(--sf-is-dark) * 0.17)
and reads back the base scalar. The same encode/decode pattern is available
for any future knob that wraps a simple scalar in a CSS expression.

Issue #4 — "Modified only" and "Internal" filters now reliably reactive
All `t.name in overrides` checks replaced with `overrides[t.name] != null`
across DomainPanel, QuickKnobs, ScaleGenerator, TokenGroup, and TokenRow.
The `in` operator triggers the Svelte 5 proxy `has` trap; property access
triggers the `get` trap, which is what Svelte 5 tracks for fine-grained
reactivity. Fixes both filter checkboxes becoming effective again.

Issue #5 — Scale generator TEXT_STEPS indices corrected
The scale.js TEXT_STEPS had 2xs=-4, xs=-3, s=-2, m=0 (skipped -1).
The framework CSS maps 2xs→pow(-3), xs→pow(-2), s→pow(-1), m→pow(0).
Corrected to 2xs=-3, xs=-2, s=-1. Also updated ScaleGenerator DEFAULTS
to match the framework's @Property initial-values (ratioMin 1.2→1.25,
space baseMax 1.5→2.0, space ratios 1.5→1.25/1.333), so the generator
opens showing the current framework baseline. With correct defaults,
2xs and xs now produce proper clamp() expressions instead of bare rem.

Issue #2 — Typography generators promoted to basic mode
Moved type+display scale generators from advancedGenerators to
basicGenerators so they appear in Basic mode alongside font essentials.
Tightened essential lists (removed --sf-font-display and --sf-tracking-normal
from typography; replaced --sf-opacity-50 with --sf-opacity-disabled in
effects; added --sf-space-s and --sf-space-l alongside --sf-space-m in
spacing).

Issue #3 — Mobile + desktop visual improvements
DomainPanel header is more compact (14px padding, smaller icon, 16px title).
On <600px screens the blurb hides, the actions strip goes full-width, and
body padding tightens further. TokenRow hides less-important .row__opt and
.row__alias badges on phones. App grid column shrinks to 44px at 600px
and 40px at 400px. QuickKnobs column widths balanced for better desktop
readability.

Issue #6 — Version always 1 behind after release
The sync-main CI job ran version-sync.js (which stamps configurator/src/data/
api-index.generated.json) but only committed package.json, package-lock.json,
docs/roadmap.md and CHANGELOG.md. Added api-index.generated.json to that
git add so the version pill in the configurator header matches the release tag.
Also ran version-sync locally to fix the current 0.5.32→0.5.33 mismatch.

https://claude.ai/code/session_0194pdid9nK6cmJXon9JgNAh
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 27 minutes and 16 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6030b7ee-ee26-4f61-8dd5-dae534bf525a

📥 Commits

Reviewing files that changed from the base of the PR and between 1a3e949 and bdd4e24.

📒 Files selected for processing (6)
  • configurator/src/data/api-index.generated.json
  • configurator/src/lib/domains.js
  • core/tokens.css
  • docs/api-index.json
  • docs/api-index.md
  • docs/token-annotations.json
📝 Walkthrough

Walkthrough

This PR updates the configurator for framework 0.5.33 by refactoring override detection semantics, adding knob encode/decode support, adjusting domain configuration and scale defaults, applying responsive UI refinements, and updating build infrastructure and version metadata.

Changes

Framework 0.5.33 Configurator Alignment

Layer / File(s) Summary
Override detection semantics refactor
configurator/src/components/DomainPanel.svelte, QuickKnobs.svelte, ScaleGenerator.svelte, TokenGroup.svelte, TokenRow.svelte
All components switched from checking name in overrides to overrides[name] != null to determine active overrides, affecting advanced token filters, modification state, and reset logic across the UI.
Knob encode/decode infrastructure
configurator/src/components/QuickKnobs.svelte, configurator/src/lib/domains.js
liveValue() and dragCommit() in QuickKnobs now support optional decode/encode functions for value transformation; shadow-strength knob adds encode/decode to safely wrap numeric slider values in framework-aware calc() expressions for dark-mode offset.
Domain essentials and scale defaults
configurator/src/lib/domains.js, configurator/src/components/ScaleGenerator.svelte, configurator/src/lib/scale.js
Typography, spacing, and effects domain essentials lists updated; ScaleGenerator defaults adjusted for ratio and space ramp starting values; TEXT_STEPS negative indices shifted by +1 to align typographic step numbering.
Responsive UI layout adjustments
configurator/src/App.svelte, configurator/src/components/DomainPanel.svelte, QuickKnobs.svelte, TokenRow.svelte
Sidebar rail widths reduced at 600px/400px breakpoints; panel header/controls tightened with adjusted padding/gaps; knob grid columns resized; mobile views hide badges, compress spacing, and adjust typography.
Build workflow and version bump
.github/workflows/release.yml, configurator/src/data/api-index.generated.json
Release workflow updated to include api-index.generated.json in sync-main commit; framework version metadata bumped from 0.5.32 to 0.5.33.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#302: Both PRs refine the configurator's override detection and filter logic; #302 introduced tabbed domains UI while this PR updates how components determine token modification state.
  • codeslash-dev/SLASHED#34: This PR's shadow-strength encode/decode for dark-mode offset aligns with #34's themes layer work that defines --sf-is-dark and adjusts shadow/glow calculations.
🚥 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 'Fix Svelte 5 reactivity and improve mobile UI' accurately captures the two main themes of the changeset: Svelte 5 reactivity fixes and mobile UI improvements, which are reflected across all modified files.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/adoring-mendel-s6yld4

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 and usage tips.

…banners

Domains / essentials cleanup (from D-analysis review):
- Motion: remove --sf-motion-scale from essentials (duplicate of knob)
- Effects: remove --sf-state-pending-opacity from both knobs and essentials;
  essentials now [blur-m, opacity-disabled]
- Spacing: replace space-s/m/l essentials with semantic aliases
  [space-content, space-gutter, section-pad, component-pad]
- Typography: remove text-base-min/max from essentials (covered by the
  fluid scale generator); keep [font-body, font-heading, font-mono, leading-normal]

Token description fixes (source CSS + annotations):
- core/tokens.css: separate --sf-opacity-disabled and --sf-state-pending-opacity
  into their own "Opacity" section banner (were wrongly grouped under Shadow)
- core/tokens.css: add focused comment before focus-ring tokens so they get
  a specific description instead of inheriting the header-height note
- core/tokens.css: convert state-flag @Property block to a recognised sub-header
  banner ("INTERACTION STATE FLAGS") so --sf-is-active/current/pressed/open
  stop inheriting the "STATUS COLORS" group description
- core/tokens.css: convert @supports gate comment for shadow ramp to a proper
  banner ("Shadow ramp") so --sf-shadow-s/m/l/xl stop showing "CSS multi-column
  layout tokens" as their description
- core/tokens.css: improve Typography Aliases section banner with a description
- docs/token-annotations.json: fix "Core tokens | Shadow" annotation (was
  "Opacity tokens for disabled and pending states" — completely wrong);
  add new group annotations for Shadow ramp, Opacity, INTERACTION STATE FLAGS;
  broaden "Core tokens | Layout & a11y" to mention text-contrast knobs

https://claude.ai/code/session_0194pdid9nK6cmJXon9JgNAh
@jackgranatowski

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

2 participants