Branch for hardware verification on a host that meets v0.24.1's peer range.
Base: upstream `dsh-better-sidebar` v0.24.1 (tag v0.24.1 = a2751cf), MIT.
Measured delta carried over from the v0.19.1 line: 78 rename-only files, 11 real
edits, 10 additions. Ported with the same measurement method as the v0.19.1
re-base: build a normalized base (upstream tree + the fork rename, excluding
README.md / package.json / docs/plans/* which deliberately keep the upstream
name), extract the delta against it, then three-way apply onto the renamed
v0.24.1 tree (`git apply -3`). 13 conflicts resolved by hand.
Identity:
- version 1.3.0, SIDEBAR_SERVICE_VERSION 1.3.0 (package.json ↔ service.ts pair
is asserted by tests/service.spec.ts), forkedFrom -> v0.24.1/a2751cf.
- package.json keeps the union of both sides' metadata: upstream's new
`zustand` + `icon`/`locale` files entries, plus the fork's `scripts/switch.sh`
entry and its `forkedFrom` block.
- README.md takes upstream v0.24.1 wholesale (its own v0.24.1 changelog and all
16 sections) and keeps the fork's two deltas: the fork-notice block at the top
(now documenting the 0.2.0-rc.1+ requirement) and the fork package name.
- peerDependencies stay upstream's `^0.2.0-rc.1` — this line does NOT load on
DSH 0.1.x: the host's semver pre-check rejects a caret range across a minor
and silently disables the row (no error, no load).
Carried features, all re-verified against the new base:
- apes:* information-layer tabs (src/client/apes/) — the subtree's session feed
changed shape in 0.1.7 and the port follows the host's own migration notes in
context-types.ts: the per-session catalog is now
`projectionsBySession[id].values.subagentCatalog` (a flat entry list) instead
of 0.1.6's `subagentsByParent` catalog with `entries`/`kind`/`activity`, and
the removed `list.current` is answered by `props.scope.sessionId`. Rows are
normalized to { id, label, mode } with activity read from the durable
summaries, so catalog and byId sources render alike.
- HTML preview delivery through srcdoc (sandbox kept intact).
- Panel host mounted inside the shell's framed content viewport.
Gate: typecheck clean; build clean; 1515 passed / 9 skipped (141 files).
NOT applied to ~/.dsh/profiles/desktop — that profile runs DSH 2.0.10 with
@deepseek-ai/dsh 0.1.5-rc.2, where this line is silently disabled by design.
42 lines
1.9 KiB
TypeScript
42 lines
1.9 KiB
TypeScript
/**
|
|
* Panel-host parenting tests — the layering half of a real defect: on DSH
|
|
* Desktop's framed modes the shell tags the upstream `#root` with
|
|
* `data-dsh-desktop-content-viewport` and gives it `isolation: isolate`, a
|
|
* stacking context around the whole app INCLUDING the shell's overlay layer
|
|
* (`.dshDesktopOverlay`, z-index 1000 — where a plugin's modal renders, e.g.
|
|
* the community market's). A host parented to `document.body` sits outside
|
|
* that context, so the panel layer's documented 25 outranked every overlay
|
|
* inside it and covered host modals.
|
|
*
|
|
* jsdom: the resolution is a DOM query, so the stub-globals spec style used
|
|
* by desktop-env.spec.ts cannot exercise it.
|
|
*/
|
|
// @vitest-environment jsdom
|
|
import { beforeEach, describe, expect, it } from 'vitest'
|
|
import { panelHostParent } from '../src/client/desktop-env.ts'
|
|
|
|
beforeEach(() => { document.body.innerHTML = '' })
|
|
|
|
describe('panelHostParent', () => {
|
|
it('falls back to the body when the shell framed no content viewport', () => {
|
|
document.body.innerHTML = '<div id="root"></div>'
|
|
expect(panelHostParent(document)).toBe(document.body)
|
|
})
|
|
|
|
it('falls back to the body when there is no root at all (plain web)', () => {
|
|
expect(panelHostParent(document)).toBe(document.body)
|
|
})
|
|
|
|
it('resolves the framed content viewport when the shell stamped one', () => {
|
|
document.body.innerHTML = '<div id="root" data-dsh-desktop-content-viewport=""><div class="dshDesktopFrame"></div></div>'
|
|
const root = document.getElementById('root')
|
|
expect(panelHostParent(document)).toBe(root)
|
|
// The host lands INSIDE the shell's stacking context — beside the overlay
|
|
// layer the shell renders there, and never as a body-level sibling.
|
|
const host = document.createElement('div')
|
|
panelHostParent(document).appendChild(host)
|
|
expect(root?.contains(host)).toBe(true)
|
|
expect(document.body.lastElementChild).toBe(root)
|
|
})
|
|
})
|