Skip to content

MVVM Refactor Phase 1: App shell, Settings and Home - #49

Open
kara-melvin wants to merge 16 commits into
mainfrom
mvvm-refactor-summer26
Open

MVVM Refactor Phase 1: App shell, Settings and Home#49
kara-melvin wants to merge 16 commits into
mainfrom
mvvm-refactor-summer26

Conversation

@kara-melvin

Copy link
Copy Markdown
Collaborator

Migrates the app shell (AppViewModel), SettingsScreen, and HomeScreen to the new StateViewModel single-immutable-state pattern.

  1. StateViewModel base class and UserMessage (one-shot messages as state)
  2. SettingsRepository as single source of truth over both the pref files
  3. MainActivity slimmed down. Composables in MainActivity (AppNavHost/ConversationChatScreen) were pulled into their own files.
  4. Deep link conversation IDs are now validated at the trust boundary.
  5. AppViewModel test suite + test infrastructure (MainDispatchRule, FakeSettingsRepository)

Kara added 16 commits June 22, 2026 14:03
…e DI bindings in GlobalApp.kt. This wraps both prefs files (settings/project_mesh_prefs) and exposes StateFlows from prefs with single-writer setters.
…s. Removed redundant coroutine calls/navigation code. Tested on 1 physical device.
…nActivity still uses its old state). AppViewModel is the first consumer of StateViewModel.
…now route through SettingsRepository setters, Home collects deviceName and the server-restart toast lives in a temporary Settings-composable. MainActivity's setContent block is rewritten onto AppViewModel with collectAsStateWithLifeCycle, deep-link parsing and LocalUtil.applyLocale. Device test works.
…server restarts. Toasts are migrated to userMessage state. SettingsScreen drops all 6 callbacks and collects our new immutable state. AppNavHost's Settings composable collapses to SettingsScreen().
…sly from SettingsRepository before launching.
…el. This left AppViewModel with no userMessage producer. We pulled out the dead code.
…Model + 4 loose stateflows. deviceName and concurrency_supported now mirror SettingsRepository. HomeScreen loses its deviceName param, StartHomeScreen loses its viewModel default param
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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