diff --git a/package.json b/package.json index d16ba80..d544f82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bookshell", - "version": "1.0.5", + "version": "1.0.9", "description": "BOOKSHELL — SSH terminal for AI agents (Phase 0 prototype)", "type": "module", "scripts": { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index a67132b..493dddf 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "BOOKSHELL", - "version": "1.0.6", + "version": "1.0.9", "identifier": "dev.bookshell.app", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/App.tsx b/src/App.tsx index f304551..43e74d8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -17,6 +17,7 @@ import { api, type Connection } from "./ipc/api"; import { loadConnections } from "./stores/connections"; import { loadGeneral } from "./stores/general"; import { closeSearch, openSearch, searchTabId } from "./stores/search"; +import { actionFor } from "./stores/shortcuts"; import { C } from "./theme"; import { activeTab, @@ -31,6 +32,7 @@ import { markCwdTabId, newTabId, reconnectTabFromProfile, + reorderTabs, restoreTabs, setActiveTab, tabs, @@ -123,23 +125,18 @@ export default function App() { window.addEventListener("beforeunload", () => flushPersistedState()); - // Shift+ArrowUp/Down and Ctrl+PageUp/PageDown: cycle tabs. Registered in - // the capture phase so it fires before xterm's textarea handler — - // otherwise xterm swallows the event (translates it to a PTY escape - // sequence) and the tab bar only responds after the user clicks the - // sidebar to move focus. Skipped when focus is in a real text input / + // Tab cycle / move shortcuts (user-customizable; see stores/shortcuts.ts). + // Registered in the capture phase so it fires before xterm's textarea + // handler — otherwise xterm swallows the event (translates it to a PTY + // escape sequence) and the tab bar only responds after the user clicks + // the sidebar to move focus. Skipped when focus is in a real text input / // passthrough mode so the key can still extend selection / be forwarded // to the remote agent. window.addEventListener( "keydown", (e) => { - const shiftCombo = - e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey && - (e.key === "ArrowUp" || e.key === "ArrowDown"); - const ctrlCombo = - e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey && - (e.key === "PageUp" || e.key === "PageDown"); - if (!shiftCombo && !ctrlCombo) return; + const action = actionFor(e); + if (!action) return; if (isActiveTabPassthrough()) return; // xterm's own input is a hidden