FE: categorical filter chips and page wiring#1735
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
❌ Fast Track: checks did not passFailed guardrails: frontend/complexity (Guardrail threw: Cannot find module 'eslint'
Reflects |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52599bb51c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (value === null) return hasMissingValue ? 'Missing (no value)' : 'Missing'; | ||
| if (value === 'Missing' && hasNoValue) return 'Missing (value)'; |
There was a problem hiding this comment.
Preserve Missing disambiguation for single selections
For a categorical field that contains both absent values and the literal string Missing, selecting only one of those buckets renders the chip as plain Missing because the formatter only disambiguates when the other value is also selected. This makes the active filter ambiguous even though the distribution picker distinguishes the two buckets; label null and literal Missing independently, or carry the bucket label into the chip.
Useful? React with 👍 / 👎.
| range?: Range; | ||
| values?: CategoricalMetadataValue[]; |
There was a problem hiding this comment.
Make chip variants a discriminated union
Because kind already distinguishes numeric from categorical chips, keeping both range and values optional permits impossible chip shapes and forces defensive rendering checks. Model this as separate numeric/categorical variants so numeric chips must carry a range and categorical chips must carry values.
AGENTS.md reference: AGENTS.md:L39-L41
Useful? React with 👍 / 👎.
useMetadataFilterChips now tracks categorical selections and produces chips with a disambiguated label format for literal 'Missing'/'Other' values vs the sentinel missing bucket. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pages The layout fetches categorical distributions, exposes toggle/clear handlers to DatasetDistributionPanel, and passes categoricalMetadataValues into the shared metadataFilters. Frames and videos pages forward the same values to their respective filter hooks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
52599bb to
09a545f
Compare
8755105 to
6982778
Compare
Summary
Stacked on p9.
MetadataFilterChips/useMetadataFilterChips: tracks categorical selections and emits chips with disambiguated labels —Missing (location)for the sentinel bucket vs"Missing" (location)for samples whose literal value is the string "Missing".Collection layout + video pages: the layout now fetches categorical distributions (
useCategoricalMetadataDistribution), exposestoggleCategoricalValue/clearCategoricalFieldhandlers toDatasetDistributionPanel, and mergescategoricalMetadataValuesinto the sharedmetadataFilters. The frames and videos pages forward the same values to their respective filter hooks.Test plan
make static-checks(frontend) passesnpm run test:unitpasses (updateduseMetadataFilterChipstests, new layout tests)Part of LIG-9585.