A container workspace (a project directory that is not itself a repository)
can hold several independent repositories. Discovery and `git.status`
already report all of them; the panel listed them only in the
"more actions -> repository" submenu, so nothing on screen said the others
existed and the body silently rendered repositories[0].
Render one chip per discovered root above the Changes section, mark the
root the panel is pinned to, and switch through the existing chooseRepo so
reads, mutations and the commit graph follow the selection. A single
repository workspace renders no row; the menu entry stays.
The terminal area was a solid black rectangle inside a panel that was not,
which read as a surface the plugin had chosen rather than the emulator
showing through.
Two independent causes, both needed:
1. CSS Modules hashed xterm's own class names. `.screen .xterm-viewport`
compiled to `.o8IiwG_screen .o8IiwG_xterm-viewport`, while the real DOM
carries xterm's unhashed `.xterm-viewport` — the rule never matched
anything. Wrapped in `:global()`.
2. xterm.css ships `.xterm .xterm-viewport { background-color: #000 }` and
injects that sheet when `open()` runs, after this module. Matching its
specificity (0,2,0) therefore loses on source order every time, so the
selector climbs to 0,3,0 with the extra `.xterm`. Measured in Chromium:
0,2,0 leaves `rgb(0, 0, 0)`, 0,3,0 resolves to `rgba(0, 0, 0, 0)`.
`.screen` itself also stops painting `--dsw-alias-bg-base`, which was a second
surface inside the panel.
No `!important` (outranking by specificity is enough) and no
`allowTransparency` (measured no effect on the viewport background under the
DOM renderer xterm 6 uses by default).
The host's session list hides every subagent-origin row in ALL archive filters (sessionVisible() returns false before the filter), and its unarchive control only lives on those rows. Archiving a side conversation is therefore a one-way door with no entry left to recover it, so the composer-bar action is disabled for any bound session the list cannot show again, with a hover tip (all 21 dictionaries) explaining why and pointing at Save as new session. The handler keeps the same guard.
The archive-and-rebind path stays covered for a host-visible binding.
Hidden tab types (the built-in diff page, dsh-remote's dsh-remote:file)
have no + menu row and no native guide entry, yet the side-card inventory
still gave them an enable switch. Turning one off changed nothing in the
sidebar and only made openTab silently refuse that type - which the
reporter saw as "remote:file cannot be turned off / git:diff does
nothing", and dsh-remote saw as "remote files stop opening".
- SideCardSection: the inventory skips hidden types (the count badge
follows); tabOrder becomes the order-only tabInventory.
- service.isTabEnabled: a hidden type is always enabled, so a
tabsEnabled[id] = false written by an older build cannot keep refusing
its programmatic opens.
- docs/external-plugin-guide.md and CHANGELOG describe the contract; the
two new specs fail on the previous code.
The More Actions menu's repo/worktree rows open nested submenus, but this button-anchored entry never called useSubmenuFlip — the body attribute layout.css consumes was absent, so even with #955's unclosed media query fixed the submenus still opened past the right edge of the docked sidebar.
Keep the trigger's measured corner in the menu state (a boolean cannot feed the coordinate-based hook, and a keyboard activation has no cursor point) and hand it to the same hook the file-tree row menu uses. The new test opens the real menu on a mocked right-edge trigger and pins the 'down left' tokens plus their removal on close.
refreshFile and the in-place file switch used the same three-line no-confirm fallback. Extract it once and keep the fallback semantics unchanged; the comment now says the switch reads the same dirty registry as the close guard, not that the fallback is identical.
The merged editor mode rewrites the current tab's path, which remounts the viewer and drops a draft that lives only in that instance. Ask the same unsaved-edit guard the tab close uses; re-opening the current path and native-claimed files do not switch this tab and stay prompt-free.
Review findings on #1040:
- A bad fence no longer poisons the document. `renderMermaidDiagram` used to
treat every `renderInFrame` rejection as a frame failure, so a mermaid
syntax error (a normal `mermaid-error` answer) was retried and then flipped
`frameUnavailable` — every later diagram failed until the page reloaded.
Frame answers are now classified: `MermaidDiagramError` is final for that
one diagram (its block shows the message + source), while
`MermaidFrameError` (load/handshake/timeout/protocol) gets the single retry
and then the page-level fast-fail breaker.
- Both directions of postMessage are validated. Parent side binds
`event.source` to the frame's `contentWindow` plus an opaque-origin
allowlist and validates id/svg/message; the inlined frame script binds
`event.source` to `window.parent` and validates id/code/theme/length before
rendering.
- Visibility gating now flushes on return: the 80ms inline-HTML pass remembers
a skipped pass and replays it on `visibilitychange`, and the preview handle
also pauses/resumes on document visibility (not just IntersectionObserver).
- Tests: new `tests/mermaid-frame.spec.ts` covers the error classes
(diagram error does not break later renders; transport retry; breaker after
two failures) and the message validator (wrong window/origin, malformed
payloads); the asset spec pins the frame-side sender/payload checks.
A failed render used to show only a generic "Mermaid render failed" label
plus the fence source, with the actual reason hidden in the hover title —
which makes a bad fence hard to find. Print the first two lines of
mermaid's own message under the label (the full text stays on the title)
and cover it in the fallback spec.
This was triggered by a real document whose diagram used "A 与 B" instead
of mermaid's "A & B" multi-target syntax: the error strip now names the
parse error and the source block points at the broken lines.
Follow-up to the iframe isolation: after that fix a 31-diagram document
still felt janky while scrolling. The remaining cost was work competing
with the scroll gesture:
- background diagram renders kept running during scroll (each one injects
an SVG, runs DOM passes and lays out);
- hidden native tabs kept warming diagrams (tab bodies are keepMounted);
- the inline-HTML and heading-anchor MutationObservers ran a full-document
scan per mutation (measured 8-15 ms per pass, dozens of passes when a
document swaps its diagrams in);
- initial near-viewport detection read one rect per diagram between DOM
writes, forcing a layout per diagram;
- off-screen rendered SVGs still participated in layout and paint.
The queue now pauses background work for 350 ms after the last captured
scroll event, and only schedules renders whose preview is visible
(IntersectionObserver gate per preview; hidden tabs keep placeholders and
wake the queue when shown again, and unmounting a preview drops its queued
tasks). The two mutation passes coalesce bursts into one 80 ms pass.
Initial priorities come from one batched rect read before the swap writes.
.mermaidWrap gains content-visibility:auto + contain-intrinsic-size +
contain:layout paint style, so off-screen diagrams leave layout and paint.
Visible diagrams still render on demand, every diagram is still eventually
rendered, and nothing falls back to a code block.
Mermaid measures every label with SVGElement.getBBox() against a node
appended to document.body, so each measurement flushes the whole host
document's layout. Measured in the live DSH window (15,418 DOM nodes):
59-75 ms per measurement, versus 1 ms in an empty iframe document. One
diagram therefore took 1.5-7.3 s, and a 31-diagram markdown document kept
the renderer main thread blocked for >20 s - long enough for the desktop
shell's surface watchdog to kill the renderer, with tab restoration
turning it into a crash loop. CSS containment on the app root does not
help (59-62 ms); only an independent layout tree does.
Render diagrams inside a hidden sandboxed iframe instead: a self-contained
blob: document (mermaid UMD bundle + a small postMessage protocol, both
inlined by scripts/build-mermaid-frame-asset.mjs) renders each diagram;
the parent only sends/receives and sanitizes the SVG. Diagrams now take
30-104 ms each and 31 diagrams complete in ~5 s in the background, while
the client mermaid chunk shrinks from 7.04 MB to 3.69 MB (minified UMD
replaces the unminified inline bundle).
Also add a shared render queue: visible/near-viewport diagrams first, the
rest filled in on requestIdleCallback with 16 ms main-thread yields between
renders, so every diagram is still rendered (none degrades to a code
block). Fence-line-sized placeholder skeletons reserve height while a
diagram waits. No host-half route changes are needed.
resolveAddressPath() re-spells an address path in the base's separator
style. Folding every separator run into one '\' also folded the UNC share
marker of a \\wsl.localhost\<distro>\... path, turning an absolute network
path into a drive-root-relative one. On Windows the host's requireAbsolute()
then path.resolve()d it onto the host process drive (C:\wsl.localhost\...),
so every file opened from a WSL workspace failed with ENOENT.
Keep exactly the two leading separators of a UNC path and fold only the
rest. Drive paths, POSIX bases and unknown bases are unchanged.
tests/worktree-address.spec.ts pins the UNC absolute, workspace-relative and
forward-slash spellings; the case fails on the previous source and passes
with the fix.