@kolkrabbi/kol-shell 0.18.0 → 0.19.1
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 +3 -3
- package/src/AppShell.jsx +22 -6
- package/src/PageHeader.jsx +19 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "KOL application shell — fixed 48px NavRail + AppShell layout root, PageShell/PageHeader scaffolds, ContentFilters catalog organism, GridCard, SettingsScaffold, WalkthroughPanel, ShortcutsOverlay. App chrome (kol-framework owns site chrome). Nav items, content, shortcuts and settings are consumer-injected. Sits above @kolkrabbi/kol-{theme,component,framework}.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@kolkrabbi/kol-component": "^0.128.0",
|
|
24
24
|
"@kolkrabbi/kol-framework": "^0.35.0",
|
|
25
|
-
"@kolkrabbi/kol-icons": "^0.
|
|
26
|
-
"@kolkrabbi/kol-theme": "^0.
|
|
25
|
+
"@kolkrabbi/kol-icons": "^0.25.0",
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.94.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
package/src/AppShell.jsx
CHANGED
|
@@ -45,7 +45,9 @@ import TouchDeviceOverlay, { useTouchPrimary } from './TouchDeviceOverlay.jsx'
|
|
|
45
45
|
* localStorage `kol-desktop` is '1' (fxr's gate); `overlay` keeps the shell and
|
|
46
46
|
* mounts TouchDeviceOverlay once (monitor's)
|
|
47
47
|
* @param {string} props.appName TouchDeviceOverlay's subject
|
|
48
|
-
* @param {boolean} props.navKeys Option+1…9 navigates to
|
|
48
|
+
* @param {boolean} props.navKeys Option+1…9 navigates to the rail's nth ROW through `onNavigate` — with a
|
|
49
|
+
* `logomark` that is the mark ('/') then the items, which is the order on
|
|
50
|
+
* screen (AppShellNavKeysHomeFirst, 2026-08-28); without one, `items[n-1]`. The
|
|
49
51
|
* rail-order counterpart of `railToggleKey` (AppShellNavKeys, kol-monitor
|
|
50
52
|
* 2026-08-28 — user: "make command or alt 1234 go from home 1 2 3 4 in the
|
|
51
53
|
* sidenav without clicking"). Option, not Command: ⌘1–9 is the browser's
|
|
@@ -95,7 +97,21 @@ export default function AppShell({
|
|
|
95
97
|
return () => window.removeEventListener('keydown', onKey)
|
|
96
98
|
}, [railToggleKey])
|
|
97
99
|
|
|
98
|
-
/* Option+digit → the rail
|
|
100
|
+
/* Option+digit → the rail ROW in that position (never while typing).
|
|
101
|
+
*
|
|
102
|
+
* THE MARK IS ROW 1 (AppShellNavKeysHomeFirst, kol-monitor 2026-08-28 — user:
|
|
103
|
+
* "alt 1 skips home and goes straight to 2"). 0.12.0 navigated to
|
|
104
|
+
* `items[n - 1]`, but the rail's first row is the LOGOMARK, which `NavRail`
|
|
105
|
+
* renders above the items and wires to '/'. So ⌥1 landed on the second rung
|
|
106
|
+
* and every key after it was off by one, with Home having no key at all —
|
|
107
|
+
* against the sentence that asked for the feature, quoted in the prop's own
|
|
108
|
+
* docblock above: "make command or alt 1234 go from HOME 1 2 3 4". Home was
|
|
109
|
+
* position 1 in the ask; the implementation counted a list it was never in.
|
|
110
|
+
*
|
|
111
|
+
* With a `logomark`, the order is the order you see: the mark, then the items.
|
|
112
|
+
* Without one, `items[n - 1]` exactly as before, so an app that renders no
|
|
113
|
+
* mark is untouched. */
|
|
114
|
+
const navPaths = (logomark ? ['/'] : []).concat((items ?? []).map((i) => i?.path)).filter(Boolean)
|
|
99
115
|
useEffect(() => {
|
|
100
116
|
if (!navKeys) return undefined
|
|
101
117
|
const onKey = (e) => {
|
|
@@ -103,14 +119,14 @@ export default function AppShell({
|
|
|
103
119
|
if (!m || !e.altKey || e.metaKey || e.ctrlKey) return
|
|
104
120
|
const t = e.target
|
|
105
121
|
if (t?.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t?.tagName)) return
|
|
106
|
-
const
|
|
107
|
-
if (!
|
|
122
|
+
const path = navPaths[Number(m[1]) - 1]
|
|
123
|
+
if (!path) return
|
|
108
124
|
e.preventDefault()
|
|
109
|
-
onNavigate?.(
|
|
125
|
+
onNavigate?.(path)
|
|
110
126
|
}
|
|
111
127
|
window.addEventListener('keydown', onKey)
|
|
112
128
|
return () => window.removeEventListener('keydown', onKey)
|
|
113
|
-
}, [navKeys,
|
|
129
|
+
}, [navKeys, navPaths.join('\u0000'), onNavigate]) // eslint-disable-line react-hooks/exhaustive-deps
|
|
114
130
|
|
|
115
131
|
let wantsDesktop = false
|
|
116
132
|
try { wantsDesktop = typeof localStorage !== 'undefined' && localStorage.getItem('kol-desktop') === '1' } catch { /* storage blocked */ }
|
package/src/PageHeader.jsx
CHANGED
|
@@ -49,10 +49,25 @@ export default function PageHeader({ eyebrow, title, subtitle, actions, subtitle
|
|
|
49
49
|
const roles = TITLE[voice] ?? TITLE.sans
|
|
50
50
|
const h1 = <h1 className={`text-fg-96 ${titleClass ?? roles[size] ?? roles.md}`}>{title}</h1>
|
|
51
51
|
const lede = subtitle && <p className="text-oq-64 kol-mono-14 min-w-0" style={{ marginTop: actions ? undefined : 12, maxWidth: subtitleMaxWidth }}>{subtitle}</p>
|
|
52
|
-
/*
|
|
53
|
-
exposes a flex item's FIRST baseline, so putting them in one row is the
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
/* The cluster shares a baseline row with the lede (or the title): flexbox
|
|
53
|
+
exposes a flex item's FIRST baseline, so putting them in one row is the one
|
|
54
|
+
way to land on the subtitle's line rather than the h1's.
|
|
55
|
+
|
|
56
|
+
AND IT CONTRIBUTES NO HEIGHT (PageHeaderActionsGrowsBlock, kol-fxr
|
|
57
|
+
2026-08-28). A flex row takes its tallest child, so a cluster of `sm`
|
|
58
|
+
controls (28px since kol-theme 0.90.0) against a one-line `kol-mono-14`
|
|
59
|
+
lede (18px) made the masthead 10px taller — measured, monitor's `/` at 65.2
|
|
60
|
+
against fxr's `/settings` at 75.2 with identical titles. The masthead is the
|
|
61
|
+
one block every page of an app shares, so a page with a control cluster sat
|
|
62
|
+
10px lower than every page without one, with no way to opt out.
|
|
63
|
+
|
|
64
|
+
`h-0` + `self-center` is the fix and it is not a magic number: a zero-height
|
|
65
|
+
box centred on the row makes the children overflow it symmetrically, so the
|
|
66
|
+
row's height is the TEXT's and the cluster is free at any rung (the gap is
|
|
67
|
+
10px at `sm`, 14 at `md` — a constant would have been wrong). Horizontal
|
|
68
|
+
layout is untouched: the box still takes its width, so `justify-between`
|
|
69
|
+
holds and a long lede cannot run under the controls. */
|
|
70
|
+
const cluster = actions && <div className="flex items-center gap-4 shrink-0 h-0 self-center">{actions}</div>
|
|
56
71
|
return (
|
|
57
72
|
/* the block owns its own rhythm — margins inline, never in a shared type
|
|
58
73
|
class, which leaks estate-wide (ShellHeaderFilterRefinements, 2026-08-15) */
|