Repository navigation
Add blocked-type, vehicle-type, and photo to report submission - #12
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three optional pieces of detail to the Confirm step of the report flow, shown once regardless of which location method was used:
Everything here is optional — a report is already complete with just a location, so none of this ever blocks submission.
Data model / API:
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
npm testpasses locally inserver/(if backend changed)npm testpasses locally inweb/(if frontend changed)