6.8 KiB
6.8 KiB
Changelog
Full release history of dsh-better-sidebar (see the README for the latest release; also mirrored on GitHub Releases).
📝 The Chinese CHANGELOG is the authoritative, item-by-item record; this file carries the English summaries and has historically lagged behind it. Where the two disagree, the Chinese one is current.
Unreleased
- 🪟 Windows + WSL workspaces: a UNC path is no longer folded into a drive-relative one. Re-spelling paths on a Windows base folded every run of separators into one
\, which also folded the UNC prefix of\\wsl.localhost\<distro>\...into\wsl.localhost\...; the host'spath.resolve()then anchored that on its own process drive (C:\wsl.localhost\...), so every file opened from a WSL workspace failed with ENOENT. The UNC prefix now survives and only the rest is folded (drive paths are unchanged).- 🧪
tests/worktree-address.spec.tsadds one case: UNC absolute, workspace-relative, and forward-slash spellings all keep the two leading separators.
- 🧪
- 🗂 A session cwd that is a Git repository subdirectory is no longer lifted to the repository top (#1024, #1080; contributor PR #1070 @hy5424): the sidebar root was replaced with
git rev-parse --show-toplevel, so a relative file link in chat resolved to<repo>/<file>instead of<repo>/<subdir>/<file>(ENOENT) and file search used the wrong root. The session cwd is now the root as it stands; only linked-worktree evidence from the session's own tool calls replaces it. The cwd is canonicalized first, so symlinked spellings (/varvs/private/var) cannot make a nested worktree look outside the workspace (#952).- 🧪
tests/active-worktree.spec.tsadds one ASCII and one Chinese subdirectory case (both red before the fix).
- 🧪
- ⚡ Mermaid previews of large Markdown documents no longer stall the renderer (layout measurement isolated in a sandboxed iframe): mermaid measures label text with
SVGElement.getBBox()against a node appended todocument.body, so every measurement flushes the whole DSH document layout — measured on a real desktop host at 59–75 ms per measurement (15,418 nodes) versus 1 ms in an empty iframe. A 31-diagram document therefore blocked the main thread for >20 s, tripping the desktop shell's surface watchdog and turning tab restoration into a crash loop. Diagrams now render inside a hiddensandbox="allow-scripts"iframe (a self-contained blob: document with the mermaid UMD bundle inlined plus a small postMessage protocol); the parent only sends/receives and sanitizes SVG: per diagram 1,500–7,300 ms → 30–104 ms, 31 diagrams in ~5 s, while the client mermaid chunk shrinks from 7.04 MB to 3.69 MB. A shared render queue (visible/near-viewport diagrams first, the rest filled in onrequestIdleCallback, 16 ms main-thread yields between renders — every diagram is still rendered, none degrades to a code block) and fence-line-sized placeholder skeletons complete the change. Design and measurements: docs/plans/2026-10-23-mermaid-iframe-isolation.md. - ⚡ Smooth scrolling for large documents: the render queue pauses while the reader scrolls (resuming 350 ms after the last scroll event) and only serves the preview that is actually on screen — hidden tabs keep placeholders and warm their diagrams when shown again. The two mutation-driven full-document scans (inline HTML pass, heading-anchor pass) coalesce bursts into one pass every 80 ms (previously a scan per mutation, measured at 8–15 ms each); initial near-viewport detection reads every rect in one batch before the swap writes, removing one forced layout per diagram;
.mermaidWrapgainscontent-visibility: auto+contain-intrinsic-size+contain: layout paint style, so off-screen diagrams leave layout and paint entirely. Scrolling no longer competes with background renders, document-wide scans or off-screen SVG repaint; diagrams still fill in when the reader stops or scrolls them into view — never as code blocks. - 🐞 A failed diagram shows the mermaid parse error inline: instead of only a generic "Mermaid render failed" label plus the source block (the full error was hidden in the hover title), the error strip now prints the first two lines of mermaid's message (e.g.
Parse error on line 10 ... Expecting 'SEMI', ...), so a broken fence is found without hunting; the full text stays on the title.
v0.29.0
- GenUI in side chats: the existing
ctx.betterSidebarservice exposes the opt-inregisterSidechatSurfaceAdapterfor GenUI 0.15.0 to render settled assistant replies. Without a consumer, Markdown rendering stays unchanged. - Child-thread ownership and lifecycle: preserve thread, event and original text-block identity. Hiding, switching threads, replacing a row or disposing the plugin revokes old callbacks; actions never fall back to the main conversation. Existing rewrite caches, media handling and streaming state remain intact.
- Cold-resume boundary: remove only an explicitly inherited history prefix; ordinary restore markers no longer discard child history.
- Contribution: thanks to @sunxiuguo for the provider implementation (#1033). Original commits are preserved, alongside current dev and the 0.28.2 cold-session read fix.
v0.28.2
- 🛡 A detached session's cwd now comes from its stored workspace address instead of decoding the whole session log.
sessionQuery.observeSession(..., { projectionMode: 'all' })decodes the entire zstd artifact and hydrates every projection to answer with oneworkingDirectorystring. The real startup fan-out never went through the 0.28.1cwdOf()single-flight (which only covers/sidebar/api): the fs-watch socket sends one frame per watched directory, and/sidebar/file|htmlresolve cwd per resource,/sidebar/upload|writeper call — so a 39 MB session was fully decoded dozens of times inside 130–180 ms (the 44-read OOM on 0.28.0 and the 36 reads reported against 0.28.1 are the same path, not a broken dedupe). The cold cwd now usessessionPersistence.stat— a header-only read (first zstd frame) with a process-level memo and same-session in-flight sharing — andactiveWorktreeRootOfreturns that address for detached sessions. Once the host attaches the session, the committedworking_directoryand linked-worktree following resume as before.- Cost: until the session is attached, the sidebar roots at the original project rather than the agent's last directory/worktree; the next 5 s poll corrects it after attach.