feat: yield the terminal and browser to DSH 0.1.6's own sidebar types
DSH 0.1.6-alpha.2 ships a right-Sidebar terminal and a right-Sidebar browser of its own. Both were things this plugin had built from scratch, so keeping them meant two implementations of one surface plus a plugin that shadows a host type the product is actively developing. Terminal: the plugin's whole PTY stack goes — the UI-tab manager, the agent-owned registry, the lazy node-pty loader, the eight model-facing terminal_* tools, the xterm view and its font/link/scrollback helpers, and the cross-session 'pinned terminal' rail that existed only to keep a terminal alive across a session switch. The host's terminal kind becomes the only provider, which also retires the node-pty dependency, its pnpm allowBuilds entry, and the installer's -Repair mode (issue #140's whole class of 'node-pty failed to load' support). Model-facing capability note: the plugin used to inject terminal_* tools (off by default). Those are the model's only cross-call persistent terminal, and DSH's own equivalent (@deepseek-ai/dsh-tool-terminal) is not mounted by any shipped bundle, so removing them leaves the model with the one-shot bash/pwsh tools only. That is the accepted cost of not maintaining a second PTY surface; the README documents how to enable the upstream toolset. Browser: the plugin's browser tab type is dropped, so the host's own browser kind owns embedded pages. The DOM-level link takeover STAYS (it is the only thing that can route an https link to the system browser by protocol, which the host does not do) but now delegates to the host's browser tab via ctx.sidebarRight.openTab('browser', …) with a window.open fallback, and the two settings that only ever configured the plugin's own iframe (sandbox escape hatch, loopback allowlist) go with it — along with the host-side browser.probe route they fed. Cards: the empty-pane welcome cards adopt the host's guide-capsule recipe (0.5px l4 hairline, 24px radius, layer-1 fill, 56px floor, 14px/20px padding) so the plugin's 'pick what opens here' surface reads as the same design as DSH's own. A theme.spec guard pins the geometry and the token-only paint — including that the upstream-only --dsw-alias-bg-l1/-l2 spellings (defined nowhere, so their declarations are silently dropped upstream) never appear here. Also drops the dead state the removed features left behind (SidebarTab.pin, nextTerminal, agentWaits, bottomOpenedOnce, the agent-tab helpers, the pinned-tab memo key), re-points every test fixture that used them at surviving equivalents, and prunes the specs of the deleted features.
This commit is contained in:
1 parent
d60899841d
commit
5912274e41
79 files changed
+381
-9464
No files matched your search
+14
-14
@@ -71,13 +71,13 @@ describe('test-registry path (vitest / jsdom-less environments)', () => {
|
||||
|
||||
it('a failed load clears the cache so the next call retries', async () => {
|
||||
let calls = 0
|
||||
registerChunkForTests('terminal', async () => {
|
||||
registerChunkForTests('locale', async () => {
|
||||
calls += 1
|
||||
if (calls === 1) throw new Error('boom')
|
||||
return { TerminalView: 'terminal-view' }
|
||||
return { localeDicts: 'locale-dicts' }
|
||||
})
|
||||
await expect(loadChunk('terminal')).rejects.toThrow('boom')
|
||||
await expect(loadChunk('terminal')).resolves.toEqual({ TerminalView: 'terminal-view' })
|
||||
await expect(loadChunk('locale')).rejects.toThrow('boom')
|
||||
await expect(loadChunk('locale')).resolves.toEqual({ localeDicts: 'locale-dicts' })
|
||||
expect(calls).toBe(2)
|
||||
})
|
||||
})
|
||||
@@ -131,11 +131,11 @@ describe('production path (script injection + global registry + externals requir
|
||||
const seen: string[] = []
|
||||
setChunkScriptLoaderForTests(async (src) => {
|
||||
seen.push(src)
|
||||
simulateScript(src.endsWith('editor.js') ? 'editor' : 'terminal', () => ({}))
|
||||
simulateScript(src.endsWith('editor.js') ? 'editor' : 'locale', () => ({}))
|
||||
})
|
||||
await loadChunk('terminal')
|
||||
await loadChunk('locale')
|
||||
await loadChunk('editor')
|
||||
expect(seen).toEqual(['/sidebar/bundle/terminal.js', '/sidebar/bundle/editor.js'])
|
||||
expect(seen).toEqual(['/sidebar/bundle/locale.js', '/sidebar/bundle/editor.js'])
|
||||
expect(modules.import).toHaveBeenCalledTimes(CHUNK_EXTERNALS.length)
|
||||
})
|
||||
|
||||
@@ -150,11 +150,11 @@ describe('production path (script injection + global registry + externals requir
|
||||
it('a script load failure rejects without materializing', async () => {
|
||||
const modules = installModuleSystem()
|
||||
setChunkScriptLoaderForTests(async () => { throw new Error('script 404') })
|
||||
await expect(loadChunk('terminal')).rejects.toThrow('script 404')
|
||||
await expect(loadChunk('locale')).rejects.toThrow('script 404')
|
||||
expect(modules.import).not.toHaveBeenCalled()
|
||||
// Cache cleared: the retry re-attempts the script load.
|
||||
setChunkScriptLoaderForTests(async () => { simulateScript('terminal', () => ({ TerminalView: 'ok' })) })
|
||||
await expect(loadChunk('terminal')).resolves.toEqual({ TerminalView: 'ok' })
|
||||
setChunkScriptLoaderForTests(async () => { simulateScript('locale', () => ({ localeDicts: 'ok' })) })
|
||||
await expect(loadChunk('locale')).resolves.toEqual({ localeDicts: 'ok' })
|
||||
})
|
||||
|
||||
it('a script that ran but registered no factory fails with a clear error', async () => {
|
||||
@@ -216,7 +216,7 @@ describe('revalidateChunksOnReactivate (HMR re-activation keeps unchanged chunks
|
||||
function stubBundleHead(etagFor: (name: string) => string | null | Error): void {
|
||||
vi.stubGlobal('fetch', vi.fn(async (input: unknown) => {
|
||||
const url = String(input)
|
||||
const name = url.endsWith('terminal.js') ? 'terminal' : 'editor'
|
||||
const name = url.endsWith('locale.js') ? 'locale' : 'editor'
|
||||
const etag = etagFor(name)
|
||||
if (etag instanceof Error) throw etag
|
||||
return {
|
||||
@@ -268,13 +268,13 @@ describe('revalidateChunksOnReactivate (HMR re-activation keeps unchanged chunks
|
||||
let scriptCalls = 0
|
||||
setChunkScriptLoaderForTests(async () => {
|
||||
scriptCalls += 1
|
||||
simulateScript('terminal', () => ({ TerminalView: 'tv' }))
|
||||
simulateScript('locale', () => ({ localeDicts: 'ld' }))
|
||||
})
|
||||
stubBundleHead(() => new Error('HEAD unreachable'))
|
||||
await loadChunk('terminal')
|
||||
await loadChunk('locale')
|
||||
await settleEtag()
|
||||
await revalidateChunksOnReactivate()
|
||||
await loadChunk('terminal')
|
||||
await loadChunk('locale')
|
||||
expect(scriptCalls).toBe(2)
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user