commit deb7ab1ddf1f423b9149128294315a12efac3e18
parent 62dd9309c87240c1cd750586b63753b28d3e3bcc
Author: Damian Myrda <damian@prime8.dev>
Date: Thu, 29 Jan 2026 14:35:57 -0600
fix: disable left arrow on first tab and right arrow on last tab
Diffstat:
2 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/web/src/tabs/about.ts b/web/src/tabs/about.ts
@@ -1,22 +1,3 @@
-import { onKey, type KeybindHandle } from "../ui/keyboard";
-import { registerTab, cycleTab } from "../ui/tabs";
+import { registerTab } from "../ui/tabs";
-let keybinds: KeybindHandle[] = [];
-
-registerTab("about", {
- activate: () => {
- keybinds = [
- onKey("ArrowLeft", (e) => {
- e.preventDefault();
- cycleTab("prev");
- }),
- onKey("ArrowRight", (e) => {
- e.preventDefault();
- cycleTab("next");
- }),
- ];
- },
- deactivate: () => {
- keybinds.forEach((handle) => handle.unsubscribe());
- },
-});
+registerTab("about", {});
diff --git a/web/src/ui/tabs.ts b/web/src/ui/tabs.ts
@@ -149,10 +149,12 @@ function setupDefaultKeybinds(): void {
}
onKey("ArrowLeft", (e) => {
+ if (currentIndex === 0) return;
e.preventDefault();
cycleTab("prev");
});
onKey("ArrowRight", (e) => {
+ if (currentIndex === order.length - 1) return;
e.preventDefault();
cycleTab("next");
});