Skip to content

feat(configurator): Merge vs Replace import chooser with report preview (follow-up) - #704

Merged
jackgranatowski merged 4 commits into
mainfrom
ux/configurator-import-modal
Aug 21, 2026
Merged

feat(configurator): Merge vs Replace import chooser with report preview (follow-up)#704
jackgranatowski merged 4 commits into
mainfrom
ux/configurator-import-modal

Conversation

@jackgranatowski

Copy link
Copy Markdown
Contributor

Follow-up #8 — explicit Merge/Replace import chooser

Stacked on #691 → … → #703. Merge those first; this branch includes their commits.

Import applied silently and always merged. Now selecting a file opens a chooser that previews the parsed report before anything changes.

Change

  • Shows the filename and counts: tokens to import, migrated (renamed), dropped (removed by the framework), unknown in this build, skipped (invalid).
  • Explains the two actions and lets the user pick: Merge (keep current overrides, add on top) or Replace (discard the current set first). Cancel / Escape aborts.
  • A malformed or empty file skips the dialog and just reports (nothing to apply).

Built on the existing parseImport / summarizeImport — no parser changes.

Verification

  • npm run check 0 errors · npm run lint clean
  • npm run test: 286/286 · shell e2e green
  • Screenshot + e2e verified the dialog, and that Merge keeps existing overrides (2 total) while Replace discards them (1 total).

This completes the follow-up series

All eight deferred content follow-ups from the UX redesign are now shipped as stacked PRs #698#704: Depth panel, Accessibility panel, Components preview fence, contextual tool preview, scale-detach notices, System panel, mobile drawer, and this import chooser.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 31 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 03811f2b-b76d-441a-bb06-810621c7f77a

📥 Commits

Reviewing files that changed from the base of the PR and between ec219d0 and 5b8378b.

📒 Files selected for processing (3)
  • configurator/src/App.svelte
  • configurator/src/components/CommandPalette.svelte
  • configurator/src/components/shell/StudioHeader.svelte

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.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

This stacked configurator update introduces the Merge/Replace import preview and substantially reorganizes token navigation, editing, history, domain classification, and change review.

  • Adds a validated CSS/JSON import pipeline with migration reporting and an explicit Merge/Replace chooser.
  • Introduces grouped navigation, mobile panel selection, command-palette deep links, and contextual preview behavior.
  • Adds token relationship/state modeling, a Changes panel, unified value editing, and expanded accessibility/depth controls.
  • Consolidates runtime and curation classification around the new namespace-based domain map.

Confidence Score: 3/5

The PR should not merge until the new value editor reliably cancels Escape edits and refreshes its mode after external override changes.

The unified editor currently commits the edited DOM value when Escape triggers blur, and its persistent manual mode can misrepresent values restored or changed elsewhere.

Files Needing Attention: configurator/src/components/inputs/ValueField.svelte

Important Files Changed

Filename Overview
configurator/src/App.svelte Integrates import preview/application, undo coalescing, mobile navigation, deep linking, and contextual preview layout.
configurator/src/components/inputs/ValueField.svelte Adds the unified mode-based value editor, but Escape commits cancelled edits and manual mode becomes stale after external value changes.
configurator/src/lib/importOverrides.ts Adds the shared CSS/JSON sanitization, migration, and reporting pipeline used by the chooser.
configurator/src/lib/tokenModel.ts Introduces token roles, dependency relationships, scale-shadow detection, validation, and change summaries.
configurator/src/lib/domains.ts Replaces overlapping substring classification with deterministic namespace and exception mapping.
configurator/src/data/domain-map.json Defines the shared authoritative namespace-to-panel classification consumed at runtime and during curation checks.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  F[Select CSS or JSON file] --> P[Parse and sanitize]
  P --> M[Migrate renamed and removed tokens]
  M --> R[Preview import report]
  R -->|Merge| G[Overlay imported overrides]
  R -->|Replace| X[Discard current set and apply import]
  R -->|Cancel or Escape| C[Leave overrides unchanged]
Loading

Reviews (1): Last reviewed commit: "feat(configurator): Merge vs Replace cho..." | Re-trigger Greptile

Comment on lines +98 to +101
onkeydown={(e) => {
if (e.key === "Enter") (e.currentTarget as HTMLInputElement).blur();
if (e.key === "Escape") { editing = false; draft = overrideValue ?? token.value ?? ""; (e.currentTarget as HTMLInputElement).blur(); }
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Escape commits cancelled edits

When a user edits a value and presses Escape, the handler synchronously blurs the input while its DOM value still contains the draft, so onblur commits the value the user attempted to discard.

Suggested change
onkeydown={(e) => {
if (e.key === "Enter") (e.currentTarget as HTMLInputElement).blur();
if (e.key === "Escape") { editing = false; draft = overrideValue ?? token.value ?? ""; (e.currentTarget as HTMLInputElement).blur(); }
}}
onkeydown={(e) => {
if (e.key === "Enter") (e.currentTarget as HTMLInputElement).blur();
if (e.key === "Escape") {
editing = false;
draft = overrideValue ?? token.value ?? "";
(e.currentTarget as HTMLInputElement).value = draft;
(e.currentTarget as HTMLInputElement).blur();
}
}}

Comment on lines +19 to +20
let manualMode = $state<ValueMode | null>(null);
let mode = $derived<ValueMode>(manualMode ?? detectMode(overrideValue));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Manual mode remains stale

When an override changes through undo, reset, or another control after the user selects Value or Expression, manualMode continues to override detection, causing the editor to display a mode that no longer matches the current value.

Suggested change
let manualMode = $state<ValueMode | null>(null);
let mode = $derived<ValueMode>(manualMode ?? detectMode(overrideValue));
let manualMode = $state<ValueMode | null>(null);
let mode = $derived<ValueMode>(manualMode ?? detectMode(overrideValue));
$effect(() => {
overrideValue;
manualMode = null;
});

@jackgranatowski
jackgranatowski force-pushed the ux/configurator-import-modal branch 7 times, most recently from ae985db to 0062648 Compare August 21, 2026 04:12
Import applied silently and always merged. Now selecting a file opens a chooser
that previews the parsed report before anything changes:

- Shows the filename and counts: tokens to import, migrated (renamed), dropped
  (removed by the framework), unknown in this build, skipped (invalid).
- Explains the two actions and lets the user pick: Merge (keep current overrides
  and add on top) or Replace (discard the current set first); Cancel/Escape aborts.
- A malformed or empty file skips the dialog and just reports (nothing to apply).

Builds on the existing parseImport/summarizeImport (no parser changes). check,
lint, 286 unit tests and shell e2e pass; screenshot + e2e verified the dialog and
that Merge keeps existing overrides while Replace discards them.
@jackgranatowski
jackgranatowski force-pushed the ux/configurator-import-modal branch from 575ee27 to 5b8378b Compare August 21, 2026 04:40
@jackgranatowski
jackgranatowski merged commit 663cc50 into main Aug 21, 2026
13 checks passed
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