Skip to content

Redesign SF colors panel: Quick Use + Palette layout, two distinct modes - #198

Merged
jackgranatowski merged 2 commits into
mainfrom
claude/sf-colors-panel-behavior-0iqEz
Jun 2, 2026
Merged

Redesign SF colors panel: Quick Use + Palette layout, two distinct modes#198
jackgranatowski merged 2 commits into
mainfrom
claude/sf-colors-panel-behavior-0iqEz

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Badge (bottom-right): reference-only. Click copies var() to clipboard.
No Apply-to chips, no element targeting.

Left-panel SF icon: picker mode, panel docks flush against the Bricks
settings panel right edge (getBricksPanelRight detects position).

Panel layout when not searching:

  • QUICK USE — ~30 curated tokens in a 2-col grid grouped by design role
    (Typography, Surfaces, Structure, Brand, Feedback). Covers the vast
    majority of colour picks on business/portfolio/ecommerce/landing builds.
  • PALETTE — Brand (6) + Status (5) families as a compact scanner table.
    Each row: base swatch + name + tagline + 5 key alias previews.
    Click to expand → base banner + aliases grid + scale strip (50–950) +
    alpha (collapsed). One family open at a time.

Scale rendered as a thin horizontal strip whose cells expand on hover
rather than a full grid; alpha hidden behind a toggle. The 50–950 scale
is never the first thing you see.

Searching shows filtered results from the full 275-token model (unchanged).

https://claude.ai/code/session_01HesqASnoEx3Amm4H7f17jj

Summary by CodeRabbit

  • New Features

    • Enhanced color picker with a "Quick Use" section for frequently accessed colors
    • Added expandable color palette organized by families (Brand, Status, etc.)
    • Introduced reference mode for quick color variable copying to clipboard
    • Improved color picker panel positioning and docking within the Bricks editor interface
  • Refactor

    • Restructured color picker workflow to support reference and picker modes

Badge (bottom-right): reference-only. Click copies var() to clipboard.
No Apply-to chips, no element targeting.

Left-panel SF icon: picker mode, panel docks flush against the Bricks
settings panel right edge (getBricksPanelRight detects position).

Panel layout when not searching:
- QUICK USE — ~30 curated tokens in a 2-col grid grouped by design role
  (Typography, Surfaces, Structure, Brand, Feedback). Covers the vast
  majority of colour picks on business/portfolio/ecommerce/landing builds.
- PALETTE — Brand (6) + Status (5) families as a compact scanner table.
  Each row: base swatch + name + tagline + 5 key alias previews.
  Click to expand → base banner + aliases grid + scale strip (50–950) +
  alpha (collapsed). One family open at a time.

Scale rendered as a thin horizontal strip whose cells expand on hover
rather than a full grid; alpha hidden behind a toggle. The 50–950 scale
is never the first thing you see.

Searching shows filtered results from the full 275-token model (unchanged).

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

coderabbitai Bot commented Jun 2, 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 38 minutes and 33 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: c5c7760f-1fdd-4030-be3c-fdd4fce94a78

📥 Commits

Reviewing files that changed from the base of the PR and between 685e9e1 and 96237df.

📒 Files selected for processing (5)
  • plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.css
  • plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css
📝 Walkthrough

Walkthrough

The color picker panel component is refactored to support two distinct interaction modes—reference mode for copying CSS variables to clipboard and picker mode for selecting colors—while replacing the previous element-targeting UI with a curated Quick Use section and an expandable Palette. DOM-based docking positions the panel against the Bricks editor's right panel edge. The component's props contract, data model, interaction logic, template rendering, and styling are updated in concert to realize this redesign.

Changes

Color Panel Refactor

Layer / File(s) Summary
Component props contract and integration
src/components/ColorApp.svelte, src/components/ColorPanel.svelte, src/components/ColorSwatch.svelte
ColorApp passes referenceMode={true} to ColorPanel; ColorPanel props contract changes from initialTarget to referenceMode and dockedLeft; ColorSwatch makes onPick callback optional with optional-chaining invocation and simplifies button aria-label.
Quick Use data model
src/lib/color-model.js
QUICK_USE_GROUPS constant defines five curated token groups (Typography, Surfaces, Structure, Brand, Feedback); buildQuickUseModel() function constructs grouped swatch objects from light/dark hex maps with alpha flag derivation and empty-group filtering.
Core interaction and mode handling
src/components/ColorPanel.svelte
setMode() helper toggles between reference and picker modes with canvas theme sync; pick() behavior branches on mode to either call onPickValue() + onPick? (picker) or copy-to-clipboard (reference); toggleFamily() and toggleAlpha() manage accordion expansion state.
ColorPanel template and rendering
src/components/ColorPanel.svelte
Header adds explicit close button; search placeholder and empty-state text updated; Quick Use grid renders when query is empty; Palette renders expandable family rows with base swatches, alias previews, scale/alpha strips; footer legend reflects mode-specific interaction text.
Panel docking and positioning
src/main.js
getBricksPanelRight() measures Bricks panel right edge using cascading selectors and closest() fallback, returning rounded x-coordinate or null; openColorPickerPanel() computes dockedLeft and passes it into mounted ColorPanel props for right-edge alignment.
CSS styling for new UI components
src/styles/panel.css
Docked positioning variant (.slashed-cp--docked); data-mode-driven swatch backgrounds; section wrapper/header styling; Quick Use 2-column grid with clickable cells; Palette category headers; scanner table rows with hover states; expandable family banners and subsections; scale/alpha strip layouts with dashed alpha borders.
Compiled stylesheet expansion
assets/editor-app/app.css
Minified stylesheet updated to include all new docked, mode-driven, scanner, palette, family, and alpha component styles.

Sequence Diagram

sequenceDiagram
    participant User
    participant ColorApp
    participant ColorPanel
    participant colorModel
    participant Canvas
    
    User->>ColorApp: open color picker
    ColorApp->>ColorPanel: render with referenceMode=true
    ColorPanel->>colorModel: buildQuickUseModel()
    colorModel-->>ColorPanel: { groups: [...] }
    ColorPanel->>Canvas: setMode() → update data-theme
    
    alt query is empty
        ColorPanel->>User: render Quick Use grid
        User->>ColorPanel: click quick use swatch
        ColorPanel->>ColorPanel: pick(swatch) → copy var() to clipboard
        ColorPanel->>User: show toast, close
    else query is non-empty
        ColorPanel->>ColorPanel: filter by query
        ColorPanel->>User: render filtered results
    end
    
    alt Palette view (family expand)
        User->>ColorPanel: expand family accordion
        ColorPanel->>User: show scale/alpha strips
        User->>ColorPanel: click swatch
        ColorPanel->>ColorPanel: pick() → onPickValue(var) + onPick()
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • codeslash-dev/SLASHED#193: Main PR extends the Bricks color system panel introduced in #193, refactoring ColorPanel/ColorApp props and swatch picking behavior, adding docking via main.js, and extending color-model.js with buildQuickUseModel.
  • codeslash-dev/SLASHED#151: Main PR's editor-app CSS changes in assets/editor-app/app.css and src/styles/panel.css overlap with rebemer badge and indentation styling updates from #151.
🚥 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 captures the two main redesign aspects: the new Quick Use + Palette layout and the shift to two distinct modes (reference mode and picker mode).
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/sf-colors-panel-behavior-0iqEz

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: 6

🤖 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
`@plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte`:
- Around line 67-75: The search mode switch uses the raw query state so
whitespace-only input bypasses filterModel's trimming; fix by trimming query
before it is used for mode decisions and filtering—update where the query state
is read (the query reactive/state variable and any derived uses like filtered =
$derived(filterModel(...)) and any template checks that inspect query) to use
query.trim() (or assign query = query.trim() on input) so whitespace-only input
is treated as empty; ensure the same change is applied to the other occurrences
referenced (the blocks that build filtered/quickModel and template checks around
query).
- Around line 152-160: The accordion currently preserves per-family alpha
expansion; update toggleFamily so when opening a new family (inside the branch
where you set expandedFamily = id) you reset the alphaOpen Set instead of
selectively deleting the id. In function toggleFamily, after setting
expandedFamily = id assign alphaOpen to an empty Set (or call clear() on the new
Set) so any previously remembered alpha expansions are collapsed when switching
families; keep the collapse logic when closing the same family unchanged.
- Around line 139-142: The picker currently closes unconditionally in the
pickerMode branch; change the contract so onPickValue(value) returns a success
boolean or throws on failure, then call and await onPickValue(value) inside the
pickerMode branch and only invoke onPick() (and return) when onPickValue
resolved truthy (or did not throw); if it returns false or throws, do not call
onPick() nor close the picker so the UI can remain open for retry. Ensure you
update any callsites/tests of onPickValue to follow the new success/throw
semantics and reference the pickerMode branch, the onPickValue function, and the
onPick callback when making these changes.

In `@plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js`:
- Around line 299-320: The selectors array and subsequent loops (in main.js
around the anchorEl.closest and document.querySelector logic) prioritize broad
builder roots (`#brx-builder`, .brx-builder) ahead of panel-specific elements,
causing the picker to dock to the builder instead of the settings panel; fix
this by reordering the selectors array so panel-specific selectors
('`#bricks-panel-inner`' and '[id^="bricks-panel"]' and '`#bricks-panel`') appear
before '`#brx-builder`' and '.brx-builder' (or remove the builder fallbacks
entirely), leaving the rest of the anchorEl.closest(...) and
document.querySelector(...) checks unchanged so the panel-specific matches win.

In `@plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css`:
- Around line 739-927: Interactive elements (.slashed-cp__qu-cell,
.slashed-cp__scan-row, .slashed-cp__fam-banner, .slashed-cp__strip-sw,
.slashed-cp__alpha-btn) are keyboard-reachable but lack :focus-visible styles;
add focus-visible rules matching the existing .slashed-cp-swatch:focus-visible
pattern to make focus visible to keyboard users. Update the CSS by adding
:focus-visible declarations for each of the named selectors (use a 2px solid
var(--rebemer-accent) outline with appropriate outline-offsets—similar offsets
suggested in the review—and add z-index:1 for .slashed-cp__strip-sw to keep its
outline above neighbors) placed after the existing .slashed-cp-swatch rule so
they follow the established pattern.
- Around line 903-912: The dashed border for alpha strip swatches doesn't show
because .slashed-cp__strip-sw sets border: 0; either remove/override that base
border rule or add an explicit border width/color for the alpha variant: update
.slashed-cp__strip-sw (remove border: 0 or change to border: 1px solid
transparent) or update .slashed-cp__strip-sw--alpha to set a full border (e.g.,
border: 1px dashed <color>) so the dashed style renders; reference
.slashed-cp__strip-sw and .slashed-cp__strip-sw--alpha when making the change.
🪄 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: ca364974-8b7e-42d2-9a0d-38c5490cc914

📥 Commits

Reviewing files that changed from the base of the PR and between d97cb24 and 685e9e1.

📒 Files selected for processing (8)
  • plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.css
  • plugins/SLASHED-for-WP/integrations/bricks/assets/editor-app/app.js
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorApp.svelte
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorPanel.svelte
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/components/ColorSwatch.svelte
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/lib/color-model.js
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js
  • plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css

Comment thread plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/main.js
Comment thread plugins/SLASHED-for-WP/integrations/bricks/editor-app/src/styles/panel.css Outdated
- Fix #1: use normalizedQuery (trimmed) in template search branch so
  whitespace-only input doesn't switch to the full 275-token view
- Fix #2: return applyToColorInput() result from onPickValue callback;
  show error toast and keep picker open if application fails
- Fix #3: simplify toggleFamily() to always reset alphaOpen to a new
  Set(), preventing stale open-alpha state when switching families
- Fix #4: reorder getBricksPanelRight() selectors — panel-specific IDs
  first, drop broad builder-root selectors (#brx-builder, .brx-builder)
- Fix #5: add :focus-visible rules for all new interactive elements
  (.slashed-cp__qu-cell, .slashed-cp__scan-row, .slashed-cp__fam-banner,
  .slashed-cp__strip-sw, .slashed-cp__alpha-btn)
- Fix #6: change .slashed-cp__strip-sw border from 0 to 1px solid
  transparent so --alpha dashed override actually renders

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