Skip to content

refactor: adaptive UI components for Navigation 3#4891

Merged
jamesarich merged 7 commits intomainfrom
feat/kmp-ui-dedupe
Mar 23, 2026
Merged

refactor: adaptive UI components for Navigation 3#4891
jamesarich merged 7 commits intomainfrom
feat/kmp-ui-dedupe

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

This pull request introduces comprehensive support for adaptive layouts across the codebase, focusing on improved multi-pane experiences for large and extra-large screens (such as desktop and external displays). It adopts the stable Navigation 3 Scene-based architecture, updates documentation to reflect these architectural changes, and enhances the code and dependencies to support Material 3 Adaptive features. The main code changes include new adaptive scaffolds, updated usage of adaptive info, and improved breakpoint handling.

Key changes:

Adaptive Layout & Multi-pane Support:

  • Added a new AdaptiveListDetailScaffold composable to core/ui/component, enabling flexible list-detail layouts that adapt to window size and support three-pane navigation for large screens.
  • Updated AdaptiveTwoPane to use currentWindowAdaptiveInfo(supportLargeAndXLargeWidth = true) and improved breakpoint logic for seamless transitions between compact and expanded layouts. [1] [2]
  • Modified MainScreen in app/ui/Main.kt to pass supportLargeAndXLargeWidth = true to currentWindowAdaptiveInfo, ensuring correct navigation suite type selection for large displays.
  • Refactored AdaptiveContactsScreen to use the new adaptive scaffold, simplifying and modernizing the implementation. [1] [2]

Navigation Architecture:

  • Migrated to the stable Navigation 3 Scene-based architecture, enabling robust shared backstack state and multi-pane layouts across platforms. [1] [2] [3] [4] [5]

Material 3 Adaptive Integration:

  • Added dependencies for Material 3 Adaptive and related JetBrains libraries in core/ui/build.gradle.kts to support adaptive layouts and navigation.
  • Updated documentation and status to reflect adoption of Material 3 Adaptive and support for new breakpoints. [1] [2] [3]

Documentation Updates:

  • Enhanced architecture and roadmap docs to highlight adaptive UI, multi-pane desktop experience, and Navigation 3 Scene-based architecture. [1] [2] [3] [4] [5] [6]

Roadmap & Status:

  • Updated roadmap and KMP status docs to include adaptive density/multitasking, Navigation 3 migration, and explicit plans for adopting new window size breakpoints. [1] [2] [3]

These changes collectively modernize the UI architecture, improve cross-platform consistency, and set the foundation for advanced desktop and multitasking experiences.

…ve UI

- Update KMP status and developer guides to reflect the adoption of Navigation 3 Stable Scene-based architecture.
- Integrate Material 3 Adaptive UI guidelines, specifically targeting Large (1200dp) and Extra-large (1600dp) breakpoints for desktop and external displays.
- Mandate the use of `currentWindowAdaptiveInfo(supportLargeAndXLargeWidth = true)` in `AGENTS.md`, `GEMINI.md`, and Copilot instructions to ensure high information density on large screens.
- Refine the project roadmap to include adaptive density optimizations and WindowSizeClass V2 adoption.
- Update `kmp-status.md` to reflect progress in shared UI logic and multi-pane layout support.
… User" scenes

- Update `AGENTS.md`, `GEMINI.md`, and `copilot-instructions.md` to include guidance for investigating 3-pane layouts (e.g., Node List + Detail + Map) on screens ≥ 1200dp.
- Mandate the use of Navigation 3 Scenes and `ThreePaneScaffold` to support high-density interactions for Desktop and Android 16 QPR3 external displays.
- Refine `docs/roadmap.md` to explicitly prioritize 3-pane scene architecture within the Navigation 3 migration.
- Introduce `AdaptiveListDetailScaffold` in `core:ui` to centralize Material 3 adaptive layout logic, including back handling, focus management, and pane transitions.
- Refactor `AdaptiveContactsScreen` and `AdaptiveNodeListScreen` to utilize the new shared component, significantly reducing redundant navigation and scaffold boilerplate.
- Add Material 3 Adaptive (layout and navigation) and `navigationevent-compose` dependencies to the `core:ui` module.
- Standardize adaptive navigation behavior for tab-switching and "scroll to top" events across messaging and node features.
- Migrate `DeviceConfig`, `PositionConfig`, `SecurityConfig`, and `ExternalNotificationConfig` screens from platform-specific modules (`androidMain`, `jvmMain`) to `commonMain`.
- Introduce `expect`/`actual` patterns to handle platform-specific logic, including time zone POSIX string generation, GPS location retrieval, ringtone playback/importing, and security key exporting.
- Add iOS stubs and no-op implementations for the new common configuration screens.
- Update `AdaptiveTwoPane` to use `currentWindowAdaptiveInfo` and standard window size breakpoints instead of hardcoded width checks.
- Refine `Main` navigation to support large and extra-large width adaptive layouts.
- Clean up deleted platform-specific files and update screen references in `SettingsMainScreen`.
- Remove redundant `expect`/`actual` declarations for `DeviceConfigScreen`, `PositionConfigScreen`, `SecurityConfigScreen`, and `ExternalNotificationConfigScreen`.
- Update `commonMain` navigation logic to invoke `*ConfigScreenCommon` components directly.
- Clean up unused platform-specific implementations and stubs in Android, JVM, and iOS modules.
@github-actions github-actions bot added the enhancement New feature or request label Mar 23, 2026
@jamesarich jamesarich merged commit 7b32721 into main Mar 23, 2026
6 checks passed
@jamesarich jamesarich deleted the feat/kmp-ui-dedupe branch March 23, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant