some nav cleanup

This commit is contained in:
2026-03-08 19:25:48 -04:00
parent 1618588a30
commit f003377f0d
8 changed files with 69 additions and 38 deletions

View File

@@ -17,7 +17,7 @@ export const { use: useNavigation, provider: NavigationProvider } =
),
);
//conveniences
// unified navigation: left->right, top->bottom across all tabs
const nextTab = () => {
if (activeTab() >= TabsCount) {
setActiveTab(1);
@@ -31,10 +31,19 @@ export const { use: useNavigation, provider: NavigationProvider } =
setActiveTab(TabsCount);
return;
}
setActiveTab(activeTab() - 1);
};
const nextPane = () => {
// move to next pane in same tab, wrap around
setActiveDepth((prev) => (prev % TabsCount) + 1);
};
const prevPane = () => {
// move to previous pane in same tab, wrap around
setActiveDepth((prev) => (prev - 2 + TabsCount) % TabsCount + 1);
};
return {
activeTab,
activeDepth,
@@ -44,6 +53,8 @@ export const { use: useNavigation, provider: NavigationProvider } =
setInputFocused,
nextTab,
prevTab,
nextPane,
prevPane,
};
},
});