Skip to content

donation request review page - #123

Open
brian-fu wants to merge 3 commits into
feat/donation-request-componentsfrom
feat/donation-request-page
Open

donation request review page#123
brian-fu wants to merge 3 commits into
feat/donation-request-componentsfrom
feat/donation-request-page

Conversation

@brian-fu

@brian-fu brian-fu commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Stacked PR — base is feat/donation-request-components (#124), not main. Fourth of four: approve-reject-donation-item (dialogs, #121) → donation-request-schema (backend, #122) → donation-request-components (shared UI, #124) → this. Merge the ones below first; the base will retarget as they land.

Implements the admin donation-request review screen from Figma. The shared components this screen needed were split out into #124 — this PR is now just the screen.

No database

Per the task, nothing is fetched. The page reads from a local Zustand store seeded from a fixture (app/donation-request/), and every action (approve, reject, edit donor, schedule/confirm pickup) mutates local state. Field names and actions mirror the review-schema PR, so wiring to the live API later is a fetch swap, not a reshape.

Flow (app/donation-request/[id])

  • Donor Information card: read + inline edit (Yes/No ToggleGroup), collapsible.
  • Item cards reuse the existing approve/reject dialogs; show the rejection reason once rejected; photo strip opens the lightbox.
  • Schedule / Edit pickup dialog, scheduled-pickup card, confirm-date dialog. Editing a confirmed pickup's date clears the confirmation, matching the dialog warning and the backend rule.
  • Header badge derived from item + pickup state (pending → partially reviewed → reviewed + Schedule button → scheduled).

States covered

All 13 Figma frames: donor read/edit/collapsed, photo lightbox, approve/reject dialogs (reused), partially/fully reviewed, schedule pickup, unconfirmed/confirmed pickup, confirm-date, edit-with-warning.

Testing

  • 13 new tests (reviewStatus derivation, DonationItemCard); full suite 125 passing.
  • type-check, lint, prettier clean on all touched files.
  • Rendered locally at /donation-request/donation-req-001 (HTTP 200).

Decisions worth a look

  • Date field: native <input type="date"> with the calendar icon — no calendar popover is designed in any frame, and this needs no new dependency. Easy to swap for a ui/calendar later.

  • Donor edit entry point: no frame shows how donor-edit mode is opened, so an edit affordance sits beside the collapse chevron.

  • "2/4 Approved": frame 8's label is driven by the real approved/total counts (the frame's own "2 Items Donated" contradicts the hardcoded 2/4).

  • types.ts has drifted from align donation request review schema with user flows #122 — notably items vs the schema's furniture_items, and DonorInformation bundling smoking_household / has_pets / pickup_address, which live on Donation (and as split address fields) rather than Donor.

  • Routes.DONATION_REQUESTS / donationRequestPath are defined but unused; the [id] route param is never read.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
home-again Ready Ready Preview, Comment Jul 26, 2026 6:30am

@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from 8531063 to fbf1ca7 Compare July 25, 2026 21:49
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from fbf1ca7 to 723f438 Compare July 25, 2026 21:53
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from 723f438 to 6d9a4b3 Compare July 25, 2026 21:57
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from 6d9a4b3 to e4014f0 Compare July 26, 2026 00:13
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from e4014f0 to bced470 Compare July 26, 2026 00:25
@brian-fu
brian-fu changed the base branch from feat/donation-request-schema to feat/donation-request-components July 26, 2026 00:25
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from bced470 to 50885e0 Compare July 26, 2026 01:49
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from 8d701fb to beb95ce Compare July 26, 2026 02:39
@brian-fu
brian-fu marked this pull request as ready for review July 26, 2026 03:08
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from beb95ce to 6423352 Compare July 26, 2026 05:34
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from 6423352 to 093274a Compare July 26, 2026 05:57
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from 093274a to a6256e2 Compare July 26, 2026 06:16
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from a6256e2 to 7dd6708 Compare July 26, 2026 06:23
@brian-fu
brian-fu force-pushed the feat/donation-request-components branch from ca425af to de1b795 Compare July 26, 2026 06:29
brian-fu added 3 commits July 26, 2026 02:29
Implement the admin donation-request review screen and the shared components
it needs. The database is not provisioned, so the page reads from a local
Zustand store seeded from a fixture; field names and actions mirror the
review-schema PR so wiring to the API later is a fetch swap.

New shared components (common/):
- ui/alert — cva callout (info/warning/destructive); ServiceAreaNotice now
  builds on it
- ui/collapsible, ui/copy-button, ui/toggle-group — thin base-ui wrappers
- data-display/PhotoStrip + PhotoLightboxDialog — thumbnail row and full-size
  viewer with prev/next + thumbnail rail
- layout/AdminHeader — logo + search + avatar top bar
- InformationBlock gains valueAction (copy button beside a value)
- status-labels gains ScheduledBadge

Flow (app/donation-request/[id]):
- Donor Information card with read + inline edit (Yes/No toggles), collapsible
- Item cards reusing the existing approve/reject dialogs, with the rejection
  reason shown once rejected and a photo strip that opens the lightbox
- Schedule / Edit pickup dialog (native date input per design; the calendar
  popover is not designed), scheduled-pickup card, and confirm-date dialog.
  Editing a confirmed pickup's date clears the confirmation, matching the
  dialog warning and the backend rule.
- Header badge derived from item + pickup state (pending / partially reviewed /
  reviewed + Schedule button / scheduled)

Tests: reviewStatus derivation, DonationItemCard, PhotoLightboxDialog
(18 new; suite 125 passing). Gallery entries added for the new shared pieces.
type-check, lint, prettier clean.

Two design gaps handled: frame 1 has no visible entry into donor-edit mode, so
an edit affordance sits beside the collapse chevron; frame 8's "2/4 Approved"
label is driven by the real approved/total counts.
Schema alignment with the review-schema PR
- Renames `items` to `furniture_items`, matching DonationDetail, so wiring the
  live API stays a fetch swap.
- Widens ItemReviewStatus to all seven FurnitureStatus values. Only the first
  three are reachable from this screen, but an item can arrive from the API in a
  downstream state and was previously mistyped.
- Documents the deliberate divergences at the top of types.ts — DonorInformation
  is a display shape, `condition` holds UI copy rather than
  FurnitureConditionEnum, `request_id`/`submitted_at` are presentation fields,
  and `pickup` is pre-resolved to the active one — so the next reader can tell
  intent from oversight.

Review-status precedence
- deriveReviewStatus checked for a scheduled pickup first, so a pickup booked
  while items were still outstanding reported "scheduled" and hid them. The
  backend explicitly orders this the other way: scheduling only outranks a
  finished review. Reordered to match, and the test that asserted the old
  behaviour ("regardless of item states") is replaced with cases covering both
  directions.

Dates
- The header used a local formatShortDate carrying the same UTC off-by-one that
  was just fixed in common; it now uses the shared helper.

Other
- Drops the decorative calendar icon from the pickup date field: type="date"
  draws its own picker indicator, so the two rendered side by side.
- Donor card actions use Figma's borderless Cancel + outlined Save, distinct
  from the dialogs where Save is the filled primary action.
- Removes the unused DONATION_REQUESTS / donationRequestPath constants. Nothing
  referenced them, and dropping them leaves this branch touching only
  app/donation-request/.
- Adds donationRequestStore tests — the confirmation-invalidation rule the Edit
  dialog warns about had no coverage at all.
Replaces the per-item random picsum seeds with five copies of the leather sofa
shot from the review frames (added to public/ in the shared-components PR). The
strip is one item's photo set, so five unrelated stock images misrepresented
what the screen shows.

samplePhotos() no longer needs a seed argument.
@brian-fu
brian-fu force-pushed the feat/donation-request-page branch from 7dd6708 to 4a49376 Compare July 26, 2026 06:29
@brian-fu brian-fu changed the title frontend: donation request review page donation request review page Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant