@kolkrabbi/kol-shell 0.22.0 → 0.23.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 +1 -1
- package/src/SettingsScaffold.jsx +21 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
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",
|
package/src/SettingsScaffold.jsx
CHANGED
|
@@ -42,7 +42,7 @@ import PageHeader from './PageHeader.jsx'
|
|
|
42
42
|
* (settings + overlay) and both pairs drifted. Feed ONE array to both your
|
|
43
43
|
* `ShortcutsOverlay` and `SettingsShortcuts`.
|
|
44
44
|
*
|
|
45
|
-
* @param {Array} props.tabs `[{ value, label, title, subtitle }]` — title/subtitle feed the masthead, label the strip
|
|
45
|
+
* @param {Array} props.tabs `[{ value, label, title, subtitle, row }]` — title/subtitle feed the masthead, label the strip. `row: 'layout'` puts an entry on the SECOND row (fxr's ABOUT / REPO); default is the view strip
|
|
46
46
|
* @param {string} props.defaultTab
|
|
47
47
|
* @param {Function} props.renderContent `(tabValue, filteredItems) => node` — the scrolling body
|
|
48
48
|
* @param {Object} props.header PageHeader props spread onto the masthead (`voice`, `size`, `titleClass`, `eyebrow`, `actions`)
|
|
@@ -70,6 +70,19 @@ export default function SettingsScaffold({
|
|
|
70
70
|
const [tab, setTab] = useState(defaultTab ?? tabs[0]?.value)
|
|
71
71
|
const active = tabs.find((t) => t.value === tab)
|
|
72
72
|
|
|
73
|
+
/* ONE PAGE SELECTOR DRAWN ACROSS TWO ROWS (SettingsScaffoldTabRows, kol-fxr
|
|
74
|
+
* 2026-08-30). fxr's SETTINGS above the rule and ABOUT / REPO below it are not
|
|
75
|
+
* two selectors — they are one set of destinations, split because the user
|
|
76
|
+
* ruled the side pages down to the smaller row. `row: 'layout'` says which.
|
|
77
|
+
*
|
|
78
|
+
* Both strips read and write the SAME `tab`, which is the whole point: before
|
|
79
|
+
* this, a page wanting both rows had to hand ContentFilters its own state
|
|
80
|
+
* through `filtersProps` and the scaffold's `tab` went dead — so
|
|
81
|
+
* `renderContent`'s first argument was a lie, and the masthead only got the
|
|
82
|
+
* right title because `header` happens to spread after it. */
|
|
83
|
+
const viewTabs = tabs.filter((t) => t.row !== 'layout')
|
|
84
|
+
const layoutTabs = tabs.filter((t) => t.row === 'layout')
|
|
85
|
+
|
|
73
86
|
return (
|
|
74
87
|
<PageShell mode="fixed">
|
|
75
88
|
{/* `header` is spread onto the PageHeader (PageHeaderMonoTitle addendum,
|
|
@@ -88,9 +101,15 @@ export default function SettingsScaffold({
|
|
|
88
101
|
/* THE TABS ARE THE VIEW STRIP — the same row fxr's SETTINGS and the home
|
|
89
102
|
* page's RECENT / SAVED run on, not a strip of our own. That is the
|
|
90
103
|
* whole point: one row grammar, not a settings dialect of it. */
|
|
91
|
-
viewModeOptions={
|
|
104
|
+
viewModeOptions={viewTabs.length ? viewTabs : undefined}
|
|
92
105
|
viewMode={tab}
|
|
93
106
|
onViewModeChange={setTab}
|
|
107
|
+
/* a strip whose options do not contain the active tab simply shows
|
|
108
|
+
* nothing lit — which is correct: on ABOUT, the SETTINGS strip has no
|
|
109
|
+
* selection to draw. */
|
|
110
|
+
layoutOptions={layoutTabs.length ? layoutTabs : undefined}
|
|
111
|
+
layout={tab}
|
|
112
|
+
onLayoutChange={setTab}
|
|
94
113
|
renderItem={(filtered) => (
|
|
95
114
|
<div style={{ flex: 1, overflow: 'auto', paddingTop: 4, paddingBottom: 4 }}>
|
|
96
115
|
{renderContent?.(tab, filtered)}
|