Commit Graph

6174 Commits

Author SHA1 Message Date
James Rich
07ff900ef5 test: add verification for MultiBackstack navigation logic 2026-03-27 08:10:26 -05:00
James Rich
2d759d8e81 docs: update playbook with multiple backstack architecture 2026-03-27 07:53:57 -05:00
James Rich
763a8f8b07 style: apply spotless formatting 2026-03-26 22:17:16 -05:00
James Rich
48ac9a9019 feat(ui): align multiple backstacks with Navigation 3 official recipes
Refactored the application's multi-tab navigation to strictly align with the official AndroidX `nav3-recipes` for multiple backstacks.

Previously, swapping a single `NavBackStack` list instance caused Navigation 3 to perceive old entries as "popped," leading to the destruction of their associated `ViewModelStore` and UI state.

This commit resolves the issue by:
- Redesigning `MultiBackstack` as a state holder managing independent `NavBackStack` instances per tab.
- Modifying `MeshtasticNavDisplay` to bind a fresh set of decorators (specifically `SaveableStateHolderNavEntryDecorator` and `ViewModelStoreNavEntryDecorator`) to the active backstack dynamically via `remember(backStack)`. This ensures decorators are swapped alongside the stack, preserving state for inactive tabs.
- Implementing the standard "exit through home" back-handling pattern across all platforms.
- Removing legacy manual string keys from `koinViewModel()` injections, as `ViewModelStoreNavEntryDecorator` now correctly isolates ViewModel scope per entry.
- Added `androidx.lifecycle.viewmodel.navigation3` dependencies to the `app` and `desktop` root modules to support the decorator injections at the root composition level.
2026-03-26 22:16:44 -05:00
James Rich
39333b3bea feat(ui): implement draggable pane expansion in adaptive navigation
This commit enhances the adaptive navigation system by adding draggable dividers to the list-detail and supporting pane layouts. This allows users to manually resize panes in multi-pane "Power User" scenes on larger displays.

Specific changes include:
- **Navigation Enhancements**: Updated `MeshtasticNavDisplay` to include `rememberPaneExpansionState` and `VerticalDragHandle` within `ListDetailSceneStrategy` and `SupportingPaneSceneStrategy`.
- **UI Components**: Configured `paneExpansionDraggable` modifiers with a minimum touch target of 48.dp for improved accessibility.
- **Documentation**: Updated `AGENTS.md` to reflect the availability of draggable dividers (`VerticalDragHandle` + `paneExpansionState`) for widths ≥ 1200dp.
- **Code Style**: Applied consistent formatting and line-wrapping across `NavBackStackExt.kt`, `MeshtasticAppShell.kt`, `ContactsNavigation.kt`, and `MeshtasticNavigationSuite.kt`.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 19:40:14 -05:00
James Rich
bffbe9ffbc feat(ui): implement adaptive extra pane strategy for navigation
This commit enhances the navigation system to support adaptive layouts by integrating `SupportingPaneSceneStrategy` and marking specific routes to utilize the "extra pane" in list-detail scenarios.

Specific changes include:
- **Navigation Infrastructure**: Added `supportingPaneSceneStrategy` to `MeshtasticNavDisplay` and updated documentation to reflect support for `extraPane()` and supporting pane layouts.
- **Node Feature**: Updated `NodeMap`, `TracerouteLog`, `TracerouteMap`, and generic node detail screens in `NodesNavigation.kt` to use `ListDetailSceneStrategy.extraPane()`.
- **Messaging Feature**: Updated `Share` and `QuickChat` routes in `ContactsNavigation.kt` to use `ListDetailSceneStrategy.extraPane()`.
- **API Integration**: Applied `ExperimentalMaterial3AdaptiveApi` where necessary to support the new adaptive navigation strategies.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 18:57:18 -05:00
James Rich
0bcd35e616 refactor(ui): toggle navigation labels based on layout type
This commit updates the `MeshtasticNavigationSuite` to conditionally show text labels based on the active navigation layout. Labels are now explicitly shown when using a `NavigationRail` and hidden otherwise to improve the visual density and consistency of the navigation UI across different adaptive breakpoints.

Specific changes include:
- Introduced a `showLabels` boolean determined by the current `layoutType`.
- Updated `NavigationSuiteScaffold` to only render the destination `label` if `showLabels` is true.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 18:11:54 -05:00
James Rich
02ea30d665 refactor: improve navigation backstack handling and screen decoupling
This commit refactors the navigation logic across `feature:node` and `feature:messaging` to use more robust backstack manipulation helpers and decouple screen implementations from navigation parameters.

Specific changes include:
- **Navigation Helpers**: Added `replaceLast` and `replaceAll` extensions to `MutableList<NavKey>` in `core:navigation` to allow more granular control over backstack mutations while minimizing structural changes.
- **Node Feature**:
    - Updated `NodesRoutes.NodeDetail` entry to directly instantiate `NodeDetailViewModel` and `CompassViewModel` using Koin, removing the reliance on `AdaptiveNodeListScreen` for detail rendering.
    - Simplified `AdaptiveNodeListScreen` by removing unused navigation and initialization parameters.
- **Messaging Feature**:
    - Refactored `ContactsRoutes.Messages` entry to handle ViewModel lifecycle and contact key initialization directly within the navigation graph.
    - Updated `ShareScreen` to use the new `replaceLast` helper for smoother transitions to message screens.
    - Simplified `AdaptiveContactsScreen` and `ContactsEntryContent` by removing unused `detailPaneCustom` and initialization logic.
- **Deep Linking**: Updated `MeshtasticAppShell` to use `backStack.replaceAll(navKeys)` when handling deep links, ensuring a cleaner backstack state transition.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 17:28:51 -05:00
James Rich
4b4b68c443 refactor: migrate list-detail layouts to Material 3 Adaptive Navigation3
- Replace the custom `AdaptiveListDetailScaffold` with the official `ListDetailSceneStrategy` to manage adaptive layout orchestration.
- Integrate `ListDetailSceneStrategy` into `MeshtasticNavDisplay` to enable native pane switching based on the navigation backstack.
- Update `ContactsNavigation` and `NodesNavigation` graphs to include `listPane()` and `detailPane()` metadata for relevant route entries.
- Simplify `AdaptiveContactsScreen` and `AdaptiveNodeListScreen` by removing manual scaffold navigation logic and delegating to the navigation framework.
- Add the `jetbrains.compose.material3.adaptive.navigation3` library dependency to `core:ui` and relevant feature modules.
- Refactor `DesktopMainScreen` and `Main.kt` with minor formatting and indentation updates for better readability.
2026-03-26 16:52:08 -05:00
James Rich
4e027ca28e refactor: streamline main screen navigation and ViewModel injection
- Update `MainScreen` (Android) and `DesktopMainScreen` to manage their own `NavBackStack` initialization internally.
- Refactor `MainScreen` to obtain `UIViewModel` via Koin injection instead of receiving it as a parameter from `MainActivity`.
- Remove default bottom padding from `MeshtasticAppShell` and associated screen-level modifiers to allow for more flexible layout orchestration.
- Simplify `DesktopMainScreen` by moving backstack management inside the composable and cleaning up the navigation provider logic.
- Remove redundant lint suppressions in `Main.kt` following the simplification of the main screen composable structure.
- Clean up imports and normalize the usage of `MeshtasticNavDisplay` and `MeshtasticNavigationSuite` across platforms.
2026-03-26 15:53:15 -05:00
James Rich
63faf20fc5 refactor: unify navigation display and enhance desktop adaptive layout
- Replace the standard `NavDisplay` with the custom `MeshtasticNavDisplay` in `AppIntroductionScreen` to centralize navigation and backstack handling.
- Update `DesktopMainScreen` to transition from a persistent `NavigationRail` to an adaptive navigation shell.
- Clean up unused imports related to `NavigationRail`, `NavKey`, and `NavDisplay` across desktop and intro features.
2026-03-26 15:03:54 -05:00
James Rich
cb31de73ad feat: implement MeshtasticNavDisplay and centralize Navigation 3 configuration
- Introduce `MeshtasticNavDisplay` in `core:ui` to encapsulate shared Navigation 3 configuration, including entry decorators, scene strategies, and transitions.
- Integrate `rememberViewModelStoreNavEntryDecorator` to provide entry-scoped `ViewModelStoreOwner` support, ensuring ViewModels are automatically cleared when their backstack entry is popped.
- Configure `DialogSceneStrategy` to enable navigation-driven dialogs that respect backstack lifecycle and predictive back gestures.
- Implement a standardized 350 ms crossfade transition for both forward and pop navigation across all platforms.
- Refactor `app` and `desktop` host modules to utilize `MeshtasticNavDisplay`, removing redundant manual configuration of `NavDisplay` and decorators.
- Update `core:ui` dependencies to include `lifecycle-viewmodel-navigation3` and move it away from platform-specific host modules.
- Update architectural documentation (`AGENTS.md`, `GEMINI.md`, and decision logs) to reflect the adoption of centralized navigation and ViewModel scoping patterns.
2026-03-26 13:54:27 -05:00
James Rich
3748f74d67 feat: upgrade to Navigation 3 Beta 01 and implement entry-scoped ViewModels
- Update Navigation 3 to `1.1.0-beta01`, JetBrains Lifecycle to `2.11.0-alpha02`, and Compose Multiplatform to `1.11.0-beta01`.
- Integrate `ViewModelStoreNavEntryDecorator` and `SaveableStateHolderNavEntryDecorator` into `NavDisplay` for both Android and Desktop shells.
- Enable automatic ViewModel scoping where ViewModels obtained via `koinViewModel()` inside `entry<T>` blocks are now tied to the backstack entry's lifetime and cleared on pop.
- Add `jetbrains.lifecycle.viewmodel.navigation3` dependency to support entry-level `ViewModelStore` management.
- Update `AGENTS.md`, `GEMINI.md`, and `copilot-instructions.md` to reflect the transition from Activity/Window-scoped ViewModels to entry-scoped lifecycles.
- Introduce `navigation3-api-alignment-2026-03.md` to document the audit of Navigation 3 Scene architecture and Material 3 Adaptive integration.
- Update `kmp-status.md` and existing decision docs to reflect the new dependency baseline and predictive back handling via `NavigationBackHandler`.
2026-03-26 13:33:10 -05:00
James Rich
9cdc78ac47 feat: refactor adaptive navigation using NavigationSuiteScaffold
- Integrate the `material3-adaptive-navigation-suite` library to streamline cross-platform navigation layouts.
- Replace manual branching logic for `NavigationBar` and `NavigationRail` with `NavigationSuiteScaffold` in `MeshtasticNavigationSuite`.
- Implement a `coerceNavigationType` helper to ensure `NavigationRail` is used for expanded widths instead of promoting to a `NavigationDrawer`.
- Utilize `currentWindowAdaptiveInfo` with large-width breakpoint support to improve responsiveness on Desktop and external displays.
- Remove redundant `MeshtasticNavigationBar` and `MeshtasticNavigationRail` private composables in favor of the standard navigation suite item API.
2026-03-26 12:23:26 -05:00
James Rich
141b54ff9c feat: migrate to Material 3 Expressive APIs (#4934)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 16:42:46 +00:00
renovate[bot]
c259c76550 chore(deps): update codecov/codecov-action action to v6 (#4933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-26 15:26:11 +00:00
James Rich
518096ddc8 build: update Compose Multiplatform and migrate lifecycle dependencies (#4932)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 15:18:45 +00:00
renovate[bot]
4be0fb9c65 chore(deps): update org.jetbrains.androidx.navigation3:navigation3-ui to v1.1.0-beta01 (#4931)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-26 09:08:36 -05:00
renovate[bot]
0d2c2e8a98 chore(deps): update jetbrains.lifecycle to v2.11.0-alpha02 (#4930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-26 13:52:16 +00:00
James Rich
3b485a0109 build: enable -Xjvm-default=all compiler flag (#4929)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 13:16:04 +00:00
renovate[bot]
e1fa05f63f chore(deps): update dokka to v2.2.0 (#4928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-26 08:16:35 -05:00
James Rich
ff6e1813ea chore(github): update GitHub token reference in workflows (#4926) v2.7.14-internal.35 v2.7.14-closed.10 2026-03-25 21:32:14 -05:00
James Rich
da5b28443e ci: change jdk from jetbrains to temurin in non-release workflows (#4925) 2026-03-25 21:24:29 -05:00
James Rich
7484cc69b4 refactor(ui): remove labels from navigation suite items (#4924) 2026-03-25 21:14:17 -05:00
James Rich
36290fc94b build(github): add GITHUB_TOKEN to setup-java actions (#4923) v2.7.14-internal.34 2026-03-25 20:53:18 -05:00
James Rich
6f95435cfc ci: refine workflow permissions and version parsing logic (#4922)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 01:16:22 +00:00
James Rich
a005231d94 Refactor map layer management and navigation infrastructure (#4921)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 00:29:24 +00:00
James Rich
b608a04ca4 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#4912) 2026-03-25 16:37:36 -05:00
renovate[bot]
d62481a532 chore(deps): update actions/deploy-pages action to v5 (#4920)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 16:37:26 -05:00
renovate[bot]
e81e84a544 chore(deps): update androidx (general) (#4919)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 16:36:59 -05:00
renovate[bot]
eabab0b137 chore(deps): update kotlin ecosystem to v0.9.8 (#4917)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 16:36:47 -05:00
renovate[bot]
705f617adb chore(deps): update plugin com.gradle.develocity to v4.4.0 (#4918)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 16:36:31 -05:00
renovate[bot]
c55d25bade chore(deps): update androidx.room3:room3-gradle-plugin to v3.0.0-alpha02 (#4916)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 18:00:14 +00:00
renovate[bot]
f622fae74f chore(deps): update androidx (general) (#4915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-25 17:59:25 +00:00
James Rich
c470b9a366 Revise security policy for supported versions and reporting
Updated the security policy to clarify supported versions and reporting process.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-25 10:18:51 -05:00
James Rich
8ce17defb7 refactor: remove demoscenario and enhance BLE connection stability (#4914)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-25 14:24:42 +00:00
James Rich
6516287c62 refactor: BLE transport and UI for Kotlin Multiplatform unification (#4911)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
v2.7.14-internal.33 v2.7.14-closed.9
2026-03-25 02:15:51 +00:00
James Rich
b0e91a390c feat: implement unified deep link routing for Kotlin Multiplatform (#4910)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-25 00:21:24 +00:00
James Rich
553ca2f8ed feat: implement global SnackbarManager and consolidate common UI setup (#4909)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-24 22:31:40 +00:00
James Rich
9b8ac6a460 build(desktop): enable ProGuard minification and tree-shaking (#4904)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-24 22:22:37 +00:00
James Rich
0c3ab92908 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#4907) 2026-03-24 22:21:59 +00:00
renovate[bot]
3a9f611fc0 chore(deps): update wire to v6.1.0 (#4906)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-24 22:21:46 +00:00
renovate[bot]
cd328b236d chore(deps): update kotest to v6.1.9 (#4908)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-24 22:21:40 +00:00
James Rich
b45bc9be90 chore: Scheduled updates (Firmware, Hardware, Translations, Graphs) (#4905) 2026-03-24 15:49:49 +00:00
renovate[bot]
41c82abc9e chore(deps): update kotest to v6.1.8 (#4902)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-24 14:07:41 +00:00
James Rich
96060a0a4d refactor: coroutine dispatchers and modernize testing infrastructure (#4901)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
v2.7.14-internal.32 v2.7.14-closed.8
2026-03-24 01:31:48 +00:00
James Rich
664ebf218e refactor: null safety, update date/time libraries, and migrate tests (#4900)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-23 23:17:50 +00:00
James Rich
f826cac6c8 refactor(di): specify disk cache directory for ImageLoader (#4899)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-23 21:05:50 +00:00
James Rich
a0b4c56505 feat: optimistically persist local configs and channels (#4898)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-23 19:57:45 +00:00
James Rich
57242d905c refactor: Consolidate UI preference handling (#4895) 2026-03-23 19:36:02 +00:00