Commit b3b9663
fix(onboarding): sync card screenshot to the selected color filter
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_01QrGf4K9upxDKhRPVCztoLs1 parent 92c0468 commit b3b9663
1 file changed
Lines changed: 35 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
96 | 123 | | |
97 | 124 | | |
98 | 125 | | |
| |||
102 | 129 | | |
103 | 130 | | |
104 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
105 | 135 | | |
106 | | - | |
107 | | - | |
| 136 | + | |
| 137 | + | |
108 | 138 | | |
109 | 139 | | |
110 | 140 | | |
| |||
290 | 320 | | |
291 | 321 | | |
292 | 322 | | |
| 323 | + | |
293 | 324 | | |
294 | 325 | | |
295 | 326 | | |
296 | 327 | | |
297 | 328 | | |
298 | 329 | | |
| 330 | + | |
299 | 331 | | |
300 | 332 | | |
301 | 333 | | |
| |||
0 commit comments