Skip to content

feat(NotificationSettingsViewModel): New VM to hold notification settings state - #1985

Open
KaylaBrady wants to merge 11 commits into
mainfrom
kb-window-vm
Open

feat(NotificationSettingsViewModel): New VM to hold notification settings state#1985
KaylaBrady wants to merge 11 commits into
mainfrom
kb-window-vm

Conversation

@KaylaBrady

@KaylaBrady KaylaBrady commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ticket: No ticket, follow up to #1971

What is this PR for?

Adds a new NotificationSettingsViewModel and adopts it on android and iOS. I intended to just get this PR out adopting it for android... but I wanted to make sure the pieces would all fit on iOS too, so this PR is bigger than I would have liked. Sorry for the increased size!!

Overall I'm happier with this modelling of Preset and think that pushing more logic into shared is an improvement.

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

What testing have you done?

  • Ran locally
  • Added & updated unit tests
    • Biggest change is to the iOS tests - now that we are using a VM, these have been re-written to be true unit tests. I ended up making the tests for NotificationSettingsWidget use a pure helper view instead of dealing with the mock VM setup for simplicity.

)
}

lateinit var settings: MutableState<FavoriteSettings.Notifications>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Some of these tests were testing a mix of UI changes + data changes - I've opted to update them to just UI changes rather than testing the innerworkings of calls to the VM

.bind(IMapViewModel::class)
single { NearbyViewModel(get(), get(), get(named("coroutineDispatcherDefault"))) }
.bind(INearbyViewModel::class)
factory { NotificationSettingsViewModel(get()) }.bind(INotificationSettingsViewModel::class)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If we make this a single, it would effectively save your last selected window for the app session. Will check with design if that is desirable

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Update: We could make this a single, but I'm going to consider it as a follow up in case there are any other implications of that change to consider.

@KaylaBrady
KaylaBrady marked this pull request as ready for review September 8, 2026 20:42
@KaylaBrady
KaylaBrady requested a review from a team as a code owner September 8, 2026 20:42
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.

1 participant