Add optional start times for full-day events#71
Conversation
|
@codex start review |
There was a problem hiding this comment.
Pull request overview
Adds support for an optional “start time” on full-day events, persists it on the Event model, and uses it to improve labeling and calendar exports while also consolidating the edit/view toggle UI into a shared segmented control.
Changes:
- Add
fullDayStartMinutesto event creation validation/types, persist it in Prisma, and expose it via public snapshots. - Use
fullDayStartMinutesto enrich full-day availability labels and generate timed ICS output for closed full-day events. - Introduce a shared
SegmentedControlUI primitive and replace duplicated edit/view toggle markup.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/validators.ts | Adds optional fullDayStartMinutes validation to event creation schema. |
| src/lib/validators.test.ts | Extends validator tests to cover parsing/persisting fullDayStartMinutes. |
| src/lib/types.ts | Extends event input and snapshot types with fullDayStartMinutes. |
| src/lib/i18n/messages.ts | Adds copy for full-day start time field and preview label. |
| src/lib/event-service.ts | Persists fullDayStartMinutes for full-day events and includes it in snapshots. |
| src/lib/event-service.test.ts | Updates service tests to account for the new DB field and creation behavior. |
| src/lib/availability.ts | Adds formatting and timed end-time support for full-day suggestions/finalized slot labels. |
| src/lib/availability.test.ts | Adds coverage for labels/slotEnd when fullDayStartMinutes is present. |
| src/components/ui/segmented-control.tsx | Introduces shared segmented control component. |
| src/components/full-day-availability.tsx | Displays “likely start time” and replaces mode toggle with segmented control. |
| src/components/event-heatmap.tsx | Replaces mode toggle with segmented control for consistent UI. |
| src/components/create-event-form.tsx | Adds full-day start time selector + preview field and submits it for full-day events. |
| src/components/create-event-form.test.tsx | Adds test ensuring fullDayStartMinutes is sent for full-day creation. |
| src/app/api/events/route.test.ts | Updates API tests to include fullDayStartMinutes in POST payload expectations. |
| src/app/api/events/[slug]/ics/route.ts | Exports timed DTSTART/DTEND for closed full-day events when a start time exists. |
| src/app/api/events/[slug]/ics/route.test.ts | Adds timed full-day ICS export test coverage. |
| prisma/schema.prisma | Adds nullable fullDayStartMinutes column to Event. |
| prisma/migrations/20260427150000_add_full_day_start_time/migration.sql | Migration to add the new DB column. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 114b5b6aa6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Testing
pnpm verifypassed