mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
1.4 KiB
1.4 KiB
Specification: Extract Remaining App-Only ViewModels
Overview
This track aims to migrate the final 5 ViewModels currently trapped in the app module to their respective KMP feature:* or core:* modules. These ViewModels contain business logic that should be shared across platforms, but are currently coupled to Android-specific APIs.
Functional Requirements
- Isolate Dependencies: Identify and abstract Android-specific APIs using a hybrid approach (expect/actual for low-level types and injected interfaces for services).
- Relocate ViewModels: Move the core logic of these ViewModels to
commonMainin the target modules:SettingsViewModel&RadioConfigViewModel->feature:settingsDebugViewModel->feature:settingsMetricsViewModel->feature:nodeUIViewModellogic ->core:ui
- Dependency Injection: Update Koin modules to provide platform-specific implementations of the abstracted interfaces.
- Maintain Parity: Ensure existing functionality is preserved on Android while enabling these features on Desktop.
Acceptance Criteria
- All 5 ViewModels are extracted from the
appmodule and logic resides incommonMain. commonTestcoverage is established for the shared logic in each respective module.- The
appmodule file count is further reduced. - Desktop target can instantiate and use the shared ViewModels.