Refactor ui state

Now with more mode!
This commit is contained in:
Joscha 2025-02-12 00:08:45 +01:00
parent 4710f19b1e
commit 2f9b1925dc
3 changed files with 119 additions and 85 deletions

View file

@ -9,9 +9,9 @@ const ui = useUiStore();
window.addEventListener("keypress", (ev) => {
if (document.activeElement !== document.body) return;
if (ev.key === "Escape") {
if (ev.key === "Escape" && ui.mode === "focus") {
const parent = ui.focusPath.parent();
if (parent) ui.focusPath = parent;
if (parent) ui.focusOn(parent);
return;
}
});