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:
@@ -32,23 +32,10 @@ describe('dsh-better-sidebar plugin export shape', () => {
|
||||
expect(resolved.readLimit).toBe(512 * 1024)
|
||||
expect(resolved.mediaLimit).toBe(20 * 1024 * 1024)
|
||||
expect(resolved.listLimit).toBe(1000)
|
||||
expect(resolved.terminalsPerSession).toBe(3)
|
||||
expect(resolved.reconnectGraceMs).toBe(30_000)
|
||||
// The terminal shell config defaults to auto-resolution (empty shell =
|
||||
// the platform chain in defaultShell()).
|
||||
expect(resolved.shell).toBe('')
|
||||
// Shell args default to an empty list; non-empty values replace the
|
||||
// automatic platform login flag.
|
||||
expect(resolved.shellArgs).toEqual([])
|
||||
const configured = (schema as unknown as {
|
||||
(input: Record<string, unknown> | undefined): Record<string, unknown>
|
||||
})({ shell: 'pwsh.exe' })
|
||||
expect(configured.shell).toBe('pwsh.exe')
|
||||
const configuredWithArgs = (schema as unknown as {
|
||||
(input: Record<string, unknown> | undefined): Record<string, unknown>
|
||||
})({ shell: '/bin/zsh', shellArgs: ['--noprofile', '--no-rc'] })
|
||||
expect(configuredWithArgs.shell).toBe('/bin/zsh')
|
||||
expect(configuredWithArgs.shellArgs).toEqual(['--noprofile', '--no-rc'])
|
||||
})({ readLimit: 1024 })
|
||||
expect(configured.readLimit).toBe(1024)
|
||||
})
|
||||
|
||||
it('registers the side card preferences schema with the documented defaults', async () => {
|
||||
@@ -63,15 +50,9 @@ describe('dsh-better-sidebar plugin export shape', () => {
|
||||
expect(resolved.autoOpenSubagent).toBe(true)
|
||||
// A new background job auto-opens the Jobs page too.
|
||||
expect(resolved.autoOpenJobs).toBe(true)
|
||||
// The terminal tools default OFF (the feature is dormant until the user
|
||||
// enables it in the side card settings).
|
||||
expect(resolved.agentTerminalTools).toBe(false)
|
||||
// The sidebar-open tool defaults OFF too (same dormant-until-enabled rule).
|
||||
// The sidebar-open tool defaults OFF (dormant until the user enables it
|
||||
// in the side card settings).
|
||||
expect(resolved.agentOpenTools).toBe(false)
|
||||
// The terminal font customizations default to the theme (empty family)
|
||||
// and 13px.
|
||||
expect(resolved.terminalFontFamily).toBe('')
|
||||
expect(resolved.terminalFontSize).toBe(13)
|
||||
// The position-compat scheme is declared WITHOUT a schema default so a
|
||||
// stored document that predates it resolves without the field — the
|
||||
// CLIENT parsePrefs then applies the conservative `auto` default (or
|
||||
|
||||
Reference in New Issue
Block a user