feat(configurator): show both light and dark palette previews in color controls - #430
Conversation
…r controls Add resolveColorForTheme() to previewResolver using theme-scoped probe elements ([data-theme] wrappers), enabling color resolution independent of the preview's active theme. ColorsPanel now renders two swatch rows per brand color — L (light) and D (dark) — so both palettes are always visible regardless of which theme the preview is showing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016K8W2WSJxe9Fc6jmMe3qxD
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds theme-specific color resolution in the preview resolver and updates the brand palette in ChangesTheme-aware color preview
Sequence Diagram(s)sequenceDiagram
participant ColorsPanel.svelte
participant previewResolver.svelte.ts
participant preview document
ColorsPanel.svelte->>previewResolver.svelte.ts: resolveColorForTheme(expr, theme)
previewResolver.svelte.ts->>preview document: getThemedProbe(theme)
previewResolver.svelte.ts->>preview document: set probe.color = expr
previewResolver.svelte.ts->>preview document: getComputedStyle(probe).color
previewResolver.svelte.ts-->>ColorsPanel.svelte: themed color string
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoShow light + dark palette swatches in configurator color controls Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
6 rules 1.
|
Add a resolveCache Map cleared in bumpPreviewVersion() so repeated resolveColor / resolveColorForTheme calls for the same expression within one render cycle hit the cache instead of forcing style recalculation. Eliminates 110 redundant getComputedStyle() calls per update caused by the dual light/dark swatch rows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016K8W2WSJxe9Fc6jmMe3qxD
https://claude.ai/code/session_016K8W2WSJxe9Fc6jmMe3qxD
Summary by CodeRabbit