Skip to content

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

fix(chat): give plan approval and retry hover an opaque plate

vastsa1dfad0dd4326
diff --git a/apps/desktop/src/styles/composer.css b/apps/desktop/src/styles/composer.css
index d014fdf5f..ff337e793 100644
--- a/apps/desktop/src/styles/composer.css
+++ b/apps/desktop/src/styles/composer.css
@@ -548,7 +548,9 @@
}
/* Plan approval surface. Keep the gate in the composer layer so it remains
- adjacent to the input and follows the same container width as the dock. */
+ adjacent to the input and follows the same container width as the dock.
+ The dock itself is transparent, so this plate uses the composer elevated
+ fill and shadow rather than the in-flow `--ds-tile` wash. */
.plan-approval-bar {
display: grid;
width: 100%;
@@ -559,7 +561,8 @@
margin-bottom: 8px;
padding: 7px 9px;
border-radius: var(--radius-md);
- background: var(--ds-tile);
+ background: var(--ds-bg-composer);
+ box-shadow: var(--ds-shadow-composer);
}
.plan-approval-copy {
diff --git a/apps/desktop/src/styles/messages.css b/apps/desktop/src/styles/messages.css
index 486059111..f2db1285c 100644
--- a/apps/desktop/src/styles/messages.css
+++ b/apps/desktop/src/styles/messages.css
@@ -333,7 +333,8 @@
/* The retry reason borrows the assistant error card's hierarchy without
adding a second transcript row. It is hover/focus-only so the active row
- remains compact at rest. */
+ remains compact at rest. The in-flow `.message-error` wash is transparent;
+ this floating tooltip mixes the same tint over an opaque elevated plate. */
.run-activity-error-popover.message-error {
position: absolute;
bottom: calc(100% + 8px);
@@ -342,6 +343,7 @@
display: block;
width: min(360px, calc(100vw - 32px));
padding: 10px 12px;
+ background: color-mix(in oklab, var(--ds-error) 10%, var(--ds-bg-elevated-opaque));
box-shadow: var(--ds-shadow-dialog);
opacity: 0;
pointer-events: none;
diff --git a/apps/desktop/test/active-turn-surface.test.mjs b/apps/desktop/test/active-turn-surface.test.mjs
index dd6964114..f1952bb10 100644
--- a/apps/desktop/test/active-turn-surface.test.mjs
+++ b/apps/desktop/test/active-turn-surface.test.mjs
@@ -75,6 +75,10 @@ test("active turns show immediate and phase-specific feedback without a progress
assert.match(messagesStyles, /\.run-activity-indicator\[data-phase="recovering"\]/);
assert.match(messagesStyles, /\.run-activity-indicator\[data-phase="retrying"\]/);
assert.match(messagesStyles, /\.run-activity-error-popover\.message-error/);
+ assert.match(
+ messagesStyles,
+ /\.run-activity-error-popover\.message-error \{[\s\S]*?background:\s*color-mix\(in oklab,\s*var\(--ds-error\)[^;]*var\(--ds-bg-elevated-opaque\)/,
+ );
assert.match(
messagesStyles,
/\.run-activity-retry-reason:hover[\s\S]*\.run-activity-error-popover/,
diff --git a/apps/desktop/test/plan-mode-source-contract.test.mjs b/apps/desktop/test/plan-mode-source-contract.test.mjs
index b0b2cd782..6f8dac68c 100644
--- a/apps/desktop/test/plan-mode-source-contract.test.mjs
+++ b/apps/desktop/test/plan-mode-source-contract.test.mjs
@@ -11,7 +11,7 @@ import { readFile } from "node:fs/promises";
import test from "node:test";
const read = (path) => readFile(new URL(path, import.meta.url), "utf8");
-const [apiSource, appSource, composerSource, settingsSource, commandsSource, storeSource, surfaceSource, transcriptSource, barSource, topbarSource, componentSpec, englishSource, chineseSource, planStateSource] =
+const [apiSource, appSource, composerSource, settingsSource, commandsSource, storeSource, surfaceSource, transcriptSource, barSource, topbarSource, componentSpec, englishSource, chineseSource, planStateSource, composerCss] =
await Promise.all([
read("../src/lib/api.ts"),
readAppSource(),
@@ -27,6 +27,7 @@ const [apiSource, appSource, composerSource, settingsSource, commandsSource, sto
read("../../../packages/i18n/src/locales/en/index.ts"),
read("../../../packages/i18n/src/locales/zh-CN/index.ts"),
read("../src/lib/plan-mode-state.ts"),
+ read("../src/styles/composer.css"),
]);
const eventsSource = readStoreModuleSync("slices/events-slice.ts");
const interactionSource = readStoreModuleSync("slices/interaction-slice.ts");
@@ -140,6 +141,7 @@ test("the component spec assigns mode ownership to Composer", () => {
assert.doesNotMatch(topbarSpec, /Agent \| Plan|mode toggle|mode indicator/);
assert.match(composerSpec, /combined model ×\s+reasoning-level control/);
assert.match(composerSpec, /Composer-left Agent\/Plan\/Goal chip is the sole mode/);
+ assert.match(composerSpec, /--ds-bg-composer/);
});
test("plan approval sends exact identities and waits for host confirmation", () => {
@@ -174,6 +176,13 @@ test("plan approval sends exact identities and waits for host confirmation", ()
assert.doesNotMatch(resolveBlock, /finally[\s\S]*pendingPlans/);
});
+test("plan approval bar paints the composer plate over the transparent dock", () => {
+ const barRule = composerCss.match(/\.plan-approval-bar \{[\s\S]*?\n\}/)?.[0] ?? "";
+ assert.match(barRule, /background:\s*var\(--ds-bg-composer\)/);
+ assert.match(barRule, /box-shadow:\s*var\(--ds-shadow-composer\)/);
+ assert.doesNotMatch(barRule, /--ds-tile\b/);
+});
+
test("terminal Plan checkpoints stop rendering the approval bar", () => {
for (const status of ["rejected", "expired", "interrupted", "approved", "queued", "running"]) {
assert.match(planStateSource, new RegExp(`"${status}"`));
diff --git a/docs/spec/04-ux/03-permission-ux.md b/docs/spec/04-ux/03-permission-ux.md
index 3994ff038..f7095e49a 100644
--- a/docs/spec/04-ux/03-permission-ux.md
+++ b/docs/spec/04-ux/03-permission-ux.md
@@ -146,7 +146,9 @@ the permission runtime.
Plan and Goal approval are not generic tool permission cards. They are rendered
inline in the originating session after `SubmitPlan(...)` or `SubmitGoal(...)`
causes host-core to preserve the exact Markdown bytes in a new immutable
-`.pi/plan/*.md` or `.pi/goal/*.md` artifact.
+`.pi/plan/*.md` or `.pi/goal/*.md` artifact. The card sits in the transparent
+composer dock, so it paints `--ds-bg-composer` with `--ds-shadow-composer`
+rather than the in-flow `--ds-tile` wash.
The card shows only the structured title and an opener for the exact artifact
path. It does not render the submitted question/description, status, or
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 5f344eb4e..ce6086a45 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -749,7 +749,7 @@ reading surface of the workstation.
|---|---|
| Empty | Restrained hero + optional onboarding checklist in a scrollable content region, with a bottom-reserved home composer and no starter-card or contextual quick-action layer (D111/D204/D206). A project-bound empty session underlines the project name; the control opens a searchable switcher of the sidebar's open projects, with clone-git-project and open-project actions. |
| Streaming | Auto-scroll follows while pinned; new tokens append |
-| Active progress | Immediately after send, before the first assistant or tool event, a compact localized `Working…` status with elapsed time appears inline. Its model and subagent elapsed labels use the carried-unit format in §9.1. When the runtime names a quiet interval, that same row identifies starting, waiting for the model, preparing the next request, compacting context, recovering an empty response, retrying, or waiting for delegated work (with each running subagent's latest coarse action). It yields to concrete thinking, tool, and answer rows, while a permission card owns the approval state; no large generic progress card is rendered. The row lives in the reserved tail lane, so it appears and clears mid-turn without changing the transcript's content height. A retrying row remains compact at rest; hovering or focusing it reveals an error-styled tooltip with the localized error summary, stable code/HTTP status, and bounded provider message. |
+| Active progress | Immediately after send, before the first assistant or tool event, a compact localized `Working…` status with elapsed time appears inline. Its model and subagent elapsed labels use the carried-unit format in §9.1. When the runtime names a quiet interval, that same row identifies starting, waiting for the model, preparing the next request, compacting context, recovering an empty response, retrying, or waiting for delegated work (with each running subagent's latest coarse action). It yields to concrete thinking, tool, and answer rows, while a permission card owns the approval state; no large generic progress card is rendered. The row lives in the reserved tail lane, so it appears and clears mid-turn without changing the transcript's content height. A retrying row remains compact at rest; hovering or focusing it reveals an error-styled tooltip with the localized error summary, stable code/HTTP status, and bounded provider message. The tooltip mixes the error tint over `--ds-bg-elevated-opaque` so transcript text does not show through. |
| Turn outcome | After a failed turn, a session-scoped recovery card summarizes the interruption and tool evidence. Completed turns use the existing transcript and message-scoped InlineReviewCard without an extra success card; failed turns can continue through one localized prompt without losing the transcript. |
| Session switch | A first-opened session paints at its latest record; a revisited pane paints at its own retained position. Bounded first commit and full-history expansion show the same position: no post-paint height correction may shift the visible rows, in either direction |
| Turn start (send / retry / regenerate) | Re-pins and positions the latest content before paint, even if the user had scrolled up; the later persisted user-message event does not flash the transcript at its top, and the composer collapse / indicator layout clamps during the send never release follow mode |
@@ -2711,7 +2711,9 @@ reasoning-level control.
- Goal shares the Plan approval surface (D198). The bar reads its copy from the
proposal's `kind`, so a goal contract shows the matching approval label and
artifact opener while the layout and remembered permission split-button stay
- identical.
+ identical. The bar sits in the transparent composer dock, so it paints
+ `--ds-bg-composer` with `--ds-shadow-composer` like queued prompt rows rather
+ than the in-flow `--ds-tile` wash.
### 11.6 Accessibility
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index a3890c940..1357960dd 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -5597,6 +5597,24 @@ identify the platform validation still needed.
entered CDP or output. The default no-key run remains 5/5 with the live case
explicitly skipped.
+#### E2E-CHAT-opaque-floating-decision-and-retry-surfaces: Plan approval and retry hover stay opaque
+
+- **Status**: Automated (`apps/desktop/test/plan-mode-source-contract.test.mjs`, `apps/desktop/test/active-turn-surface.test.mjs`)
+- **Priority**: P2
+- **Covers**: C, Quality / floating composer and retry surfaces
+- **Preconditions**: Renderer CSS is the production source under `apps/desktop/src/styles`.
+- **Steps**:
+ 1. Inspect `.plan-approval-bar` in the composer dock styles.
+ 2. Inspect `.run-activity-error-popover.message-error` in the transcript styles.
+ 3. Hover or focus a retrying active-turn row in a live session.
+- **Expected**:
+ - The Plan/Goal approval bar paints `--ds-bg-composer` with `--ds-shadow-composer` rather than the in-flow `--ds-tile` wash, so it remains a readable plate over the transparent composer dock.
+ - The retry hover tooltip mixes the error tint over `--ds-bg-elevated-opaque`, so transcript text does not show through.
+- **Specs linked**: `04-ux/03-permission-ux.md`, `04-ux/08-component-spec.md`
+- **Acceptance**: C, Quality
+- **Milestone**: M6
+- **Status detail**: Source contracts assert the CSS tokens. Live hover remains a visual check.
+
#### E2E-107: Plan approval uses one absolute 30-minute expiry
- **Preconditions**: A pending Plan request exists with a controllable clock.
@@ -7719,6 +7737,9 @@ identify the platform validation still needed.
| C — Conversation & stream (legacy subagent turn limit) | E2E-SUBAGENT-legacy-turn-limit-frontmatter-is-ignored |
| Quality (legacy subagent turn limit) | E2E-SUBAGENT-legacy-turn-limit-frontmatter-is-ignored |
| M6+ (disclosure reading position) | E2E-CHAT-disclosure-toggle-keeps-reading-position |
+| C — Conversation & stream (opaque floating surfaces) | E2E-CHAT-opaque-floating-decision-and-retry-surfaces |
+| Quality (opaque floating surfaces) | E2E-CHAT-opaque-floating-decision-and-retry-surfaces |
+| M6 (opaque floating surfaces) | E2E-CHAT-opaque-floating-decision-and-retry-surfaces |
The `US-UI-*` visual scenarios (§UI shell visual scenarios) trace to the
Codex parity decisions in [decisions-log §D](../08-meta/decisions-log.md)
diff --git a/docs/zh-CN/spec/04-ux/03-permission-ux.md b/docs/zh-CN/spec/04-ux/03-permission-ux.md
index 47cf136d0..e974e3aff 100644
--- a/docs/zh-CN/spec/04-ux/03-permission-ux.md
+++ b/docs/zh-CN/spec/04-ux/03-permission-ux.md
@@ -144,7 +144,9 @@ open/close 循环介入对话。
Plan 和 Goal 批准不是通用工具许可卡。它们被渲染
在 `SubmitPlan(...)` 或 `SubmitGoal(...)` 之后的原始会话中内联
导致 host-core 在新的不可变中保留确切的 Markdown 字节
-`.pi/plan/*.md` 或 `.pi/goal/*.md` 工件。
+`.pi/plan/*.md` 或 `.pi/goal/*.md` 工件。卡片位于透明的
+Composer 停靠栏上,因此使用 `--ds-bg-composer` 加 `--ds-shadow-composer`,
+而不是正文流里的 `--ds-tile` 薄洗。
该卡片仅显示结构化标题和确切工件的开场白
路径。它不会呈现提交的 question/description、状态或
diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.md
index 06e91ce92..cf392cdc3 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -583,7 +583,7 @@ expanded/collapsed 侧边栏仍为 20px/18px 且启动画面为 64 像素。
|---|---|
| 空 | 可滚动内容区域中的受约束的英雄+可选的入门清单,带有底部保留的主页输入框,没有入门卡或上下文快速操作层(D111/D204/D206) |
| 流媒体 | 固定时自动滚动;追加新标记 |
-| 积极进展 | 发送后,在第一个助手或工具事件之前,会内联显示一个紧凑的本地化 `Working…` 状态以及经过的时间。它屈服于具体的思维、工具和答案行,而权限卡拥有批准状态;不会渲染大型通用进度卡。 |
+| 积极进展 | 发送后,在第一个助手或工具事件之前,会内联显示一个紧凑的本地化 `Working…` 状态以及经过的时间。它屈服于具体的思维、工具和答案行,而权限卡拥有批准状态;不会渲染大型通用进度卡。重试行在静止时保持紧凑;悬停或聚焦会弹出错误色 tooltip,底板为 `--ds-bg-elevated-opaque`,避免透出记录正文。 |
| 回合结果 | 回合失败后,会话范围的恢复卡会总结中断和工具证据。已完成的轮次使用现有的记录和消息范围的 InlineReviewCard,无需额外的成功卡;失败的回合可以重试而不会丢失转录本。 |
| 会话切换 | 首次打开的会话在它最新的记录处绘制;重新访问的面板在它自己保留的位置处绘制。有界的首次提交与全量历史展开显示同一个位置:绘制之后的高度校正不得在任何方向上移动可见行 |
| 启动(发送/重试/重新生成) | 即使用户向上滚动,在绘制之前重新固定和定位最新内容;后来保留的用户消息事件不会在其顶部闪烁记录,并且发送期间的输入框折叠/指示器布局夹紧永远不会释放跟随模式 |
@@ -1899,7 +1899,9 @@ MainChat 底部的输入区域,用于撰写和发送提示。支持多行输
- Goal 共享 Plan 批准表面 (D198)。操作栏从以下位置读取其文案
提案的 `kind`,因此目标合约显示匹配的批准标签和
神器开启器,而布局和记住权限拆分按钮保持不变
- 相同。
+ 相同。该栏位于透明 Composer 停靠栏上,因此使用
+ `--ds-bg-composer` 加 `--ds-shadow-composer`,而不是正文流里的
+ `--ds-tile` 薄洗。
### 11.6 辅助功能
diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 750a99ede..dcd77d94a 100644
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@ -3758,6 +3758,24 @@ IPC 请求无法关闭。
输入 CDP 或输出。默认无钥匙运行仍为 5/5 与现场案例
明确跳过。
+#### E2E-CHAT-opaque-floating-decision-and-retry-surfaces:Plan 审批条与重试 hover 保持不透明
+
+- **状态**:已自动化(`apps/desktop/test/plan-mode-source-contract.test.mjs`、`apps/desktop/test/active-turn-surface.test.mjs`)
+- **优先级**:P2
+- **覆盖**:C、品质 / 浮动 Composer 与重试表面
+- **先决条件**:渲染器 CSS 为 `apps/desktop/src/styles` 下的生产源。
+- **步骤**:
+ 1. 检查 Composer 停靠栏样式中的 `.plan-approval-bar`。
+ 2. 检查记录样式中的 `.run-activity-error-popover.message-error`。
+ 3. 在实时会话中悬停或聚焦正在重试的活动行。
+- **预期**:
+ - Plan/Goal 审批条使用 `--ds-bg-composer` 加 `--ds-shadow-composer`,而不是正文流里的 `--ds-tile` 薄洗,因此在透明停靠栏上仍可读。
+ - 重试 hover tooltip 把错误色混在 `--ds-bg-elevated-opaque` 上,记录正文不会透出。
+- **链接规格**:`04-ux/03-permission-ux.md`、`04-ux/08-component-spec.md`
+- **接受**:C、品质
+- **里程碑**:M6
+- **状态细节**:源码契约断言 CSS 标记。实时悬停仍为目视检查。
+
#### E2E-107:Plan 批准使用一个绝对 30 分钟到期时间
- **先决条件**:存在带有可控时钟的待处理 Plan 请求。
@@ -4971,6 +4989,9 @@ IPC 请求无法关闭。
| C — 对话和直播(旧版子代理回合上限) | E2E-SUBAGENT-legacy-turn-limit-frontmatter-is-ignored |
| 品质(旧版子代理回合上限) | E2E-SUBAGENT-legacy-turn-limit-frontmatter-is-ignored |
| M6+(展开详情保持阅读位置) | E2E-CHAT-disclosure-toggle-keeps-reading-position |
+| C — 对话与流式(不透明浮动表面) | E2E-CHAT-opaque-floating-decision-and-retry-surfaces |
+| 品质(不透明浮动表面) | E2E-CHAT-opaque-floating-decision-and-retry-surfaces |
+| M6(不透明浮动表面) | E2E-CHAT-opaque-floating-decision-and-retry-surfaces |
`US-UI-*` 视觉场景(§UI shell 视觉场景)追踪到
[决策日志 §D](/zh-CN/spec/08-meta/decisions-log) 中的法典平价决策