Skip to content

Configurator UI improvements: foldable generators, fullscreen preview, a11y fixes, theme import/export - #337

Merged
jackgranatowski merged 2 commits into
mainfrom
claude/configurator-ui-improvements-moetex
Jun 17, 2026
Merged

Configurator UI improvements: foldable generators, fullscreen preview, a11y fixes, theme import/export#337
jackgranatowski merged 2 commits into
mainfrom
claude/configurator-ui-improvements-moetex

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
  • ScaleGenerator: wrap content in a collapsible toggle (starts closed) so
    multiple scale generators don't eat vertical space; shows ramp kind label
    in the collapsed header

  • Preview: add a fullscreen button (⤢/⤡) using the Fullscreen API so the
    live preview isn't constrained to the split-pane max-width

  • WcagPanel: fix danger chip text being invisible by adding a #fff CSS
    fallback when the on-color token doesn't resolve; change FG/BG pair
    checker from a row to a column layout to remove wasted space above the
    dropdowns

  • ThemeGallery: add Export button to every preset and saved theme (downloads
    a JSON file); add Import theme button in the header (file picker for JSON);
    wire up a new saveImportedTheme() store function so imported themes land in
    the saved-themes list without clobbering current overrides

https://claude.ai/code/session_014a3HFjjrHwA3Q3FoU6YvvK

Summary by CodeRabbit

  • New Features

    • Fullscreen preview mode for enhanced viewing
    • Theme import and export functionality with JSON support
    • Collapsible scale generator panel
  • Improvements

    • Enhanced text color fallback handling
    • Refined control layouts for better usability

@coderabbitai

coderabbitai Bot commented Jun 16, 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 36 minutes and 31 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ 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: e71b061c-e059-40b6-a35a-5056689e54d4

📥 Commits

Reviewing files that changed from the base of the PR and between 2530c60 and d661cb0.

📒 Files selected for processing (7)
  • configurator/src/components/Preview.svelte
  • configurator/src/components/ScaleGenerator.svelte
  • configurator/src/components/ThemeGallery.svelte
  • configurator/src/components/WcagPanel.svelte
  • configurator/src/lib/store.svelte.js
  • configurator/tests-e2e/generator.spec.js
  • configurator/tests-e2e/undo-redo.spec.js
📝 Walkthrough

Walkthrough

Adds fullscreen mode to the Preview panel, converts ScaleGenerator into a collapsible panel, and introduces theme import/export to ThemeGallery backed by a new saveImportedTheme store action. Also applies minor CSS layout and CSS-variable fallback fixes to WcagPanel.

Changes

Configurator UI Improvements

Layer / File(s) Summary
saveImportedTheme store action
configurator/src/lib/store.svelte.js
New exported saveImportedTheme(data) slugifies the theme name, upserts a user-theme record into the reactive savedThemes array, persists, and returns { id, persisted }.
ThemeGallery import/export logic and UI
configurator/src/components/ThemeGallery.svelte
Adds exportTheme (downloads JSON blob) and import handler (FileReader + overrides validation + saveImportedTheme), a hidden file input, an "Import theme…" header button, success/error feedback, per-preset and per-saved-theme Export buttons, and CSS for the updated header, action rows, and .themes__msg--ok.
Preview fullscreen mode
configurator/src/components/Preview.svelte
Adds previewEl binding, isFullscreen state synced via fullscreenchange listener, toggleFullscreen() function, a header toggle button with ARIA pressed state, and CSS for .preview__fullscreen and hiding the close button in fullscreen.
ScaleGenerator collapsible panel
configurator/src/components/ScaleGenerator.svelte
Adds isOpen state, a header toggle button with ramp kind label and "Applied ✓" indicator, {#if isOpen} guard on the body, and supporting CSS for the new toggle/caret/body structure.
WcagPanel CSS fixes
configurator/src/components/WcagPanel.svelte
Changes usage chip text color to var({u.fg}, #fff) with a #fff fallback, switches checker controls flex direction to column, and moves the swap button alignment to flex-start.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#302: Modifies ScaleGenerator.svelte to introduce the multi-ramp kinds generator UI that this PR now wraps in a collapsible isOpen panel with "Applied ✓" indicators.
  • codeslash-dev/SLASHED#315: Overlaps with this PR at the Preview.svelte component level, adjusting preview pane sizing and CSS where this PR adds fullscreen mode.
🚥 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 accurately summarizes all four main changes: foldable generators, fullscreen preview, accessibility fixes, and theme import/export functionality.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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/configurator-ui-improvements-moetex

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.

@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: 4

🤖 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/Preview.svelte`:
- Around line 20-30: The fullscreen state tracking and toggle function need two
fixes. First, in the fullscreen change event handler, modify the condition to
specifically check if previewEl is the fullscreen element rather than checking
if any document element is fullscreen, so the state accurately reflects only
this component's element. Second, in the toggleFullscreen function, the calls to
requestFullscreen() and exitFullscreen() return Promises that can reject due to
permission denied or document inactive states, so add error handling (via
.catch() or await with try-catch) to both calls to prevent unhandled promise
rejections and keep the button state in sync.

In `@configurator/src/components/ScaleGenerator.svelte`:
- Around line 172-177: The button element with class "gen__toggle" is missing an
explicit type attribute, which can cause accidental form submission if rendered
inside a form context. Add type="button" to the button element to explicitly
specify that it is a toggle button and not a form submit button.

In `@configurator/src/components/ThemeGallery.svelte`:
- Around line 90-105: The FileReader object in the theme import logic is missing
error handling. Add an onerror handler to the FileReader instance (after setting
the onload handler but before calling readAsText) that sets the importError
variable with an appropriate error message when file read operations fail due to
permissions, corruption, or other I/O issues. This ensures users receive
feedback if the file cannot be read successfully.
- Around line 92-97: The validation for the imported theme data in the
JSON.parse block checks whether data.overrides exists but does not validate that
it is specifically an object type. Add an additional type check to ensure
data.overrides is an object (and not a string, array, or other truthy value)
before proceeding with the import. Update the condition to include typeof
data.overrides !== 'object' or a similar guard that rejects non-object values,
so that malformed files with overrides containing strings or arrays are properly
rejected with the import error.
🪄 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: 130c98d7-487f-4fcb-a262-6caf277a8166

📥 Commits

Reviewing files that changed from the base of the PR and between b3daef4 and 2530c60.

📒 Files selected for processing (5)
  • configurator/src/components/Preview.svelte
  • configurator/src/components/ScaleGenerator.svelte
  • configurator/src/components/ThemeGallery.svelte
  • configurator/src/components/WcagPanel.svelte
  • configurator/src/lib/store.svelte.js

Comment thread configurator/src/components/Preview.svelte Outdated
Comment thread configurator/src/components/ScaleGenerator.svelte Outdated
Comment thread configurator/src/components/ThemeGallery.svelte
Comment thread configurator/src/components/ThemeGallery.svelte
…heme import/export

Scale generators:
- Wrap in a collapsible toggle (starts closed); shows ramp kind in header
- Add type="button" to prevent accidental form submission

Live preview:
- Fullscreen button using the Fullscreen API (scoped to previewEl, async with
  try/catch so denials don't leave the button in a broken state)

Accessibility panel:
- Fix danger chip text invisible when --sf-color-text--on-danger doesn't
  resolve: add var(token, #fff) fallback
- Stack FG/BG dropdowns vertically to remove wasted space above them

Theme gallery:
- Export any preset or saved theme as a JSON file (includes frameworkVersion)
- Import theme from JSON file; saved to user slots without touching overrides
- Surface version mismatch on import when frameworkVersion differs
- Show skipped token count in Apply feedback (e.g. "Applied 6 · 2 skipped ✓")
- Extend feedback timeout to 4s when tokens are skipped
- FileReader onerror handler for I/O failures
- Strict overrides validation (rejects strings, arrays, null)

Store:
- Add saveImportedTheme() to persist an externally-provided theme object
  without clobbering the active overrides

https://claude.ai/code/session_014a3HFjjrHwA3Q3FoU6YvvK
@jackgranatowski
jackgranatowski force-pushed the claude/configurator-ui-improvements-moetex branch from f53d045 to ad43125 Compare June 16, 2026 20:25
…trols

ScaleGenerator now starts collapsed (isOpen = false), so e2e tests that
directly access .ctl / .scales__actions elements need to click .gen__toggle
first. Add the toggle click to every affected test in generator.spec.js and
undo-redo.spec.js.

https://claude.ai/code/session_014a3HFjjrHwA3Q3FoU6YvvK
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