chore(conductor): Add new track 'extract_viewmodels_20260316' for ViewModel extraction

This commit is contained in:
James Rich 2026-03-16 10:10:48 -05:00
parent ec6ad7a255
commit 0f0f02944f
5 changed files with 58 additions and 0 deletions

View file

@ -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/)*

View file

@ -0,0 +1,5 @@
# Track extract_viewmodels_20260316 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)

View file

@ -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."
}

View file

@ -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)

View file

@ -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.