-
Notifications
You must be signed in to change notification settings - Fork 0
Coverage Requests Page + Reusable Filter Bar #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummaryThis PR adds a new authorized On the backend it extends the coverage list API/service to accept date bounds and course/class constraints, and adds a lightweight Blocking issues are primarily around filter semantics (tab date bounds being overridden by explicit date range), API ordering changes (coverage list sort flipped to ascending), and authorization/data scoping for the new class names endpoint. Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| src/app/(authorized)/coverage/page.tsx | Wires /coverage page to new coverage list + filters; no blocking issues found. |
| src/components/coverage/filters/utils.ts | Builds backend filter input from tab+UI filters; BUG: dateRange overrides tab bounds, breaking tab semantics. |
| src/components/ui/filter-bar.tsx | Adds reusable query-param-backed filter bar primitive; no blocking issues found. |
| src/server/api/routers/class-router.ts | Adds class.names endpoint; BUG: permission uses coverage:view while returning all class names (enumeration). |
| src/server/db/migrations/0004_add_requested_at_to_coverage_request.sql | Adds requested_at column with backfill and NOT NULL constraint; looks correct. |
| src/server/services/cacheService.ts | Large cache service refactor/cleanup; no specific blocking issue identified in review. |
| src/server/services/entity/classService.ts | Adds getClassNames used by class.names endpoint; returns all courses without scoping (problem combined with router permission). |
| src/server/services/entity/coverageService.ts | Adds from/to/course filtering for coverage list; BUG: sort order changed to ascending which may break pagination/UX expectations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 files reviewed, 3 comments
Additional Comments (1)
|
Summary
This branch introduces a complete Coverage Requests page and the reusable filter-bar system it depends on.
Main Features
The new
/coverageroute is now fully wired end-to-end. On the frontend, coverage requests are loaded in an infinite, day-grouped list with a contextual aside that supports selection and next/previous navigation. Each request shows key shift/request metadata, and the aside exposes action controls (Take Shift/Withdraw) with confirmation flows.To support this, the branch adds
src/components/ui/filter-bar.tsxas a generic, query-param-backed filtering primitive. Coverage uses this to power tab state plus class/date filters, and keeps filter state in the URL so views are shareable and restorable.On the backend, coverage list APIs were expanded to accept date and class constraints, and the service now applies those filters when querying requests. The class API also now exposes a lightweight names endpoint used by the coverage filter UI.
Data Model / Migration
Coverage requests now store
requestedAtin the database (requested_at), with a migration that backfills existing rows and enforces non-null going forward. This timestamp is propagated through model/service responses and surfaced in coverage list + aside UI.Additional Notes
This branch also includes a handful of unrelated cleanups/fixes outside the core coverage work (styling/lint refactors and a password reset field binding fix), but the primary scope is the coverage page + filter framework + supporting API/data changes.