feat(formulation): wire CatalogueToolbar into the builder page (#039) - #2085
feat(formulation): wire CatalogueToolbar into the builder page (#039)#2085BigSimmo wants to merge 1 commit into
Conversation
Extracts the CatalogueToolbar component from PR #2073 and wires it into formulation-builder-page.tsx in place of the ad hoc TextField+Select pairing, without that PR's DoseLine/AnswerFooter adoption-manifest changes (see #2073's closure comment: those extract new components but never wire them into a real consumer, which inflates the design-system adoption count without satisfying #267's actual backend-payload requirement). Also fixes three CodeRabbit-flagged correctness issues in catalogue-toolbar.tsx while taking ownership of the component: - isFilterTriggerProps only recognized objects carrying onToggle or activeCount, so a filterTrigger config with just e.g. { label, disabled } fell through to being rendered as a React child and threw. Now checks all seven declared keys. - The plural-noun fallback derived plurals by appending "s", which is wrong for irregular nouns (e.g. "status" -> "statu"/"status" instead of "statuses"). Added an explicit pluralNoun override, defaulting to the previous "${noun}s" behavior for existing callers. - Applied-filter chips rendered "undefined: value" when a chip had no groupLabel, and always announced groupLabel in the remove button's aria-label even when accessibleLabel was supplied. Now renders the group prefix only when present and prefers accessibleLabel. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnhwRP5FsY5JktkbwAcubD
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:57 minutes Limit details: You’ve used all 1 included review currently available under your plan. You completed 99 included PR reviews in the past 7 days; at that activity level, included reviews refill at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Comment |
CI triageCI failed on this PR. Automated classification of the 3 failed job(s):
Compared with main CI run #11840 (cancelled). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
Summary
CatalogueToolbarcomponent and its wiring intoformulation-builder-page.tsx(addressing Fix critical security and clinical safety issues #39 — toolbar consolidation), without feat(ui): standardize catalogue toolbars, wire dose & footer provenance, and update adoption proofs (#039, #235, #267) #2073'sDoseLine/AnswerFooterextraction or the design-system adoption-manifest changes that went with it. See the closure comment on feat(ui): standardize catalogue toolbars, wire dose & footer provenance, and update adoption proofs (#039, #235, #267) #2073 for the full rationale — those components were extracted but never wired into a real new consumer, which would have inflated the adoption count without actually satisfying test: deep public access and production scope checks #267's blocked backend-payload requirement.#267and#235remain open and unaddressed by this PR; it only targets#039.src/components/ui/catalogue-toolbar.tsx(new): consolidates search, sort, filter-trigger, applied-filter chips, and result-count into one accessible, responsive bar for catalogue surfaces. Re-exported viasrc/components/catalogue-toolbar.tsx.src/components/formulation/formulation-builder-page.tsx: replaced the ad hocTextField+Selectpairing withCatalogueToolbar.isFilterTriggerPropsonly recognized two of the seven declared config keys and could fall through to rendering a config object as a React child; the plural-noun fallback broke for irregular nouns like "status" (now takes an explicitpluralNounoverride, defaulting to the previous behavior); applied-filter chips rendered a literalundefined:prefix whengroupLabelwas absent and ignoredaccessibleLabelin the remove button's aria-label.undefined)pluralNounprop instead of the resolved value — fixed before pushing.tests/catalogue-toolbar.dom.test.tsx(new, carried over unchanged from feat(ui): standardize catalogue toolbars, wire dose & footer provenance, and update adoption proofs (#039, #235, #267) #2073): DOM coverage for rendering, interactions, the disabled-when-no-toggle-handler default, applied-filter chips, and singular/plural count formatting. All existing assertions in this file are still satisfied by the fixed component (verified by hand — see Verification below).Verification
npm run verify:pr-local— not run: this environment has only Node 22 installed, and the repo pinsengines: ">=24.15.0 <25"withengine-strict=truein.npmrc, sonpm ci/npm installhard-fails before installing anything (same constraint noted on PR Show the form's own name on the forms source card, tidy badges #2041). No toolchain was available to run tests, typecheck, or lint locally.CatalogueToolbarPropsfield used informulation-builder-page.tsxagainst the type definition, and walked each of the fourtests/catalogue-toolbar.dom.test.tsxcases against the fixed component logic to confirm none regress (in particular the "disabled when no toggle handler" and singular/plural count tests, since those are exactly the areas I touched).npm run test:focused -- --files src/components/ui/catalogue-toolbar.tsx,src/components/formulation/formulation-builder-page.tsx,tests/catalogue-toolbar.dom.test.tsx(ornpm run verify:pr-local) before merge.npm run verify:ui— not run, same environment constraint; this is a page-scoped component swap (sharedResultFilterSheet/ResultFilterFacetChipswere not touched), so perdocs/testing.md's speed playbook a focused DOM/component check is the appropriate tier — recommend a quick manual or CI Production UI check of/formulation/buildbefore merge.npm run verify:release— not applicable.npm run design-system:adoption:update(writesdocs/design-system/adoption-manifest.json/ADOPTION.md/COMPONENTS.md) was not run for the same toolchain reason —CatalogueToolbaris now used in production code but the adoption manifest doesn't reflect it yet, socheck:design-system-contractwill likely fail until someone with a Node 24 environment runs that regeneration command and commits the result. I deliberately did not hand-edit those generated files.Risk and rollout
Notes
Generated by Claude Code