Skip to content

fix: Save favorite direction toggle#1648

Merged
EmmaSimon merged 4 commits intomainfrom
es-add-favorite-direction-toggle
Apr 9, 2026
Merged

fix: Save favorite direction toggle#1648
EmmaSimon merged 4 commits intomainfrom
es-add-favorite-direction-toggle

Conversation

@EmmaSimon
Copy link
Copy Markdown
Contributor

Summary

Ticket: Notifications QA | Edit favorite direction toggle

Keep showing the direction toggle if it was visible when you first opened the add favorite page, even if the direction that you toggle to was already a saved favorite. When a saved favorite is opened directly then the toggle is never shown.

iOS
- [ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?
- [ ] Add temporary machine translations, marked "Needs Review"

android
- [ ] All user-facing strings added to strings resource in alphabetical order
- [ ] Expensive calculations are run in withContext(Dispatchers.Default) where possible (ideally in shared code)

Testing

Added unit tests confirming the new behavior, tested manually

Keep showing the direction toggle if it was visible when you first
opened the add favorite page, even if the direction that you toggle to
was already a saved favorite. When a saved favorite is opened directly
then the toggle is never shown.
@EmmaSimon EmmaSimon requested a review from a team as a code owner April 8, 2026 15:32
@EmmaSimon EmmaSimon requested a review from boringcactus April 8, 2026 15:32
var wasAdding by rememberSaveable { mutableStateOf(favorites != null && !isFavorite) }
val showDirectionToggle by
rememberSaveable(stopDirections, wasAdding) {
mutableStateOf(stopDirections.size > 1 && wasAdding)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this is just a val it probably doesn’t need to be a mutableStateOf.

@EmmaSimon EmmaSimon enabled auto-merge April 9, 2026 15:19
@EmmaSimon EmmaSimon added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit a704dfe Apr 9, 2026
11 checks passed
@EmmaSimon EmmaSimon deleted the es-add-favorite-direction-toggle branch April 9, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants