Skip to content

Add blocked-type, vehicle-type, and photo to report submission - #12

Merged
ace040686 merged 1 commit into
mainfrom
report-details-photo
Aug 14, 2026
Merged

ace040686 merged 1 commit into
mainfrom
report-details-photo

Conversation

@ace040686

Copy link
Copy Markdown
Collaborator

Adds three optional pieces of detail to the Confirm step of the report flow, shown once regardless of which location method was used:

  • "What's being blocked?" — collapsible question with Bike Lane, Bus Lane, Fire Hydrant, Crosswalk, and Other (with a free-text field)
  • "Type of vehicle" — collapsible question with Commercial Vehicle, Rideshare/Food Delivery, Personal Vehicle, and Other (same pattern)
  • "Add a photo" — optional upload with two entry points, "Take a photo" (capture="environment", opens the rear camera on mobile) and "Choose a file" (a normal picker); photos are downscaled/recompressed client-side (web/src/lib/imagePrep.ts) before upload to keep payloads reasonably small

Everything here is optional — a report is already complete with just a location, so none of this ever blocks submission.

Data model / API:

  • New Prisma migration adding blockedType, blockedTypeOther, vehicleType, vehicleTypeOther, and photo columns to Report (photo stored as a base64 data URL directly in Postgres for now, no object store set up yet)
  • Zod validation for the new fields on POST /api/reports, including a size/format check on the photo data URL; raised the JSON body limit to 10mb to accommodate it
  • CreateReportInput/ReportDetails types extended to match

Tests: added coverage in reports.test.ts (backend), ConfirmStep.test.tsx and imagePrep.test.ts (frontend unit), and a new Playwright E2E case exercising the full submission with all three fields filled in.

Related issue

Closes #

Summary

Test plan

  • [ ]
  • [ ]

Checklist

  • Added or updated tests covering this change
  • npm test passes locally in server/ (if backend changed)
  • npm test passes locally in web/ (if frontend changed)
  • Manually verified in the browser (if UI-facing)

Adds three optional pieces of detail to the Confirm step of the report
flow, shown once regardless of which location method was used:

- "What's being blocked?" — collapsible question with Bike Lane, Bus
  Lane, Fire Hydrant, Crosswalk, and Other (with a free-text field)
- "Type of vehicle" — collapsible question with Commercial Vehicle,
  Rideshare/Food Delivery, Personal Vehicle, and Other (same pattern)
- "Add a photo" — optional upload with two entry points, "Take a
  photo" (capture="environment", opens the rear camera on mobile) and
  "Choose a file" (a normal picker); photos are downscaled/recompressed
  client-side (web/src/lib/imagePrep.ts) before upload to keep payloads
  reasonably small

Everything here is optional — a report is already complete with just a
location, so none of this ever blocks submission.

Data model / API:
- New Prisma migration adding blockedType, blockedTypeOther,
  vehicleType, vehicleTypeOther, and photo columns to Report (photo
  stored as a base64 data URL directly in Postgres for now, no object
  store set up yet)
- Zod validation for the new fields on POST /api/reports, including a
  size/format check on the photo data URL; raised the JSON body limit
  to 10mb to accommodate it
- CreateReportInput/ReportDetails types extended to match

Tests: added coverage in reports.test.ts (backend), ConfirmStep.test.tsx
and imagePrep.test.ts (frontend unit), and a new Playwright E2E case
exercising the full submission with all three fields filled in.
@ace040686
ace040686 merged commit 0ca0fd8 into main Aug 14, 2026
2 checks passed
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