Skip to content

Add timezone selection feature#2

Open
cauezito wants to merge 1 commit intomasterfrom
codex/add-timezone-change-support
Open

Add timezone selection feature#2
cauezito wants to merge 1 commit intomasterfrom
codex/add-timezone-change-support

Conversation

@cauezito
Copy link
Owner

@cauezito cauezito commented Jun 4, 2025

Summary

  • support converting appointment times based on user timezone
  • let users change timezone in time selection screen
  • expose timezone list via new TimezoneSelector component
  • adjust Google Calendar link with selected timezone
  • cover timezone changes in unit tests
  • fix timezone recalculation logic and avoid !!

Testing

  • ./gradlew :composeApp:test (fails: SDK location not found)

https://chatgpt.com/codex/tasks/task_e_683f8ecde1e883218595a9bc412047eb

@cauezito cauezito requested a review from Copilot June 9, 2025 21:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TimezoneSelector dropdown component for picking timezones in the UI
  • Updates AppointmentScreenModel to 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 to onBackPressed = onBackPressed.
onBackPressed

composeApp/src/commonMain/kotlin/br/com/cauezito/schedrix/ui/components/shared/TimezoneSelector.kt:40

  • The ExposedDropdownMenu symbol is used but not imported, which will cause a compilation error. Add import androidx.compose.material3.ExposedDropdownMenu.
ExposedDropdownMenu(

redirectLink = generateGoogleCalendarLink(
userName = name,
startDateTime = state.finalSelectedDateTime,
timezone = TimeZone.of(state.currentTimezone.replace(" - ", "/").replace(" ", "_"))
Copy link

Copilot AI Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
timezone = TimeZone.of(state.currentTimezone.replace(" - ", "/").replace(" ", "_"))
timezone = TimeZone.of(mapFormattedTimezoneToId(state.currentTimezone))

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants