Commit Graph
825 Commits
Author SHA1 Message Date
CCColastic dcafe7d2dc fix(sidechat): restore thread bindings after page reload 2026-11-02 13:46:22 +08:00
CCColastic 23a2b61f33 feat(sidechat): accept pasted and selected image prompts 2026-11-02 13:37:43 +08:00
Menghuan1918 bd6cfa55b4 test(e2e): measure the folder-archive flow in the perf audit 2026-10-30 02:14:40 +08:00
Menghuan1918 0e643852c3 test(e2e): correct the audit seed comment (the tree cap is 1,000 rows) 2026-10-30 02:07:02 +08:00
Menghuan1918 f1323d6c57 chore(e2e): launch dsh web with --no-open and add the opt-in page/API perf audit 2026-10-30 02:01:47 +08:00
Menghuan1918 2c48ff451d test(e2e): match the visible preview copy, not the hidden editor's (mount-lane flake) 2026-10-30 00:20:29 +08:00
Menghuan1918 7bff1a1cb4 merge fix/949-951: block archiving side threads (#949), keep sidebar_open registered while settings are unreadable (#951) 2026-10-29 23:53:34 +08:00
Menghuan1918 d77adf25e3 merge fix/1009-card-toggles: hidden tab types are not settings cards (#1009) 2026-10-29 23:53:10 +08:00
Menghuan1918 d7483f6b33 fix(sidechat): disable archiving a side thread the host can never recover (#949)
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.
2026-10-29 23:51:47 +08:00
Menghuan1918 af0e7b7c9d fix(host): keep sidebar_open registered when the settings row is unreadable (#951)
The gate read an absent settings row (the host only lists entries whose fiber is ACTIVE) as the schema default false and unregistered a live tool mid-session. Read the switch tri-state instead: only an explicit boolean is a decision, so an absent row or a thrown read keeps the current registration.
Also re-evaluate right after a settings write and after the loader settles, so enabling the feature registers the tool for the first turn instead of waiting for an unrelated settings.get.
2026-10-29 23:51:45 +08:00
Menghuan1918 15b51ca55e fix(settings): stop inventorying programmatic-only tab types (#1009)
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.
2026-10-29 23:48:23 +08:00
Menghuan1918 dcd5cf66b1 merge fix/1014-panel-host-dvh: use 100dvh for the panel host (#1014) 2026-10-29 23:45:22 +08:00
Menghuan1918 eb7edb0818 fix(panel-host): 宿主高度改用 100dvh 回退 100vh,修掉手机端整页可拖动(#1014)
`height: 100vh` 取的是大视口:手机浏览器地址栏展开时该层比布局视口
(innerHeight)高,挂载自检把 rect.height 与 innerHeight 的差值当成页面级
transform,降级为 position:absolute 后高度计入文档并持续触发自检,整页可
上下拖动且不自愈。dvh 跟随动态视口(即 innerHeight),声明在 vh 之后;
不支持 dvh 的引擎在解析期丢弃该行、保留 vh,即 #616 的修复不变。

tests/panel-host-css.spec.ts 把高度声明整表钉为
['height: 100vh', 'height: 100dvh'],级联顺序即契约。
2026-10-29 23:44:40 +08:00
Menghuan1918 04c6cb8a10 merge review/mermaid-frame: #1040 sandbox-iframe mermaid layout isolation 2026-10-29 23:43:11 +08:00
Menghuan1918 ac8fcd5516 merge review/path-roots: #1079 UNC prefix, #1070 subdirectory session root 2026-10-29 23:42:13 +08:00
Menghuan1918 88c86abb11 merge review/markdown-links: #1067 angle-bracket link destinations, #1074 Side Chat local source links 2026-10-29 23:42:06 +08:00
Menghuan1918 2e691142da merge review/1083-editor-draft: #1083 confirm before an in-place file switch drops an unsaved draft 2026-10-29 23:41:57 +08:00
Menghuan1918 b1c33577be merge review/html-preview-mime: #972 serve preview assets with real MIME types 2026-10-29 23:41:47 +08:00
Menghuan1918 51f8cebda5 merge review/menu-submenu: #974 close the reduced-motion media query, #988 submenu flip tokens for Git More Actions 2026-10-29 23:41:37 +08:00
Menghuan1918 e17ab5c52e merge: keep the UNC prefix when folding separators (#1079) 2026-10-29 23:36:41 +08:00
Menghuan1918 845837f958 merge: keep a subdirectory session cwd (#1070) 2026-10-29 23:36:10 +08:00
Menghuan1918 56560e24a1 test(active-worktree): pin a subdirectory session cwd as the root (#1024) 2026-10-29 23:35:42 +08:00
Menghuan1918 e290059fd5 test(markdown): pin angle-delimited destination semantics with spaces 2026-10-29 23:31:27 +08:00
Menghuan1918 f1d52c9241 merge: PR #1074 (Side Chat local source links) 2026-10-29 23:31:01 +08:00
Menghuan1918 e790701791 fix(git): publish submenu flip tokens for More Actions (#988)
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.
2026-10-29 23:29:02 +08:00
Menghuan1918 27e9417e63 merge: PR #966 — bounded retry for concurrent same-name upload rename contention 2026-10-29 23:28:16 +08:00
Menghuan1918 fbc7e4cd1b merge: PR #1032 — fix TDZ crash when probe spawn throws synchronously 2026-10-29 23:28:13 +08:00
Menghuan1918 92b6ddc0e2 merge: PR #922 — keep same-pane tab when dragging its only tab back 2026-10-29 23:28:08 +08:00
Menghuan1918 5834120350 merge: PR #1067 (angle-delimited inline link destinations, #1015) 2026-10-29 23:27:20 +08:00
Menghuan1918 a2a0dee305 Merge branch 'pr-972' into review/html-preview-mime 2026-10-29 23:27:19 +08:00
Menghuan1918 6f74c7ee2f merge: PR #974 close the reduced-motion media query (#955) 2026-10-29 23:26:08 +08:00
unsc9 6caec31d83 test: give the aggregate-auth shell probe a Windows-sized timeout 2026-10-29 10:47:58 +08:00
unsc9 10ccebb052 test: let detached archive packs land before cleanup 2026-10-29 10:22:14 +08:00
unsc9 ae71cd05e6 test(editor): cover the three no-prompt switch branches 2026-10-29 09:10:44 +08:00
unsc9 9f92bff245 test: widen the Windows temp-tree cleanup retry budget
The ci-windows lane failed in archive.spec.ts's afterEach with ENOTEMPTY after the test had passed. The same cleanup flaked on 2026-10-15; the existing 10x50 ms retry budget is too short on a loaded runner. Raise it to 30x100 ms; POSIX still succeeds on the first attempt.
2026-10-28 22:32:03 +08:00
unsc9 00553e2484 fix: confirm before in-place file switch drops an unsaved draft
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.
2026-10-28 21:21:58 +08:00
OCILY d7925a87d9 fix(mermaid): separate diagram errors from frame failures and validate the frame protocol
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.
2026-10-28 20:20:50 +08:00
OCILY 7c1e67193d fix(mermaid): show the mermaid error itself when a diagram fails
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.
2026-10-28 20:20:49 +08:00
OCILY fe06211775 fix(mermaid): isolate diagram layout in a sandboxed iframe
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.
2026-10-28 20:20:49 +08:00
yanzoro926 0659016aee fix(paths): keep the UNC prefix when folding separators
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.
2026-10-28 07:57:53 +00:00
taekchef 60c3fff158 merge: integrate Sidebar provider PR #1033 with current dev 2026-10-28 14:40:13 +08:00
CCColastic cff738b23b fix(sidechat): render and open local source file links 2026-10-28 11:14:56 +08:00
hy5424 c03adfa628 fix: keep a session cwd that is a subdirectory of the repository
pathUnderOf(base, target) answers "is target under base", so the
effectiveBase guard has to be called as (canonicalTop, base). It was
called as (base, canonicalTop), which asks the opposite question and
always fell back to the repository toplevel — every workspace-relative
path opened through the sidebar then resolved one level too high
(deliverable cards reported cannot read ... ENOENT).

Also adds the regression case the suite was missing: a workspace
registered at a plain SUBDIRECTORY of the repository (base != top).
2026-10-27 22:19:32 +08:00
taekchef fc717fbbff merge origin/main into genui-sidechat-surface: keep main's row-level rewrite pass and streaming parse inside the GenUI row component 2026-10-27 11:39:58 +08:00
Menghuan1918 f7a11ddbfe fix(host): root a detached session at its stored header, not a full log read
cwdOf() resolves the cwd for every file/Git route, and a cold (detached)
session paid one host observation per call: sessionQuery.observeSession({
projectionMode: 'all' }) decodes the whole zstd artifact and hydrates every
projection to answer with one workingDirectory string. The 0.28.1
single-flight only covered /sidebar/api, while the real startup fan-out
never goes through it: the fs-watch socket sends one frame PER WATCHED
DIRECTORY (server resolves cwd before it even reads the op), /sidebar/file
and /sidebar/html resolve per resource, upload/write per call. A 39 MB
session was therefore decoded dozens of times in parallel — 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.

A detached session now resolves through sessionPersistence.stat(), which
reads the first zstd frame only (header-only, never the log), memoized per
session id (headers are immutable) and shared in-flight across concurrent
asks. activeWorktreeRootOf() answers a detached session with that address
and no longer folds the stored log. Once the host attaches the session the
committed working_directory and linked-worktree following resume as before.

Trade-off (documented): until attach, the sidebar roots at the original
project rather than the agent's last directory/worktree.

tests/smoke.spec.ts rewrites the cwd group (header ahead of a stale hint,
one header read per session, 12 concurrent asks share one, stat absent or
failing falls back to the hint, live committed directory wins, relative
header cwd still refused) and tests/active-worktree.spec.ts pins that a
detached session performs no persistence read and no git probe.
2026-10-27 11:36:09 +08:00
Nyarlathoteppppp e88456a2cd fix(markdown): 修复行内链接尖括号目标被追加问号 2026-10-27 12:37:14 +11:00
Menghuan1918 7ecf6a14af perf(host): share one cold cwd read across concurrent /sidebar requests
cwdOf() resolves the session cwd for all twelve /sidebar routes. On a
detached session every call runs one host observation — the whole log read
plus decode — and the host's cold cache only helps AFTER a read completes,
so a session-switch burst decoded the same multi-MB log N times in parallel
(0.28.0: 39 MB × 44 requests ≈ 1.7 GB, OOM). Concurrent asks for the same
session + client cwd hint now share ONE resolution; there is no TTL (the
host already caches completed cold reads by persistence revision), and the
hint stays in the key so different fallbacks never leak across each other.

tests/smoke.spec.ts pins 12 concurrent calls → 1 observeSession (red before
this change: expected 12 to be 1) and the per-hint key. The dock-fallback
reserve test now clears localStorage per case — a previous case persisted
bottomOpen and made the new click toggle it closed.
2026-10-26 17:51:30 +08:00
Menghuan1918 6e29d91bec test(e2e): 选区引用改为 chip 后更新 @ 引用 e2e 断言
#1052 把「添加到对话」的多行选区改成引用 chip(正文只在发送时展开),
#1002 留下的 mount e2e 仍按旧的 plain-text 围栏断言(3 chips + 围栏正文),
合并后 plugin-mount 在真实 DSH 上红:实际 4 chips。改为断言第 4 枚 chip
落地、label 带来源文件、且不产生 plain-text reference;围栏正文的逐字
载荷由 tests/selection-payload.spec.ts 在单测层钉住。

验证:本地 (真实 DSH 0.2.1-rc.1)1 passed。
2026-10-26 15:39:40 +08:00
Menghuan1918 fd8a09d96b merge #992: 桌面壳兜底入口避开标题栏左侧系统按钮(红绿灯) 2026-10-26 15:26:46 +08:00
Menghuan1918 c908959f3d fix(sidebar): 桌面壳兜底入口避开标题栏左侧系统按钮(#992)
macOS 桌面壳的原生红绿灯不在 elementsFromPoint 命中栈里,旧走查退到
视口左缘 left=4 时会把它压住。现在 darwin(非全屏、标题栏行)把左移
下限抬到宿主标题栏保留区 88px;下限之上仍无空位时接受与宿主内容重叠,
不隐藏空白会话唯一的底部工作台入口。web 行为仍是原来的 100 步有界走查。

tests/dock-fallback.spec.tsx 补 3 例:桌面占满时 left >= 88 且入口可点、
原生控件不在命中栈时同样避开保留区、web 占满时仍停在原位置。
2026-10-26 15:26:44 +08:00