From d88ca9698b7b398610f6fafed3919f4341aad7d2 Mon Sep 17 00:00:00 2001 From: vecnode Date: Fri, 27 Nov 2026 22:24:31 +0000 Subject: [PATCH] tabs: read the pane's tab info from hooks.tabInfo as well as useTabInfo The 0.2.2 pane seat declares its inject as hooks: { tabInfo }, so a body is handed the hook under `hooks`; the pack's bodies only knew the 0.2.0 `props.useTabInfo` prop and therefore rendered their no-tab state for every image, video, PDF, audio file, diagram, editor and History tab. One `tabInfoHookOf(props)` per body accepts either shape and yields null when neither is present, so the old path is unchanged. Versions bumped for the seven packages; check-client-bundles asserts that the hooks shape reaches the same opening state as the prop did. --- .dsh-version.json | 14 +++++++------- packages/dsh-audio/lib/client.js | 22 ++++++++++++++++++---- packages/dsh-audio/package.json | 2 +- packages/dsh-diagrams/lib/client.js | 22 ++++++++++++++++++---- packages/dsh-diagrams/package.json | 2 +- packages/dsh-editor/lib/client.js | 21 ++++++++++++++++++--- packages/dsh-editor/package.json | 2 +- packages/dsh-gittree/lib/client.js | 18 ++++++++++++++++-- packages/dsh-gittree/package.json | 2 +- packages/dsh-image/lib/client.js | 22 ++++++++++++++++++---- packages/dsh-image/package.json | 2 +- packages/dsh-pdf/lib/client.js | 22 ++++++++++++++++++---- packages/dsh-pdf/package.json | 2 +- packages/dsh-video/lib/client.js | 22 ++++++++++++++++++---- packages/dsh-video/package.json | 2 +- scripts/checks/check-client-bundles.mjs | 12 +++++++++++- 16 files changed, 149 insertions(+), 40 deletions(-) diff --git a/.dsh-version.json b/.dsh-version.json index 6216aaf..3a79e2e 100644 --- a/.dsh-version.json +++ b/.dsh-version.json @@ -42,7 +42,7 @@ ] }, "dsh-editor": { - "version": "0.1.0-alpha.14", + "version": "0.1.0-alpha.15", "rows": [ "editor" ], @@ -63,7 +63,7 @@ ] }, "dsh-gittree": { - "version": "0.1.0-alpha.5", + "version": "0.1.0-alpha.6", "rows": [ "gittree" ], @@ -75,7 +75,7 @@ ] }, "dsh-image": { - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "rows": [ "image" ], @@ -107,7 +107,7 @@ ] }, "dsh-audio": { - "version": "0.1.0-alpha.8", + "version": "0.1.0-alpha.9", "rows": [ "audio" ], @@ -213,7 +213,7 @@ ] }, "dsh-video": { - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "rows": [ "video" ], @@ -258,7 +258,7 @@ "role": "Browser: the pack's own web surface, which fetches and renders a page on the HOST in a disposable sandboxed engine behind an egress gate instead of framing it remotely - three tools and three routes. Currently disabled by dsh-vn-master's `browser` row; re-enabling it is deleting those two lines. See packages/dsh-browser/README.md." }, "dsh-diagrams": { - "version": "0.1.0-alpha.8", + "version": "0.1.0-alpha.9", "rows": [ "diagrams" ], @@ -296,7 +296,7 @@ ] }, "dsh-pdf": { - "version": "0.1.0-alpha.9", + "version": "0.1.0-alpha.10", "rows": [ "pdf" ], diff --git a/packages/dsh-audio/lib/client.js b/packages/dsh-audio/lib/client.js index 509936d..ecf21a3 100644 --- a/packages/dsh-audio/lib/client.js +++ b/packages/dsh-audio/lib/client.js @@ -95,7 +95,7 @@ window.__ModuleLoader__.load({ /** The tab kind this package owns. */ const KIND = 'audio' /** Version marker shown in the toolbar, so a loaded bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.8' + const PLUGIN_VERSION = '0.1.0-alpha.9' /** Address grammar owned by @deepseek-ai/dsh-util-workspace-path. */ const FILE_PREFIX = 'dsh-resource://file/' const SESSION_SEGMENT = 'session/' @@ -1799,10 +1799,24 @@ window.__ModuleLoader__.load({ // 10. Small React helpers // ===================================================================== /** The tab information a pane body was handed, or null when it has none. */ - function tabInfoNow(props) { - if (!props || typeof props.useTabInfo !== 'function') return null + /** + * The pane seat's tab-info hook, whichever shape it arrived in: `useTabInfo` + * (the prop the 0.2.0 seat handed a body) or `hooks.tabInfo` (the hook the + * 0.2.1+ seat declares in its inject). A seat that gives neither yields null, + * which every body already treats as "this pane has no tab". + */ +function tabInfoHookOf(props) { + if (!props) return null + if (typeof props.useTabInfo === 'function') return props.useTabInfo + if (props.hooks && typeof props.hooks.tabInfo === 'function') return props.hooks.tabInfo + return null +} + +function tabInfoNow(props) { + const useTabInfo = tabInfoHookOf(props) + if (useTabInfo === null) return null try { - const info = props.useTabInfo() + const info = useTabInfo() return info && info.tab ? info : null } catch (err) { return null diff --git a/packages/dsh-audio/package.json b/packages/dsh-audio/package.json index 8a5f95c..15438a4 100644 --- a/packages/dsh-audio/package.json +++ b/packages/dsh-audio/package.json @@ -1,6 +1,6 @@ { "name": "dsh-audio", - "version": "0.1.0-alpha.8", + "version": "0.1.0-alpha.9", "description": "Audio: WAV/AIFF/FLAC as a waveform (one row per channel, adaptive ruler, RMS core, sample-level zoom, selection, audio-clock playback) plus the MEDIA panel in the left column - a bounded scan of every audio, image, video and GIF file the conversation can reach, with an inline preview and a one-click hand-off to the tab that owns the type. Client-only, read in 2 MiB windows, about files only: no microphone, no device enumeration, no output routing.", "type": "module", "main": "lib/index.js", diff --git a/packages/dsh-diagrams/lib/client.js b/packages/dsh-diagrams/lib/client.js index c9e369d..4e7874d 100644 --- a/packages/dsh-diagrams/lib/client.js +++ b/packages/dsh-diagrams/lib/client.js @@ -96,7 +96,7 @@ window.__ModuleLoader__.load({ const EXAMPLE_ROUTE = '/api/dsh-diagrams/example' const DOCUMENT_ROUTE = '/api/dsh-diagrams/document' /** Version marker shown in the panel footer, so a fresh bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.8' + const PLUGIN_VERSION = '0.1.0-alpha.9' /** * The zoom ladder the diagram tab steps through, the share of the pane a * picture occupies at 100%, and the last zoom each tab was left at. @@ -294,10 +294,24 @@ window.__ModuleLoader__.load({ * none. `useTabInfo` throws while its tab is not committed, so a body that * only wants the visibility flag must not let that take it down. */ - function tabInfoNow(props) { - if (!props || typeof props.useTabInfo !== 'function') return null + /** + * The pane seat's tab-info hook, whichever shape it arrived in: `useTabInfo` + * (the prop the 0.2.0 seat handed a body) or `hooks.tabInfo` (the hook the + * 0.2.1+ seat declares in its inject). A seat that gives neither yields null, + * which every body already treats as "this pane has no tab". + */ +function tabInfoHookOf(props) { + if (!props) return null + if (typeof props.useTabInfo === 'function') return props.useTabInfo + if (props.hooks && typeof props.hooks.tabInfo === 'function') return props.hooks.tabInfo + return null +} + +function tabInfoNow(props) { + const useTabInfo = tabInfoHookOf(props) + if (useTabInfo === null) return null try { - const info = props.useTabInfo() + const info = useTabInfo() return info && info.tab ? info : null } catch (err) { return null diff --git a/packages/dsh-diagrams/package.json b/packages/dsh-diagrams/package.json index 0c4e221..fbe26e2 100644 --- a/packages/dsh-diagrams/package.json +++ b/packages/dsh-diagrams/package.json @@ -1,6 +1,6 @@ { "name": "dsh-diagrams", - "version": "0.1.0-alpha.8", + "version": "0.1.0-alpha.9", "description": "Diagrams: Mermaid, TikZ and the Diagram Design kit in one bundle - seven `diagram_*` tools whose writes are validated on the host before they are stored, a conversation store plus a shared library, a tab per diagram with an export menu, an index page that also browses the kit's 71 example keys, and browser render reports.", "type": "module", "main": "lib/index.js", diff --git a/packages/dsh-editor/lib/client.js b/packages/dsh-editor/lib/client.js index 253444b..167a9fd 100644 --- a/packages/dsh-editor/lib/client.js +++ b/packages/dsh-editor/lib/client.js @@ -118,7 +118,7 @@ window.__ModuleLoader__.load({ const FILE_PREFIX = 'dsh-resource://file/' const SESSION_SEGMENT = 'session/' /** Version marker shown on the toolbar so a freshly loaded bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.14' + const PLUGIN_VERSION = '0.1.0-alpha.15' /** The client service dsh-modal provides; resolved lazily, never required. */ const MODAL_SERVICE = 'modals' /** The client service @deepseek-ai/dsh-client-ui-theme provides; resolved lazily too. */ @@ -1617,8 +1617,22 @@ window.__ModuleLoader__.load({ * The tab body dispatched by `sidebar.right.pane.tab`: a file address gets * that file's editor, and the tab's own page address gets a blank document. */ + /** + * The pane seat's tab-info hook, whichever shape it arrived in: `useTabInfo` + * (the prop the 0.2.0 seat handed a body) or `hooks.tabInfo` (the hook the + * 0.2.1+ seat declares in its inject). A seat that gives neither yields null, + * which every body here already treats as "this pane has no tab". + */ + function tabInfoHookOf(props) { + if (!props) return null + if (typeof props.useTabInfo === 'function') return props.useTabInfo + if (props.hooks && typeof props.hooks.tabInfo === 'function') return props.hooks.tabInfo + return null + } + function EditorBody(props) { - const info = props.useTabInfo() + const useTabInfo = tabInfoHookOf(props) + const info = useTabInfo !== null ? useTabInfo() : null const tab = info.tab const parsed = parseFileAddress(tab.contentId) const file = parsed && parsed.scope === 'session' && parsed.path !== '' ? parsed : null @@ -1636,7 +1650,8 @@ window.__ModuleLoader__.load({ /** The chip title: the label this surface set, else the captured title, plus a dot while dirty. */ function EditorTitle(props) { - const info = props.useTabInfo() + const useTabInfo = tabInfoHookOf(props) + const info = useTabInfo !== null ? useTabInfo() : null const tab = info.tab const state = React.useSyncExternalStore(subscribeTabState, () => tabStateOf(tab.id)) const text = state.label === '' ? tab.title : state.label diff --git a/packages/dsh-editor/package.json b/packages/dsh-editor/package.json index a9ca848..d921df3 100644 --- a/packages/dsh-editor/package.json +++ b/packages/dsh-editor/package.json @@ -1,6 +1,6 @@ { "name": "dsh-editor", - "version": "0.1.0-alpha.14", + "version": "0.1.0-alpha.15", "description": "Editor: the tab type for text and code - a vendored CodeMirror 6 fetched lazily - with create-on-save inside the session workspace through this package's own authenticated routes. Markdown is claimed too, and hands off to the shipped preview.", "type": "module", "main": "lib/index.js", diff --git a/packages/dsh-gittree/lib/client.js b/packages/dsh-gittree/lib/client.js index f7358b2..7156769 100644 --- a/packages/dsh-gittree/lib/client.js +++ b/packages/dsh-gittree/lib/client.js @@ -87,7 +87,7 @@ window.__ModuleLoader__.load({ const FILE_PREFIX = 'dsh-resource://file/' const SESSION_SEGMENT = 'session/' /** Version marker shown on the tool bar so a freshly loaded bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.5' + const PLUGIN_VERSION = '0.1.0-alpha.6' /** The keyed seats every tab type occupies. */ const TAB_SLOT = 'sidebar.right.pane.tab' const TITLE_SLOT = 'sidebar.right.pane.tab.title' @@ -816,9 +816,23 @@ window.__ModuleLoader__.load({ * while its token is the newest - so a re-render can never cancel an in-flight * request, and two racing answers cannot overwrite each other. */ + /** + * The pane seat's tab-info hook, whichever shape it arrived in: `useTabInfo` + * (the prop the 0.2.0 seat handed a body) or `hooks.tabInfo` (the hook the + * 0.2.1+ seat declares in its inject). A seat that gives neither yields null, + * which this body already treats as "this pane has no tab". + */ + function tabInfoHookOf(props) { + if (!props) return null + if (typeof props.useTabInfo === 'function') return props.useTabInfo + if (props.hooks && typeof props.hooks.tabInfo === 'function') return props.hooks.tabInfo + return null + } + function GitTreeView(props) { const sessionId = typeof props.sessionId === 'string' ? props.sessionId : '' - const info = typeof props.useTabInfo === 'function' ? props.useTabInfo() : null + const useTabInfo = tabInfoHookOf(props) + const info = useTabInfo !== null ? useTabInfo() : null const tabActions = info && info.tab && info.tab.actions ? info.tab.actions : null const [summary, setSummary] = useState({ phase: 'loading', data: null, error: null }) diff --git a/packages/dsh-gittree/package.json b/packages/dsh-gittree/package.json index d22ff35..59536ce 100644 --- a/packages/dsh-gittree/package.json +++ b/packages/dsh-gittree/package.json @@ -1,6 +1,6 @@ { "name": "dsh-gittree", - "version": "0.1.0-alpha.5", + "version": "0.1.0-alpha.6", "description": "History: a read-only tab showing the workspace's commit graph, each commit's message and the files it touched. Three read-only routes spawn `git` with argv arrays under a pinned env; nothing here can write, stage or check out.", "type": "module", "main": "lib/index.js", diff --git a/packages/dsh-image/lib/client.js b/packages/dsh-image/lib/client.js index 98aca69..765acc1 100644 --- a/packages/dsh-image/lib/client.js +++ b/packages/dsh-image/lib/client.js @@ -59,7 +59,7 @@ window.__ModuleLoader__.load({ /** The tab kind this package owns. */ const KIND = 'image' /** Version marker shown in the toolbar, so a loaded bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.2' + const PLUGIN_VERSION = '0.1.0-alpha.3' /** Address grammar owned by @deepseek-ai/dsh-util-workspace-path. */ const FILE_PREFIX = 'dsh-resource://file/' const SESSION_SEGMENT = 'session/' @@ -424,10 +424,24 @@ window.__ModuleLoader__.load({ } /** The tab information a pane body was handed, or null when it has none. */ - function tabInfoNow(props) { - if (!props || typeof props.useTabInfo !== 'function') return null + /** + * The pane seat's tab-info hook, whichever shape it arrived in: `useTabInfo` + * (the prop the 0.2.0 seat handed a body) or `hooks.tabInfo` (the hook the + * 0.2.1+ seat declares in its inject). A seat that gives neither yields null, + * which every body already treats as "this pane has no tab". + */ +function tabInfoHookOf(props) { + if (!props) return null + if (typeof props.useTabInfo === 'function') return props.useTabInfo + if (props.hooks && typeof props.hooks.tabInfo === 'function') return props.hooks.tabInfo + return null +} + +function tabInfoNow(props) { + const useTabInfo = tabInfoHookOf(props) + if (useTabInfo === null) return null try { - const info = props.useTabInfo() + const info = useTabInfo() return info && info.tab ? info : null } catch (err) { return null diff --git a/packages/dsh-image/package.json b/packages/dsh-image/package.json index 9ba54cf..c436cd0 100644 --- a/packages/dsh-image/package.json +++ b/packages/dsh-image/package.json @@ -1,6 +1,6 @@ { "name": "dsh-image", - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "description": "Image: a viewer tab for PNG/JPEG/GIF/WebP/AVIF/BMP/ICO/SVG/TIFF that fits the pane on open, zooms by moving the LAYOUT (never a transform), pans by drag and reads the pixel under the pointer. Client-only: the bytes come from the harness's own `remote.workspaceFiles`.", "type": "module", "main": "lib/index.js", diff --git a/packages/dsh-pdf/lib/client.js b/packages/dsh-pdf/lib/client.js index 7ad86e6..5ec256f 100644 --- a/packages/dsh-pdf/lib/client.js +++ b/packages/dsh-pdf/lib/client.js @@ -65,7 +65,7 @@ window.__ModuleLoader__.load({ /** The address shape a page-address tab is opened with. */ const PAGE_PREFIX = 'sidebar://' /** Version marker shown in the toolbar, so a loaded bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.9' + const PLUGIN_VERSION = '0.1.0-alpha.10' /** Keep in sync with lib/index.js. */ const API_ROOT = '/api/dsh-pdf' const FILE_ROUTE = API_ROOT + '/file' @@ -443,10 +443,24 @@ window.__ModuleLoader__.load({ } /** The tab information a pane body was handed, or null when it has none. */ - function tabInfoNow(props) { - if (!props || typeof props.useTabInfo !== 'function') return null + /** + * The pane seat's tab-info hook, whichever shape it arrived in: `useTabInfo` + * (the prop the 0.2.0 seat handed a body) or `hooks.tabInfo` (the hook the + * 0.2.1+ seat declares in its inject). A seat that gives neither yields null, + * which every body already treats as "this pane has no tab". + */ +function tabInfoHookOf(props) { + if (!props) return null + if (typeof props.useTabInfo === 'function') return props.useTabInfo + if (props.hooks && typeof props.hooks.tabInfo === 'function') return props.hooks.tabInfo + return null +} + +function tabInfoNow(props) { + const useTabInfo = tabInfoHookOf(props) + if (useTabInfo === null) return null try { - const info = props.useTabInfo() + const info = useTabInfo() return info && info.tab ? info : null } catch (err) { return null diff --git a/packages/dsh-pdf/package.json b/packages/dsh-pdf/package.json index 61310fc..ce1b807 100644 --- a/packages/dsh-pdf/package.json +++ b/packages/dsh-pdf/package.json @@ -1,6 +1,6 @@ { "name": "dsh-pdf", - "version": "0.1.0-alpha.9", + "version": "0.1.0-alpha.10", "description": "PDF: five `pdf_*` tools (info, read, find, render, scan) over a vendored pdf.js, plus the reader tab (zoom, search, thumbnails, outline) and a workspace index. Read-only, with extraction in a child process that never evaluates a document's JavaScript.", "type": "module", "main": "lib/index.js", diff --git a/packages/dsh-video/lib/client.js b/packages/dsh-video/lib/client.js index 7dc54ed..733792d 100644 --- a/packages/dsh-video/lib/client.js +++ b/packages/dsh-video/lib/client.js @@ -54,7 +54,7 @@ window.__ModuleLoader__.load({ /** The tab kind this package owns. */ const KIND = 'video' /** Version marker shown in the toolbar, so a loaded bundle is easy to verify. */ - const PLUGIN_VERSION = '0.1.0-alpha.2' + const PLUGIN_VERSION = '0.1.0-alpha.3' /** Address grammar owned by @deepseek-ai/dsh-util-workspace-path. */ const FILE_PREFIX = 'dsh-resource://file/' const SESSION_SEGMENT = 'session/' @@ -302,10 +302,24 @@ window.__ModuleLoader__.load({ // The tab's own props // --------------------------------------------------------------------- /** The `useTabInfo` result, however the seat passed it. */ - function tabInfoNow(props) { - if (!props || typeof props.useTabInfo !== 'function') return null + /** + * The pane seat's tab-info hook, whichever shape it arrived in: `useTabInfo` + * (the prop the 0.2.0 seat handed a body) or `hooks.tabInfo` (the hook the + * 0.2.1+ seat declares in its inject). A seat that gives neither yields null, + * which every body already treats as "this pane has no tab". + */ +function tabInfoHookOf(props) { + if (!props) return null + if (typeof props.useTabInfo === 'function') return props.useTabInfo + if (props.hooks && typeof props.hooks.tabInfo === 'function') return props.hooks.tabInfo + return null +} + +function tabInfoNow(props) { + const useTabInfo = tabInfoHookOf(props) + if (useTabInfo === null) return null try { - return props.useTabInfo() + return useTabInfo() } catch (err) { return null } diff --git a/packages/dsh-video/package.json b/packages/dsh-video/package.json index 1a544e9..aa8c2cb 100644 --- a/packages/dsh-video/package.json +++ b/packages/dsh-video/package.json @@ -1,6 +1,6 @@ { "name": "dsh-video", - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "description": "Video: a player tab for MP4/MOV/WebM/MKV/AVI/WMV/FLV/OGV/TS/3GP that fits the pane, with the ffprobe facts, chapters as jump targets and one-click remux/convert. The bytes never enter the tab: the `