@kolkrabbi/kol-shell 0.105.0 → 0.106.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-shell",
3
- "version": "0.105.0",
3
+ "version": "0.106.0",
4
4
  "private": false,
5
5
  "description": "The application shell",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "./src/*": "./src/*"
13
13
  },
14
14
  "peerDependencies": {
15
- "@kolkrabbi/kol-component": ">=0.339.0",
15
+ "@kolkrabbi/kol-component": ">=0.340.0",
16
16
  "@kolkrabbi/kol-framework": ">=0.55.0",
17
17
  "@kolkrabbi/kol-icons": ">=0.16.0",
18
18
  "@kolkrabbi/kol-theme": ">=0.211.1",
@@ -21,9 +21,9 @@
21
21
  "react-dom": "^18.3.0 || ^19.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@kolkrabbi/kol-component": "^0.339.0",
25
- "@kolkrabbi/kol-framework": "^0.70.0",
24
+ "@kolkrabbi/kol-component": "^0.340.0",
26
25
  "@kolkrabbi/kol-icons": "^0.64.0",
26
+ "@kolkrabbi/kol-framework": "^0.70.0",
27
27
  "@kolkrabbi/kol-theme": "^0.211.1"
28
28
  },
29
29
  "files": [
package/src/AppShell.jsx CHANGED
@@ -347,10 +347,16 @@ export default function AppShell({
347
347
  }, [pageWash])
348
348
  /* the rail keys — `\` expand ↔ collapse (the app rail's own grab toggle, through `railToggle`), `⇧\` hide ↔ show */
349
349
  const railToggle = useRef(null)
350
+ /* the rail's state when it hid — showing returns it open or collapsed, as it was (FloatLayout's `lastShown`) */
351
+ const wasOpen = useRef(false)
350
352
  useRailKeys(railKeys ?? (railToggleKey ? { hide: railToggleKey } : undefined), {
351
353
  onCollapse: () => { if (!navHidden) railToggle.current?.() },
352
- onHide: () => setNavHidden((h) => !h),
354
+ onHide: () => { if (!navHidden) wasOpen.current = !!railToggle.current?.open; setNavHidden(!navHidden) },
353
355
  })
356
+ /* runs after the remounted rail's own effect (children first), so the snap lands on the live rail */
357
+ useEffect(() => {
358
+ if (!navHidden && wasOpen.current) railToggle.current?.snap?.(true)
359
+ }, [navHidden])
354
360
 
355
361
  /* Option+digit → the rail ROW in that position (never while typing).
356
362
  *
@@ -1,5 +1,5 @@
1
1
  import { useRef, useState } from 'react'
2
- import { NavRail, useMediaQuery, useRailKeys } from '@kolkrabbi/kol-component'
2
+ import { NavRail, CommandOverlay, useMediaQuery, useRailKeys } from '@kolkrabbi/kol-component'
3
3
  import TopControlsBar from './TopControlsBar.jsx'
4
4
  import RailTrigger from './RailTrigger.jsx'
5
5
  import RailFlyout from './RailFlyout.jsx'
@@ -42,6 +42,10 @@ import RailDisplayControls from './RailDisplayControls.jsx'
42
42
  * @param {string} [inspectorLabel] its name in Panels ▾ (default "Inspector")
43
43
  * @param {boolean} [inspectorHidden] controlled; `defaultInspectorHidden` uncontrolled · {Function} [onInspectorHiddenChange]
44
44
  * @param {'solid'|'glass-dark'|'glass-light'} [surface] what the floats are made of (default `solid`)
45
+ * @param {boolean} [panels=true] Panels ⌄ (PanelsRestore) in the bar while a Rail is hidden; `false` drops it — the way back is
46
+ * RailTrigger's "Show navigation" row and `⇧\` (FloatSearchAndPanels, 2026-11-04)
47
+ * @param {Object} [search] CommandOverlay's props (`open` · `onClose` · `results` · `query` · `onQueryChange` · `onSelect` …):
48
+ * the search modal, drawn on this frame's `surface`; the app keeps the data
45
49
  * @param {ReactNode} children the content
46
50
  * @param {string} [className]
47
51
  */
@@ -49,7 +53,7 @@ export default function FloatLayout({
49
53
  nav = [], currentPath = '', onNavigate, title, icon, onSwitch, onSearch,
50
54
  rail, defaultRail = 'expanded', onRailChange, railKeys, railMode = 'push', defaultExpanded, railFooter, breadcrumb,
51
55
  bar = {}, eyebrow, inspector, bottom, inspectorLabel = 'Inspector', inspectorHidden, defaultInspectorHidden = false, onInspectorHiddenChange,
52
- surface = 'solid', children, className = '',
56
+ surface = 'solid', panels = true, search, children, className = '',
53
57
  }) {
54
58
  const [ownRail, setOwnRail] = useState(defaultRail)
55
59
  const [ownHidden, setOwnHidden] = useState(defaultInspectorHidden)
@@ -110,7 +114,7 @@ export default function FloatLayout({
110
114
  {shown === 'hidden' && <RailTrigger items={nav} currentPath={currentPath} onNavigate={onNavigate} title={title} breadcrumb={phone ? undefined : breadcrumb} surface={surface}
111
115
  onRestore={phone ? undefined : () => setRail(lastShown.current)}
112
116
  className={overlay && !phone ? 'absolute inset-y-0 left-0 z-[var(--kol-z-sticky)]' : 'shrink-0'} />}
113
- <TopControlsBar {...bar} panels={restore.length ? { items: restore } : undefined} surface={surface}
117
+ <TopControlsBar {...bar} panels={panels && restore.length ? { items: restore } : undefined} surface={surface}
114
118
  className={`min-w-0 flex-1 max-md:overflow-x-auto max-md:[scrollbar-width:none] ${bar.className ?? ''}`.trim()} />
115
119
  </div>
116
120
  {eyebrow && <div className="kol-float-layout-eyebrow absolute inset-x-0 top-full pt-[25px] max-md:static max-md:pt-6">{eyebrow}</div>}
@@ -123,6 +127,7 @@ export default function FloatLayout({
123
127
  {bottom && <div className="kol-float-layout-bottom min-w-0 shrink-0">{bottom}</div>}
124
128
  </div>
125
129
  </div>
130
+ {search && <CommandOverlay {...search} surface={surface} />}
126
131
  </div>
127
132
  )
128
133
  }