feat: Material You design system rewrite — Phases 1–4
Complete UI/UX rewrite of hermes-mobile with Material You design system. Phase 1: Color/Theme/Type/Shapes/Spacing/Motion tokens Phase 2: HermesScaffold, StateViews (skeleton/empty/error), SearchBar, StatusBadge, ToggleRow Phase 3: Bottom nav + drawer navigation with NavigationController Phase 4: All 17 screens rewritten with HermesScaffold and Material You patterns Closes PR #3.
This commit is contained in:
29 files changed
+2669
-2377
No files matched your search
@@ -3,14 +3,35 @@ package com.m57.hermescontrol
|
||||
import androidx.navigation3.runtime.NavBackStack
|
||||
import androidx.navigation3.runtime.NavKey
|
||||
|
||||
/**
|
||||
* Central navigation controller with deduplication guard.
|
||||
*
|
||||
* Primary screens (bottom nav tabs) clear the back stack and become the new
|
||||
* root — this matches Material's bottom-nav pattern where each tab has its own
|
||||
* back stack history (simplified: we just clear).
|
||||
*
|
||||
* B7 (Jun 18 2026): Never call `backStack.add()` directly from UI callbacks.
|
||||
* Always route through [navigateTo] to prevent stacking duplicate screen
|
||||
* entries that compete for touch events.
|
||||
*/
|
||||
object NavigationController {
|
||||
var backStack: NavBackStack<NavKey>? = null
|
||||
|
||||
// Bottom-nav primary screens — tapping one clears the stack to root.
|
||||
private val primaryScreens: Set<NavKey> =
|
||||
setOf(
|
||||
ChatScreen,
|
||||
SkillsScreen,
|
||||
CronJobsScreen,
|
||||
SystemScreen,
|
||||
SettingsScreen,
|
||||
)
|
||||
|
||||
fun navigateTo(key: NavKey) {
|
||||
val stack = backStack ?: return
|
||||
if (stack.lastOrNull() == key) return
|
||||
|
||||
if (key == ChatScreen || key == SkillsScreen || key == CronJobsScreen) {
|
||||
if (key in primaryScreens) {
|
||||
stack.clear()
|
||||
}
|
||||
stack.add(key)
|
||||
|
||||
Reference in new issue
Block a user