Skip to content

fix(onboarding): color picker — hide for single palette + sync screenshot to filter#480

Merged
ineagu merged 2 commits into
developmentfrom
fix/onboarding-hide-single-color-swatch
Jun 22, 2026
Merged

fix(onboarding): color picker — hide for single palette + sync screenshot to filter#480
ineagu merged 2 commits into
developmentfrom
fix/onboarding-hide-single-color-swatch

Conversation

@ineagu

@ineagu ineagu commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Two related fixes to the onboarding starter-site color picker (StarterSiteCard.js).

1. Hide the picker when a site has a single palette

The swatch summary rendered whenever a site had ≥1 color, showing a lone non-actionable dot. Now gated on colorOptions.length > 1.

2. Sync the card screenshot to the selected color filter

Selecting a color in the global filter already narrowed the grid to matching sites, but each card still showed its default palette screenshot. Now a matching card switches its screenshot to the selected color's palette (screenshots_by_color):

  • subscribe to getSelectedColors via withSelect;
  • derive filterColor = the first selected color the card actually has (case-insensitive; returns the raw colorOptions slug so option.slug === activeColor still matches);
  • seed activeColor from filterColor (fallback to the first palette) in an effect keyed on [colorOptions, filterColor] — so manual swatch clicks survive until the filter changes, and clearing the filter reverts to the default;
  • graceful fallback to the base screenshot when screenshots_by_color lacks the selected color.

No store / Sites.js / Filters.js changes — the store already exposes getSelectedColors.

Tested

Verified in a local wp-env Neve onboarding instance against the live catalog (which now carries color data): selecting green filtered the grid and switched matching cards to their -green screenshots (cb:marketing-agency-gb-green, cb:web-agency-gb-green, …); single-palette sites show no swatch; clearing reverts.

…alette

The per-card color swatch summary rendered whenever a site had at least one
color, showing a lone non-actionable dot when there was nothing to choose.
Only render the picker when there are 2+ palettes (colorOptions.length > 1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrGf4K9upxDKhRPVCztoLs
@ineagu ineagu added enhancement Request to improve or optimize an existing feature or functionality in the project small (1-3h) This label is used for issues that can be completed within 3 hours or less. labels Jun 22, 2026
@pirate-bot

pirate-bot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Plugin build for b3b9663 is ready 🛎️!

@ineagu ineagu requested a review from HardeepAsrani June 22, 2026 15:17
@HardeepAsrani HardeepAsrani changed the base branch from master to development June 22, 2026 15:19
@ineagu ineagu changed the title fix(onboarding): hide color picker when a starter site has a single palette fix(onboarding): color picker — hide for single palette + sync screenshot to filter Jun 22, 2026
When a color is selected in the global filter, each matching starter-site card
now switches its screenshot to that color's palette (screenshots_by_color),
restoring the intended filter behavior (the card previously stayed on its
default palette). All in StarterSiteCard:
- subscribe to getSelectedColors via withSelect;
- derive `filterColor` = the first selected color the card actually has
  (case-insensitive match, returns the raw colorOptions slug);
- seed activeColor from filterColor (falling back to the first palette) in an
  effect keyed on [colorOptions, filterColor], so manual swatch clicks survive
  until the filter changes and a cleared filter reverts to the default.
Falls back to the base screenshot when screenshots_by_color lacks the selected
color. Builds on the single-palette swatch gate (colorOptions.length > 1).

Verified in a local wp-env Neve onboarding instance: selecting "green" switched
the matching cards to their -green screenshots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrGf4K9upxDKhRPVCztoLs
@ineagu ineagu requested a review from HardeepAsrani June 22, 2026 15:31
@ineagu ineagu merged commit 5172f37 into development Jun 22, 2026
5 of 8 checks passed
@ineagu ineagu deleted the fix/onboarding-hide-single-color-swatch branch June 22, 2026 15:33
@pirate-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request to improve or optimize an existing feature or functionality in the project released Indicate that an issue has been resolved and released in a particular version of the product. small (1-3h) This label is used for issues that can be completed within 3 hours or less.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants