Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

test(chat): synchronize selection menu checks and ADR index

Linuxdazhao9be26c5c408e
diff --git a/apps/desktop/test/chat-context-menu-surface.test.mjs b/apps/desktop/test/chat-context-menu-surface.test.mjs
index 18fa1c825..2c911299d 100644
--- a/apps/desktop/test/chat-context-menu-surface.test.mjs
+++ b/apps/desktop/test/chat-context-menu-surface.test.mjs
@@ -39,11 +39,11 @@ test("the pointer-anchored menu portals, measures, and closes without trapping f
assert.match(menuSource, /event\.key !== "ArrowRight"/);
assert.match(menuSource, /event\.key === "ArrowLeft"/);
assert.match(menuSource, /role="menu"[\s\S]*aria-label=\{label\}/);
- assert.match(menuSource, /if \(!request\.items\.length\) return;/);
+ assert.match(menuSource, /if \(!request\.items\.length && !selectionItems\) return;/);
});
test("the transcript owns one menu and each speaking row can open it", () => {
- assert.match(transcriptSource, /<TranscriptMenuProvider>/);
+ assert.match(transcriptSource, /<TranscriptMenuProvider\s+sessionId=\{/);
assert.match(transcriptSource, /onContextMenu=\{onContextMenu\}/);
assert.match(transcriptSource, /conversationMenuItems\(/);
assert.match(messageRowSource, /onContextMenu=\{onContextMenu\}/);
diff --git a/docs/adr/README.md b/docs/adr/README.md
index afc81bc4c..02b9b24c2 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -421,3 +421,4 @@ git history.
| chinese-docs-entry-points-only | [Chinese documentation keeps entry points only](chinese-docs-entry-points-only.md) | Accepted; amends ADR 0079 |
| windows-native-snap-without-frame-insets | [Restore Windows snapping without Electron frame insets](windows-native-snap-without-frame-insets.md) | Accepted (issue #2330; amends ADR 0317) |
| plan-approval-session-permission | [Plan approval defaults to the owning Session's permission](plan-approval-session-permission.md) | Accepted; amends ADR 0053 and ADR 0158 |
+| plugin-transcript-selection-views | [Docked views can accept transcript selections](plugin-transcript-selection-views.md) | Accepted (issue #2395) |
diff --git a/docs/adr/plugin-transcript-selection-views.md b/docs/adr/plugin-transcript-selection-views.md
index fe381d461..601fdc917 100644
--- a/docs/adr/plugin-transcript-selection-views.md
+++ b/docs/adr/plugin-transcript-selection-views.md
@@ -4,6 +4,12 @@
- Date: 2026-11-19
- Related: ADR 0104, ADR 0268, GitHub #2395
+## Context
+
+A plugin can open its own docked view, but it has no menu item for an excerpt
+selected in the transcript. The user should be able to choose where one
+excerpt goes from the message menu.
+
## Decision
A contributed docked view can opt into the transcript selection menu with
@@ -12,6 +18,8 @@ existing icon token. A user click opens that view and delivers the excerpt
and active session ID in a one-way `view:selection` event. The host keeps
pending excerpts in memory until the target view finishes loading.
+## Consequences
+
This extends the work-panel view contract. It leaves the retired native quote
and side-chat actions out of the host. An opt-in requires the existing
`ui.view` grant and project activation. It does not give a plugin a selection