feat(frontend/plans): inline column filters via shared lib (refs #166) - #791
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Warning Review limit reached
More reviews will be available in 7 minutes and 20 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai full review |
Rate Limit Exceeded
|
Introduces a Plans-scoped per-column filter slice (PlansColumnId, PlansColumnFilter, PlansColumnFilters) with get/set/clear accessors, mirroring the existing Recommendations slice. Kept as a separate slice so the Plans, History, and RI Exchange follow-ups to PR #570 can land in parallel without contending on each other's state shape. In-memory only — survives tab switches within the SPA, resets on full reload (same lifecycle as recommendationsColumnFilters). Refs #166.
Wires the Planned Purchases table to the shared lib/column-filters primitives extracted in PR #570. Each filterable column gets an inline trigger button in its header; clicking opens a popover with either a multi-select (categorical) or a numeric-expression input. Filters AND together, persist in-memory across the SPA session, and are applied at render time. Columns wired: - categorical: provider, service, resource_type, term, payment, status - numeric: count, upfront_cost, estimated_savings Numeric predicates compare against the rounded display value (roundForDisplay + displayPrecisionForPlan) so the issue #484 exact-match contract is preserved here too. Re-renders go through a cached lastLoadedPurchases module slice so popover commits never re-fetch from the API. Popover lives on document.body and is re-anchored after each table re-render. Mock-state additions in plans*.test.ts and xss-purchase-status.test.ts mirror the new accessors; legacy assertions continue to pass. Refs #166. Sibling follow-ups land in parallel for History and RI Exchange.
Adds plans-column-filters.test.ts covering the Planned Purchases table integration with lib/column-filters: - every filterable column header carries a trigger button - clicking opens a portal popover detached to document.body - categorical set filter narrows rows (provider=aws) - numeric expression filter narrows rows (count >= 2) - stacked filters AND together - invalid expressions surface the lib's inline error and apply no filter - (All) tri-state restores the full row set after narrowing The shared parseNumericFilter + applyColumnFilters primitives keep their own coverage in column-filters.test.ts; these tests focus on the Plans-specific wiring. Refs #166.
Matches the canonical recommendations.ts wiring exactly (⛛ filter icon, — em-dash inside the aria-label). Keeps the rendered DOM identical to the Opportunities tab so the two surfaces are indistinguishable at the screen-reader and visual layers. No behavioural change.
415faec to
d1d4645
Compare
|
Rebased on Resolved conflicts in three test files where the base branch's group-membership authz migration (PR #907) collided with this PR's new per-column filter mock accessors:
In each, kept both sides: the base's Verified post-rebase: all touched plans/state suites pass, @coderabbitai review |
|
Kicking off the incremental review now against the rebased commits. 🧠 Learnings used✅ Action performedReview finished.
|
Summary
Wires the Planned Purchases table to the shared
lib/column-filtersprimitives extracted in merged PR #570. Each filterable column header carries an inline filter trigger button that opens a popover (multi-select for categorical, free-text expression for numeric). Filters AND together and persist in-memory for the SPA session — matching the canonical Recommendations-tab pattern.This is one of three parallel follow-up PRs to #570. Siblings cover History and RI Exchange; each owns its own column-id type and filter slice so they can land in any order without merge conflicts.
Columns wired:
provider,service,resource_type,term,payment,statuscount,upfront_cost,estimated_savingsNumeric predicates compare against the rounded display value (issue #484 contract preserved here too).
Commits
refactor(frontend/state)— addsPlansColumnId+plansColumnFiltersslice (separate fromRecommendationsColumnIdso siblings can land in parallel)feat(frontend/plans)— table wiring: trigger buttons, popover lifecycle, cell extractors,applyColumnFilterscall sitetest(frontend/plans)— newplans-column-filters.test.tsregression suitestyle(frontend/plans)— match the canonical recommendations⛛filter glyph +—em-dash escapesTest plan
npx tsc --noEmitcleannpm test -- plans— all 65 suites pass (2148 tests, 1 pre-existing skip)npm test -- column-filters— shared-lib suite still greenplans-column-filters.test.tscovers: header trigger presence, popover opens detached, categorical narrowing (provider=aws), numeric narrowing (count >= 2), stacked filters AND together, invalid expression shows inline error, (All) restores full row set>=100in the Upfront filter → table narrows; clear via Clear button → full set returns.Refs #166.