moving the state from general to each page owning its own state of button or canvas focus

This commit is contained in:
Priec
2025-09-04 17:36:13 +02:00
parent 6891631b8d
commit d9d8562539
24 changed files with 286 additions and 168 deletions

View File

@@ -40,14 +40,11 @@ impl ModeManager {
// If focus is inside a canvas, we don't duplicate canvas modes here.
// Canvas crate owns ReadOnly/Edit/Highlight internally.
match &router.current {
Page::Form(_)
| Page::Login(_)
| Page::Register(_)
| Page::AddTable(_)
| Page::AddLogic(_) if !app_state.ui.focus_outside_canvas => {
// Canvas active → let canvas handle its own AppMode
AppMode::General
}
Page::Form(_) => AppMode::General, // Form always has its own canvas
Page::Login(state) if !state.focus_outside_canvas => AppMode::General,
Page::Register(state) if !state.focus_outside_canvas => AppMode::General,
Page::AddTable(state) if !state.focus_outside_canvas => AppMode::General,
Page::AddLogic(state) if !state.focus_outside_canvas => AppMode::General,
_ => AppMode::General,
}
}