Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Persist DateTime state using rememberSaveable #408

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Dec 2, 2024

TL;DR

Implemented state persistence for the date-time selector screen to maintain user selections across configuration changes.

What changed?

  • Converted date selection variables to use rememberSaveable instead of remember
  • Stored date values as strings since LocalDate isn't saveable
  • Added parsing logic to convert between string and LocalDate formats
  • Made the reset flag persistable across configuration changes

Screenshots

Screen.Recording.2024-12-02.at.4.21.22.pm.mov

Why make this change?

Previously, user selections were lost during configuration changes (like screen rotation), creating a poor user experience. This change ensures that user selections persist across these events, improving the overall usability of the date-time selector.

@ksharma-xyz ksharma-xyz changed the title Fix: RememberSaveable for date in order to save state for configuration change UI: Persist DateTime state using rememberSaveable Dec 2, 2024
@ksharma-xyz ksharma-xyz marked this pull request as ready for review December 2, 2024 05:12
@ksharma-xyz ksharma-xyz changed the base branch from 12-02-update_datetimeselection_screen to graphite-base/408 December 2, 2024 05:20
@ksharma-xyz ksharma-xyz force-pushed the 12-02-fix_remembersaveable_for_date_in_order_to_save_state_for_configuration_change branch from ecef5cb to 62ce099 Compare December 2, 2024 05:22
@ksharma-xyz ksharma-xyz changed the base branch from graphite-base/408 to main December 2, 2024 05:22
@ksharma-xyz ksharma-xyz force-pushed the 12-02-fix_remembersaveable_for_date_in_order_to_save_state_for_configuration_change branch from 62ce099 to d1ac56d Compare December 2, 2024 05:23
@ksharma-xyz ksharma-xyz added this to the Release v1.0 iOS + Android milestone Dec 2, 2024
@ksharma-xyz ksharma-xyz merged commit 9f37bed into main Dec 2, 2024
2 checks passed
Copy link
Owner Author

Merge activity

  • Dec 2, 12:31 AM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz deleted the 12-02-fix_remembersaveable_for_date_in_order_to_save_state_for_configuration_change branch December 2, 2024 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant