enhancement(paints): reactive hue filter counts on the paint explorer - #148
Open
NathanHealea wants to merge 6 commits into
Open
enhancement(paints): reactive hue filter counts on the paint explorer#148NathanHealea wants to merge 6 commits into
NathanHealea wants to merge 6 commits into
Conversation
Resolve the child hue UUID and pass parentHueId/childHueId into the single getPaintFacetCounts call so SSR-prefetched hue pill counts respect the active query and filters. Drop the per-hue getPaintCountByHueGroup loop and the legacy static huePaintCounts prop.
Check off all acceptance criteria and cross-link the reactive hue-count coverage from the plan-10 filters doc.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the paint count next to every hue option in
HueFilterBar(parent hues and, when a parent is selected, child hues) reactive to the active free-text query and every other filter, instead of showing static full-library totals. Zero-count hue pills stay visible and clickable but render muted, so the hue dimension never reflows or disappears.Implements
docs/02-paint-data-search/13-paint-explorer-reactive-hue-counts.mdby extending plan 10's existinggetPaintFacetCountssurface rather than adding a parallel hue-only path.What changed
PaintFacetCountstype gainshueandchildHuemaps (lowercased-name keys).getPaintFacetCountsservice computes two additional count sets under the OR-within-dimension hold-out rule:hue_ids, ANDed with all non-hue filters (hue dimension held out) so selecting a hue never zeroes its siblings;hue_id.parentHueId/childHueIdalongside the existinghueIds(additive, non-breaking).usePaintFacetCountshook forwardsparentHueId/childHueIdand re-fetches when they change.useHueFilterhook no longer fetches child paint counts — it only fetches the structural child-hue list; counts now come from the single facet-counts source.HueCard/ChildHueCardgain anisEmptyprop that applies a muted (opacity-60) treatment while keeping the pill visible and clickable./paintsroute resolves the child-hue UUID and makes a singlegetPaintFacetCountscall with the hue args for a correct first paint (no flash of stale full-library counts); the per-huegetPaintCountByHueGrouploop and the legacy statichuePaintCountsprop are removed.Verification
npm run build— compiles successfully.npm run lint— 0 errors (pre-existing warnings only, none in touched files).tsc --noEmit— clean.CLAUDE.md.All acceptance criteria in the feature doc are checked off. Version bumped 1.77.0 → 1.78.0.
Notes for reviewer
parentHueId/childHueIdadded next to the existinghueIds) rather than the doc's suggested replace-hueIdsapproach. This keepshueIdscorrect for the brand/type/line counts, avoids a breaking change across call sites, and keeps every commit green.childHueIdis held out automatically because each child is counted independently by its ownhue_id.getPaintCountByHueGroupis retained (still used by/hues/[id]), so it was not deprecated in this PR.