diff --git a/conductor/tracks.md b/conductor/tracks.md index 22d3d6494..a6a06d5b8 100644 --- a/conductor/tracks.md +++ b/conductor/tracks.md @@ -1,3 +1,8 @@ # Project Tracks This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder. + +--- + +- [ ] **Track: Extract remaining 5 App-Only ViewModels (AndroidSettingsViewModel, AndroidRadioConfigViewModel, AndroidDebugViewModel, AndroidMetricsViewModel, UIViewModel) to shared KMP feature/core modules by isolating Android-specific dependencies (Uri, Location, Locale) behind abstractions.** +*Link: [./tracks/extract_viewmodels_20260316/](./tracks/extract_viewmodels_20260316/)* diff --git a/conductor/tracks/extract_viewmodels_20260316/index.md b/conductor/tracks/extract_viewmodels_20260316/index.md new file mode 100644 index 000000000..aeedeb73a --- /dev/null +++ b/conductor/tracks/extract_viewmodels_20260316/index.md @@ -0,0 +1,5 @@ +# Track extract_viewmodels_20260316 Context + +- [Specification](./spec.md) +- [Implementation Plan](./plan.md) +- [Metadata](./metadata.json) \ No newline at end of file diff --git a/conductor/tracks/extract_viewmodels_20260316/metadata.json b/conductor/tracks/extract_viewmodels_20260316/metadata.json new file mode 100644 index 000000000..3ac6e636e --- /dev/null +++ b/conductor/tracks/extract_viewmodels_20260316/metadata.json @@ -0,0 +1,8 @@ +{ + "track_id": "extract_viewmodels_20260316", + "type": "refactor", + "status": "new", + "created_at": "2026-03-16T12:00:00Z", + "updated_at": "2026-03-16T12:00:00Z", + "description": "Extract remaining 5 App-Only ViewModels (AndroidSettingsViewModel, AndroidRadioConfigViewModel, AndroidDebugViewModel, AndroidMetricsViewModel, UIViewModel) to shared KMP feature/core modules by isolating Android-specific dependencies (Uri, Location, Locale) behind abstractions." +} \ No newline at end of file diff --git a/conductor/tracks/extract_viewmodels_20260316/plan.md b/conductor/tracks/extract_viewmodels_20260316/plan.md new file mode 100644 index 000000000..f37e9dc27 --- /dev/null +++ b/conductor/tracks/extract_viewmodels_20260316/plan.md @@ -0,0 +1,20 @@ +# Implementation Plan: Extract Remaining App-Only ViewModels + +## Phase 1: Infrastructure & Abstractions +- [ ] Task: Implement `MeshtasticUri` (expect/actual wrapper for `android.net.Uri`) in `core:common`. +- [ ] Task: Define `FileService` and `LocationService` interfaces in `core:repository/commonMain`. +- [ ] Task: Create Android implementations for these services in `core:service/androidMain`. +- [ ] Task: Conductor - User Manual Verification 'Phase 1: Infrastructure & Abstractions' (Protocol in workflow.md) + +## Phase 2: Feature Module Extractions (Settings & Node) +- [ ] Task: Extract `AndroidSettingsViewModel` & `AndroidRadioConfigViewModel` to `feature:settings/commonMain`. +- [ ] Task: Extract `AndroidMetricsViewModel` to `feature:node/commonMain`. +- [ ] Task: Extract `AndroidDebugViewModel` to `feature:settings/commonMain`. +- [ ] Task: Update Koin modules in `feature:settings` and `feature:node` to wire the new shared ViewModels. +- [ ] Task: Conductor - User Manual Verification 'Phase 2: Feature Module Extractions' (Protocol in workflow.md) + +## Phase 3: Core UI & Cleanup +- [ ] Task: Extract `UIViewModel` logic to `core:ui/commonMain`. +- [ ] Task: Verify the `app` module thinning progress and finalize any remaining DI cleanup in `AppKoinModule`. +- [ ] Task: Ensure all new shared ViewModels have baseline `commonTest` coverage using `core:testing` fakes. +- [ ] Task: Conductor - User Manual Verification 'Phase 3: Core UI & Cleanup' (Protocol in workflow.md) \ No newline at end of file diff --git a/conductor/tracks/extract_viewmodels_20260316/spec.md b/conductor/tracks/extract_viewmodels_20260316/spec.md new file mode 100644 index 000000000..2b782bd95 --- /dev/null +++ b/conductor/tracks/extract_viewmodels_20260316/spec.md @@ -0,0 +1,20 @@ +# 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 `commonMain` in the target modules: + - `SettingsViewModel` & `RadioConfigViewModel` -> `feature:settings` + - `DebugViewModel` -> `feature:settings` + - `MetricsViewModel` -> `feature:node` + - `UIViewModel` logic -> `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 `app` module and logic resides in `commonMain`. +- `commonTest` coverage is established for the shared logic in each respective module. +- The `app` module file count is further reduced. +- Desktop target can instantiate and use the shared ViewModels. \ No newline at end of file