Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a timezone selection feature that lets users pick a timezone when choosing appointment times and updates the appointment logic and calendar links accordingly.
- Introduces a
TimezoneSelectordropdown component for picking timezones in the UI - Updates
AppointmentScreenModelto recalculate times and calendar days when the timezone changes - Adjusts Google Calendar link generation to include the selected timezone and adds a unit test for timezone changes
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| AppointmentScreenModelTest.kt | Adds test for changeTimezone behavior and time recalculation |
| TimezoneSelector.kt | New composable exposing a dropdown of formatted timezones |
| AppointmentTimeSelectionSection.kt | Integrates TimezoneSelector into the time selection UI |
| AppointmentTimeScreen.kt | Hooks up changeTimezone handler from the screen model |
| AppointmentConfirmationSection.kt | Passes selected timezone into Google Calendar link |
| AppointmentPresentationMapper.kt | Extends mapping to accept a TimeZone parameter |
| AppointmentScreenModel.kt | Stores selected TimeZone, recalculates times/calendar days on change |
Comments suppressed due to low confidence (2)
composeApp/src/commonMain/kotlin/br/com/cauezito/schedrix/presentation/screens/time/AppointmentTimeScreen.kt:47
- Mixing named arguments (
onSelectedTime,onTimezoneChange) with a positional argument (onBackPressed) is not allowed in Kotlin. Change this toonBackPressed = onBackPressed.
onBackPressed
composeApp/src/commonMain/kotlin/br/com/cauezito/schedrix/ui/components/shared/TimezoneSelector.kt:40
- The
ExposedDropdownMenusymbol is used but not imported, which will cause a compilation error. Addimport androidx.compose.material3.ExposedDropdownMenu.
ExposedDropdownMenu(
| redirectLink = generateGoogleCalendarLink( | ||
| userName = name, | ||
| startDateTime = state.finalSelectedDateTime, | ||
| timezone = TimeZone.of(state.currentTimezone.replace(" - ", "/").replace(" ", "_")) |
There was a problem hiding this comment.
[nitpick] Using string replace calls to map the formatted timezone back into a valid ID is brittle. Consider extracting or centralizing this mapping logic into a helper function or using a reliable lookup.
| timezone = TimeZone.of(state.currentTimezone.replace(" - ", "/").replace(" ", "_")) | |
| timezone = TimeZone.of(mapFormattedTimezoneToId(state.currentTimezone)) |
Summary
TimezoneSelectorcomponent!!Testing
./gradlew :composeApp:test(fails: SDK location not found)https://chatgpt.com/codex/tasks/task_e_683f8ecde1e883218595a9bc412047eb