@kolkrabbi/kol-shell 0.70.0 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/AppHub.jsx +22 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-shell",
3
- "version": "0.70.0",
3
+ "version": "0.71.0",
4
4
  "private": false,
5
5
  "description": "The application shell",
6
6
  "license": "MIT",
@@ -20,10 +20,10 @@
20
20
  "react-dom": "^18.3.0 || ^19.0.0"
21
21
  },
22
22
  "devDependencies": {
23
+ "@kolkrabbi/kol-component": "^0.275.0",
23
24
  "@kolkrabbi/kol-icons": "^0.39.0",
24
- "@kolkrabbi/kol-framework": "^0.51.0",
25
25
  "@kolkrabbi/kol-theme": "^0.176.0",
26
- "@kolkrabbi/kol-component": "^0.274.0"
26
+ "@kolkrabbi/kol-framework": "^0.51.0"
27
27
  },
28
28
  "files": [
29
29
  "src",
package/src/AppHub.jsx CHANGED
@@ -3,7 +3,7 @@ import AppShell from './AppShell.jsx'
3
3
  import HubHome from './HubHome.jsx'
4
4
  import HubSettings from './HubSettings.jsx'
5
5
  import HubDev from './HubDev.jsx'
6
- import { CommandOverlay } from '@kolkrabbi/kol-component'
6
+ import { CommandOverlay, ShortcutsOverlay } from '@kolkrabbi/kol-component'
7
7
 
8
8
  /* taxonomy-ok: organism — nests AppShell / HubHome / HubSettings / HubDev (relative) + kol-component's CommandOverlay */
9
9
 
@@ -23,7 +23,7 @@ import { CommandOverlay } from '@kolkrabbi/kol-component'
23
23
  * Router-agnostic like AppShell: pass `currentPath` + `onNavigate`, and your router's element
24
24
  * (`<Outlet/>`) as children.
25
25
  *
26
- * KEYS: `,` toggles Settings · `S` toggles the shortcuts sheet · `\` hides the rail ·
26
+ * KEYS: `,` toggles Settings · `S` toggles the shortcuts sheet · `⇧S` the shortcuts rail · `\` hides the rail ·
27
27
  * ⌥1…9 walks the rail top to bottom, mark first, Settings last. None fire while typing.
28
28
  *
29
29
  * @param {Object} app `{ name, subtitle, logomark (svg url), about (node), links [{label,url}] }`
@@ -44,6 +44,8 @@ import { CommandOverlay } from '@kolkrabbi/kol-component'
44
44
  * @param {Array} shortcuts `[{ section, items: [{ id, label, combo }] }]` — the sheet AND Settings
45
45
  * @param {ReactNode} themeToggle Settings' masthead toggle (a node — kol-framework is not a peer)
46
46
  * @param {string} shortcutsKey default `s`; `null` turns the sheet key off (a tool that owns S)
47
+ * @param {string} shortcutsRailKey default `S` (⇧S) — the same keymap in the right rail (`ShortcutsOverlay variant="rail"`),
48
+ * this page's sections; `null` turns it off. The rail was hand-built in kol-monitor (2026-10-18)
47
49
  * @param {'display'|'mono'} masthead the app's one masthead (AppShell's) — set, Home and Settings follow it; unset
48
50
  * (the default), they keep the Hub's mono title (2026-09-29)
49
51
  * @param {Object} shell any AppShell prop, spread last (`touch`, `pageWash`, `drawerOpenOn`, `railComponent`, …)
@@ -65,11 +67,27 @@ export default function AppHub({
65
67
  settingsPath = '/settings',
66
68
  homePath = '/',
67
69
  shortcutsKey = 's',
70
+ shortcutsRailKey = 'S',
68
71
  masthead,
69
72
  shell,
70
73
  children,
71
74
  }) {
72
75
  const [sheet, setSheet] = useState(false)
76
+ const [rail, setRail] = useState(false)
77
+
78
+ /* ⇧S — the keymap in the rail. Its own listener: the `S` listener ignores Shift, so the two never both fire */
79
+ useEffect(() => {
80
+ if (!shortcutsRailKey) return undefined
81
+ const onKey = (e) => {
82
+ if (e.key !== shortcutsRailKey || !e.shiftKey || e.metaKey || e.ctrlKey || e.altKey || e.repeat) return
83
+ const t = e.target
84
+ if (t?.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t?.tagName)) return
85
+ e.preventDefault()
86
+ setRail((v) => !v)
87
+ }
88
+ window.addEventListener('keydown', onKey)
89
+ return () => window.removeEventListener('keydown', onKey)
90
+ }, [shortcutsRailKey])
73
91
 
74
92
  useEffect(() => {
75
93
  if (!shortcutsKey) return undefined
@@ -127,8 +145,9 @@ export default function AppHub({
127
145
  {page}
128
146
  {/* THE SHEET IS THE ⌘K MODAL WITH NO FIELD (ShortcutsOverlayCategories, kol-monitor 2026-10-18 — user: *"I said
129
147
  * no search, I didnt say DONT USE THE FUCKIN MODAL OVERLAY"*): this page's sections as categories under
130
- * "Shortcuts", each drilling in to its keys; `S` toggles, Esc closes, ⇧S is ignored. Reverses 0.68.0's swap. */}
148
+ * "Shortcuts", each drilling in to its keys; `S` toggles, Esc closes; ⇧S is the rail's. Reverses 0.68.0's swap. */}
131
149
  <CommandOverlay open={sheet} mode="shortcuts" shortcuts={shortcuts} currentPath={currentPath} onClose={() => setSheet(false)} />
150
+ {rail && <ShortcutsOverlay variant="rail" shortcuts={shortcuts} currentPath={currentPath} onClose={() => setRail(false)} />}
132
151
  </AppShell>
133
152
  )
134
153
  }