Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(chat): 保持运行提示可见并移除助手空操作栏 (#684)
咕噜水蜜桃07b2ab8350b3
diff --git a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsxindex f7137bd32..99aa48642 100644--- a/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx+++ b/apps/desktop/src/features/chat/transcript/ActivityGroup.tsx@@ -461,7 +461,7 @@ export const ActivityGroup = memo(function ActivityGroup({);}, activityGroupPropsEqual);-/** Keep the transcript responsive while the model waits for its first event. */+/** Keep the running turn visible when no more specific runtime phase is known. */export function WorkingIndicator({ startedAt }: { startedAt?: number } = {}) {const { t } = useTranslation();const [elapsed, setElapsed] = useState(0);diff --git a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsxindex 035bbd310..23e77180e 100644--- a/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx+++ b/apps/desktop/src/features/chat/transcript/AssistantTurn.tsx@@ -386,31 +386,25 @@ export const AssistantTurn = memo(function AssistantTurn({responseOutputTokens={responseOutputTokens}/>) : null}- {(content || hasError) && actionMessage ? (+ {complete && actionMessage ? (<div className="message-actions">- {complete ? (- <CopyButton text={content} label={t("chat.copy")} />- ) : null}- {complete ? (- <TooltipButton- className="copy-btn icon"- tooltip={t("chat.forkResponse")}- ariaLabel={t("chat.forkResponse")}- onClick={() => void forkAssistantMessage(actionMessage.id)}- >- <IconBranch size={13} />- </TooltipButton>- ) : null}- {complete ? (- <TooltipButton- className="copy-btn icon"- tooltip={t("chat.retry")}- ariaLabel={t("chat.retry")}- onClick={() => void retryAssistantMessage(actionMessage.id)}- >- <IconReview size={13} />- </TooltipButton>- ) : null}+ <CopyButton text={content} label={t("chat.copy")} />+ <TooltipButton+ className="copy-btn icon"+ tooltip={t("chat.forkResponse")}+ ariaLabel={t("chat.forkResponse")}+ onClick={() => void forkAssistantMessage(actionMessage.id)}+ >+ <IconBranch size={13} />+ </TooltipButton>+ <TooltipButton+ className="copy-btn icon"+ tooltip={t("chat.retry")}+ ariaLabel={t("chat.retry")}+ onClick={() => void retryAssistantMessage(actionMessage.id)}+ >+ <IconReview size={13} />+ </TooltipButton></div>) : null}</div>diff --git a/apps/desktop/src/features/chat/transcript/ChatTranscript.tsx b/apps/desktop/src/features/chat/transcript/ChatTranscript.tsxindex 54bb02f88..2fa0fc44d 100644--- a/apps/desktop/src/features/chat/transcript/ChatTranscript.tsx+++ b/apps/desktop/src/features/chat/transcript/ChatTranscript.tsx@@ -147,45 +147,24 @@ function TranscriptBody({readingWindow,});- const lastEntry = tailEntry;- const lastTurnPart =- lastEntry?.kind === "assistant-turn" ? lastEntry.parts.at(-1) : undefined;- const activeToolGroup = transcriptRunning && lastTurnPart?.kind === "activity";- const assistantIsAnswering =- lastTurnPart?.kind === "message" &&- lastTurnPart.message.status === "streaming" &&- Boolean((lastTurnPart.message.content || "").trim());const specializedActivity = agentActivity;const hasSpecializedActivity = specializedActivity !== undefined;- const showRunActivity =+ // Existing output does not mean the turn has finished: a text stream can+ // pause, and completed tool rows can outlive their activity. Keep one tail+ // status until the turn ends or a user interaction owns the pending state.+ const showStatus =transcriptRunning &&!pendingPermission &&!askPending &&- !approvalPending &&- !assistantIsAnswering &&- hasSpecializedActivity;- // Show immediate feedback after send, then let the concrete activity row- // (thinking/tool/answer) take over so the transcript never duplicates state.+ !approvalPending;+ const showRunActivity = showStatus && hasSpecializedActivity;const showWorking =- transcriptRunning &&- !pendingPermission &&- !askPending &&- !approvalPending &&+ showStatus &&planningState !== "planning" &&- !activeToolGroup &&- !assistantIsAnswering &&!hasSpecializedActivity;- // Same pre-stream slot as Working: once tools or an answer exist, activity- // rows carry the live state so a Planning label does not sit orphaned above- // the composer. The Composer mode chip keeps pulsing for the turn.const showPlanning =- transcriptRunning &&+ showStatus &&planningState === "planning" &&- !approvalPending &&- !pendingPermission &&- !askPending &&- !activeToolGroup &&- !assistantIsAnswering &&!hasSpecializedActivity;// The tail status lane is part of the layout for the whole running turn: thediff --git a/apps/desktop/test/active-turn-surface.test.mjs b/apps/desktop/test/active-turn-surface.test.mjsindex f1952bb10..70ffa3c45 100644--- a/apps/desktop/test/active-turn-surface.test.mjs+++ b/apps/desktop/test/active-turn-surface.test.mjs@@ -49,7 +49,7 @@ test("active turns show immediate and phase-specific feedback without a progressassert.match(transcript, /\{showPlanning \? <PlanningIndicator kind=\{planningKind\} \/> : null\}/);assert.match(transcript,- /planningState === "planning"[\s\S]*!activeToolGroup[\s\S]*!assistantIsAnswering/,+ /planningState === "planning"[\s\S]*!hasSpecializedActivity/,);const planningBlock =transcript.match(/function PlanningIndicator\([\s\S]*?\n\}/)?.[0] ?? "";diff --git a/apps/desktop/test/transcript-style.test.mjs b/apps/desktop/test/transcript-style.test.mjsindex b1c9c12e6..373adec31 100644--- a/apps/desktop/test/transcript-style.test.mjs+++ b/apps/desktop/test/transcript-style.test.mjs@@ -319,7 +319,7 @@ test("message toolbars are icon-only with hover tooltips", () => {});test("streaming assistant turns hide answer copy until idle", () => {- assert.ok(transcriptSource.includes("{complete ? ("));+ assert.ok(transcriptSource.includes("{complete && actionMessage ? ("));assert.ok(transcriptSource.includes('<CopyButton text={content} label={t("chat.copy")} />',diff --git a/docs/adr/0198-quiet-interval-activity-phases.md b/docs/adr/0198-quiet-interval-activity-phases.mdindex dd77953f3..a60a7fbde 100644--- a/docs/adr/0198-quiet-interval-activity-phases.md+++ b/docs/adr/0198-quiet-interval-activity-phases.md@@ -40,9 +40,12 @@ targets:The renderer still draws one compact localized row with a monotonic phasetimer. A one-subagent wait names the agent and its latest action; a-multi-agent wait lists each running target. Thinking, tool, answer, and-permission surfaces continue to replace the row. No second progress card-or percentage is added.+multi-agent wait lists each running target. The renderer originally hid the+row behind thinking, tool, and answer surfaces. Issue #669 demonstrated that+those surfaces can remain unchanged while a turn is still running. The tail+row now remains visible until completion or pending user interaction, with+a Working or Planning/Goal fallback when no runtime phase is known. No second+progress card or percentage is added.## Consequencesdiff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 0b6974d31..6f9ddf65e 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -837,7 +837,7 @@ reasoning or changes model thinking configuration. See|---|---|| 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. The tooltip mixes the error tint over `--ds-bg-elevated-opaque` so transcript text does not show through. |+| 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 remains visible through thinking, tool execution, completed-tool gaps, and partial answers until the turn ends. Runtime phases take precedence over the Planning/Goal or Working fallback. Pending permissions, questions, and plan/goal approvals suppress the row; history reading never shows live status; 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 |@@ -1390,9 +1390,9 @@ storage but compose into one assistant turn until the next user message.| Session transition | A warm destination pane is revealed immediately with its retained content and position. If it is running or still holds a not-yet-flushed completed reply, its live renderer snapshot survives the durable revalidation read. A cold destination leaves the visible pane on its own session under a thin progress track until it commits; nothing is dimmed, hidden panes stay mounted and inert, and current stream updates are not deferred || Streaming | New tokens append; auto-scroll only while pinned to bottom || Turn start | Send / retry / regenerate re-pins follow mode and jumps to bottom |-| Thinking-only streaming | Transcript opens; the latest thinking disclosure opens unless the user has taken it over; no empty answer bubble or duplicate Working row |-| Pre-stream working | Compact animated-dot Working row until thinking, tools, or an answer exist |-| Pre-stream planning | Compact animated-dot Planning / Goal row in that same slot; the Composer mode chip pulses. Once tools or an answer exist, the transcript row yields so it does not sit orphaned above the composer |+| Thinking-only streaming | Transcript opens; the latest thinking disclosure opens unless the user has taken it over; no empty answer bubble; the tail status continues to identify the running turn |+| Running fallback | Compact animated-dot Working row throughout the running turn when no specific runtime phase or planning state is known, including pauses after partial output or completed tools |+| Running planning | Compact animated-dot Planning / Goal row in that same slot throughout the planning turn; a runtime phase takes precedence, and pending user interaction or turn completion hides it. The Composer mode chip pulses || Idle | Scrollable; no auto-scroll || Permission pending | PermissionCard inserted inline; transcript continues after resolution || Context checkpoint | Existing transcript remains visible; compaction adds one divider row after the message it covers and one warning toast |@@ -1410,6 +1410,14 @@ storage but compose into one assistant turn until the next user message.`role="article"` turn. The turn exposes one trailing meta row and one actiontoolbar; Copy joins all contentful fragments in order, while Fork andRegenerate use the last contentful assistant message as the durable boundary.+ The toolbar mounts only when those actions are available: active turns and+ turns with assistant errors reserve no empty toolbar box. Running feedback+ stays adjacent to the last output instead of sitting below invisible buttons.+ Preserve the normal 14px assistant bottom padding and the runtime lane's+ full reserve (24px from a plain-text fragment to its status label at the+ default scale). User messages retain their real hover-action row and normal+ spacing, including before the first assistant output. Opacity hides those+ buttons without removing their space, so hover does not shift content.- Toggle Thinking disclosure: expand/collapse reasoning independently from thefinal answer. The latest reasoning row opens while it streams and closes whenthe turn settles only if the user has not interacted with it. The expandeddiff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.mdindex f6aaa2080..47590b309 100644--- a/docs/spec/04-ux/09-interaction-patterns.md+++ b/docs/spec/04-ux/09-interaction-patterns.md@@ -611,9 +611,10 @@ may be retained while exactly one workspace supplies the visible shell context.quiet interval, that same row names the wait: starting, waiting for themodel, preparing the next request, compacting context, recovering an emptyresponse, retrying a provider request, or waiting for delegated work (with- each running subagent's latest coarse action). It is replaced by concrete- thinking/tool/answer feedback or the inline permission card as soon as one of- those states exists.+ each running subagent's latest coarse action). Existing thinking, tool, or+ answer output does not hide the row: the running turn keeps one tail status+ through output pauses. Pending permissions, questions, and plan/goal+ approvals suppress it; terminal turns and history reading have no live row.- When stream completes: cursor indicator replaced by success state (2s fade)### 2.2 Auto-scroll@@ -650,10 +651,10 @@ may be retained while exactly one workspace supplies the visible shell context.- An active turn keeps the lower transcript surface clear. Streamed assistantand tool rows remain inline with the transcript; no generic understanding,working, or checking card is rendered underneath them. A compact runtime- status row is the only exception, and appears only when it explains a quiet- interval that has no transcript row of its own: a provider wait or retry,- context compaction, silent-turn recovery, the gap before the next request,- or a delegated-work wait.+ status row remains in the reserved tail lane for the running turn. It shows+ the runtime phase when known, otherwise Planning/Goal or Working. Text and+ tool rows can stop changing while the turn remains active; their presence+ must not suppress that feedback. User-interaction waits suppress the row.- A permission card remains visible only when the agent is blocked on anexplicit approval. It is an actionable interruption, not a progress statuscard.@@ -885,8 +886,9 @@ Agent calls a permission-gated tool (including Plan/Goal Bash under Ask or AccepBrowserPreview are allowed; Bash follows the visible permission mode. Acontract-mode Bash command may mutate under Auto, so the mode chip remains visible.While that turn is live `planning`, the Composer mode chip pulses and a compact- Planning row occupies the same pre-stream slot as Working; tool or answer rows- replace that transcript row so it does not sit orphaned above the composer.+ Planning row occupies the same reserved tail slot as Working until completion+ or pending user interaction. A known runtime phase takes precedence; tool+ and answer output do not hide the running status.3. The Agent calls `SubmitPlan` or `SubmitGoal` alone in its tool batch.Host-core preserves the exact Markdown bytes in a new immutable`.pi/plan/*.md` or `.pi/goal/*.md` artifact, records its path/hash/size and structureddiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex fdf0d00eb..c5c4e5e72 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -854,10 +854,9 @@ identify the platform validation still needed.- **Preconditions**: Provider configured.- **Steps**: 1) Create new session. 2) Type a message. 3) Send.- **Expected**: The transcript immediately shows a compact localized `Working…`- status after send, before the first assistant or tool event. It yields to- concrete thinking/tool/answer feedback, or identifies a runtime-reported- model wait/retry when no transcript row can explain the delay. It disappears- when the turn ends.+ status after send, before the first assistant or tool event. It remains+ visible through thinking/tool/answer output, or identifies a runtime-reported+ wait. Pending user interaction suppresses it; it disappears when the turn ends.The conversation topbar keeps only the task title and window actions; it doesnot add a separate running-state indicator.- **Specs linked**: `03-runtime/02-agent-runtime.md`, `03-runtime/10-session-state-machine.md`@@ -3653,11 +3652,11 @@ identify the platform validation still needed.completion.- **Expected**: No generic Understanding, Working, Checking, or completioncard appears below the transcript while the turn is active. Assistant and- tool rows remain inline; a compact runtime status row may appear only when it- explains a quiet interval with no transcript row of its own (provider- wait/retry, compaction, silent-turn recovery, the gap before the next- request, or a delegated-work wait). Only an actual permission request renders- an actionable card.+ tool rows remain inline. One compact tail status remains visible throughout+ the running turn, including partial-answer pauses and completed-tool gaps.+ Runtime phases take precedence over Working or Planning/Goal; pending user+ interaction suppresses the status. Only an actual permission request renders+ an actionable permission card.Background activity never changes the visible session, transcript, composerfocus, or project.- **Specs linked**: `04-ux/08-component-spec.md`,@@ -4949,6 +4948,45 @@ identify the platform validation still needed.measures real geometry against; full provider streaming and shellresponsiveness remain Draft.+#### E2E-CHAT-running-status-survives-output-pauses++- **Preconditions**: Production `ChatTranscript`, real store and React DOM in+ Electron; deterministic messages/status transitions, no provider credentials.+- **Steps**: Send a turn, stream partial text, stop delivering deltas, start and+ finish a tool, clear/set runtime phases, resume text, then complete, stop, or+ fail. Repeat in detailed and compact modes. Exercise planning, permission,+ question and proposal waits, history reading, and switching sessions.+- **Expected**: Exactly one localized, accessible tail status remains through+ output pauses and completed-tool gaps. Runtime phases take precedence over+ Planning/Goal or Working. Pending user interaction suppresses it; terminal+ turns and history reading remove it. Switching sessions uses that session's+ status only. Existing content and permission actions remain available.+ Active and assistant-error turns mount no empty action toolbar. A partial+ answer has 24 CSS px between its fragment box and the status label+ at the default font scale; settled non-error content retains Copy, Fork,+ and Regenerate. Check detailed and compact modes. History reading and+ permission cards retain normal message padding. Ending a turn keeps pinned+ follow at the bottom while restoring the normal toolbar height. A scrolled-up reader keeps the exact text position+ and scroll offset.+- **Specs linked**: `04-ux/08-component-spec.md`, `04-ux/09-interaction-patterns.md`+- **Acceptance**: C (chat stream), Quality (interaction and accessibility)+- **Milestone**: M5+- **Status**: Automated by `pnpm test:e2e:transcript`+ (`scripts/e2e/transcript-status.tsx`). Reproduces issue #669 on upstream+ `ecece8f570fc0c18f21e4941eafe52244a7c6e5f`; no real-provider claim.++#### E2E-CHAT-initial-wait-spacing++- Send a user message before any assistant output: retain the original user+ action row and spacing (52px bubble-to-status in the default text fixture).+- At wide and narrow transcript widths, Copy remains focusable and pointer+ reachable; edit/delete/revision controls retain their disabled running state.+ Status and action hit targets never overlap, including revision pagers.+- Right-click the status/background for the conversation menu and the message+ for its own menu. Change runtime phase, receive first output, or stop before+ output: exactly one status follows the active turn and terminal actions return.+- Coverage: `scripts/e2e/transcript-status.tsx`, `pnpm test:e2e:transcript`.+#### E2E-CHAT-runtime-status-keeps-row-position- **Preconditions**: An active session whose transcript is taller than the@@ -4966,11 +5004,11 @@ identify the platform validation still needed.- **Expected**:- The waiting row occupies the reserved status lane: the content height,scroll height, scroll offset, and the position of every already-rendered row- are unchanged (within 0.01px) while the status appears and after it clears.- - The empty lane stays reserved and invisible — no background, border, or- shadow — in both the dark and light themes.+ are unchanged (within 0.01px) while Working switches to the named wait and back.+ - The lane stays reserved and transparent — no background, border, or+ shadow — in both themes. Clearing a runtime phase restores Working.- The status row keeps its live-region semantics (`role="status"`,- `aria-live="polite"`), while the empty lane carries no text to announce.+ `aria-live="polite"`); pending user interaction leaves the reserved lane empty.- An idle finished transcript renders no status lane at all, so its layout isunchanged.- **Specs linked**: `04-ux/08-component-spec.md`@@ -5717,9 +5755,9 @@ identify the platform validation still needed.mode, and the Composer chip does not pulse until that live state projects`planning`. After the terminal event flushes the configuration the session isdurable Plan with editable planning state, and the sent prompt surfaces the- `Plan / planning` indicator in the pre-stream slot while the chip pulses.- Once tools or an answer exist, the transcript planning row yields and the- chip pulse remains the live cue.+ `Plan / planning` indicator in the reserved tail slot while the chip pulses.+ Tools and answers do not hide it; runtime phases take precedence, and+ pending user interaction or turn completion suppresses it.- **Specs linked**: `03-runtime/02-agent-runtime.md`,`03-runtime/10-session-state-machine.md`, `04-ux/08-component-spec.md`- **Acceptance**: C (conversation/stream), Quality@@ -7702,7 +7740,7 @@ identify the platform validation still needed.| A — App startup | E2E-001, E2E-002, E2E-003, E2E-004, E2E-067, E2E-076, E2E-079, E2E-092, E2E-097, E2E-143, E2E-150, E2E-168, E2E-204 || A / C / F / Quality — Tray session navigation | E2E-TRAY-bounded-session-navigation || B — Model config | E2E-005, E2E-006, E2E-007, E2E-038, E2E-050, E2E-052, E2E-055, E2E-066, E2E-080, E2E-082, E2E-102c, E2E-102d, E2E-102e, E2E-151, E2E-154, E2E-163, E2E-166, E2E-172, E2E-174, E2E-197, E2E-005G, E2E-005J, E2E-199, E2E-201, E2E-202, E2E-203, E2E-205, E2E-206, E2E-209 |-| C — Conversation & stream | E2E-008, E2E-008d, E2E-008e, E2E-008a, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-031, E2E-040, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-052, E2E-053, E2E-054, E2E-055, E2E-059, E2E-059a, E2E-060c, E2E-060d, E2E-061, E2E-061a, E2E-062, E2E-064, E2E-065, E2E-068, E2E-071, E2E-073, E2E-074, E2E-075, E2E-081, E2E-083, E2E-084, E2E-086, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-106, E2E-109, E2E-111, E2E-114, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-121, E2E-218, E2E-259, E2E-219, E2E-AGENTS-001, E2E-142, E2E-144, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-161, E2E-162, E2E-166, E2E-172, E2E-173, E2E-174, E2E-177, E2E-178, E2E-179, E2E-180, E2E-182, E2E-183, E2E-187, E2E-198, E2E-199, E2E-202, E2E-203, E2E-207, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-102i, E2E-PLUGIN-session-orchestrator-real-workers, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-SUBAGENT-resume-a-settled-delegation |+| C — Conversation & stream | E2E-CHAT-running-status-survives-output-pauses, E2E-008, E2E-008d, E2E-008e, E2E-008a, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-031, E2E-040, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-052, E2E-053, E2E-054, E2E-055, E2E-059, E2E-059a, E2E-060c, E2E-060d, E2E-061, E2E-061a, E2E-062, E2E-064, E2E-065, E2E-068, E2E-071, E2E-073, E2E-074, E2E-075, E2E-081, E2E-083, E2E-084, E2E-086, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-106, E2E-109, E2E-111, E2E-114, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-121, E2E-218, E2E-259, E2E-219, E2E-AGENTS-001, E2E-142, E2E-144, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-161, E2E-162, E2E-166, E2E-172, E2E-173, E2E-174, E2E-177, E2E-178, E2E-179, E2E-180, E2E-182, E2E-183, E2E-187, E2E-198, E2E-199, E2E-202, E2E-203, E2E-207, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-102i, E2E-PLUGIN-session-orchestrator-real-workers, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-SUBAGENT-resume-a-settled-delegation || D — Workspace | E2E-012, E2E-013, E2E-022B, E2E-024I, E2E-047, E2E-049, E2E-057, E2E-058, E2E-060, E2E-068, E2E-075, E2E-078, E2E-153, E2E-158, E2E-182, E2E-187, E2E-252 || D — Workspace (project ordering) | E2E-253 || E — Tools & permissions | E2E-008a, E2E-014, E2E-015, E2E-016, E2E-017, E2E-018, E2E-019, E2E-024I, E2E-024K, E2E-040, E2E-049, E2E-074, E2E-093, E2E-097, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102d, E2E-102e, E2E-102g, E2E-103, E2E-105, E2E-106, E2E-107, E2E-111, E2E-112, E2E-113, E2E-114, E2E-115, E2E-116, E2E-119, E2E-121, E2E-122, E2E-142, E2E-145, E2E-147, E2E-155, E2E-158, E2E-166, E2E-181, E2E-PLUGIN-imported-pi-package-skills |@@ -7711,7 +7749,7 @@ identify the platform validation still needed.| G — Plugins | E2E-022, E2E-022A, E2E-022B, E2E-022C, E2E-023, E2E-024, E2E-024B, E2E-024C, E2E-024D, E2E-024AA, E2E-024E, E2E-024W, E2E-024F, E2E-024G, E2E-024H, E2E-024I, E2E-024J, E2E-024K, E2E-024L, E2E-024M, E2E-024N, E2E-024O, E2E-024P, E2E-025, E2E-026, E2E-105, E2E-117, E2E-120, E2E-122, E2E-123, E2E-024Q, E2E-148, E2E-152, E2E-153, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-imported-pi-package-wrapper, E2E-PLUGIN-import-extension-installs-dependencies, E2E-PLUGIN-import-extension-reports-missing-dependency, E2E-PLUGIN-global-shortcut-owns-only-its-own-command, E2E-PLUGIN-permission-gate-for-real-time-capabilities, E2E-PLUGIN-background-audio-and-realtime-connection, E2E-PLUGIN-fs-root-follows-the-calling-session || H — Diagnostics | E2E-027, E2E-031, E2E-034, E2E-042, E2E-096, E2E-098, E2E-104, E2E-107, E2E-108, E2E-109, E2E-110, E2E-113, E2E-115, E2E-116, E2E-118, E2E-121, E2E-146, E2E-146a, E2E-155, E2E-159, E2E-176, E2E-194, E2E-195 || Security | E2E-028, E2E-029, E2E-030, E2E-024J, E2E-024K, E2E-024M, E2E-049, E2E-068, E2E-086, E2E-102c, E2E-102d, E2E-102e, E2E-105, E2E-106, E2E-107, E2E-108, E2E-109, E2E-110, E2E-112, E2E-113, E2E-115, E2E-116, E2E-117, E2E-119, E2E-121, E2E-122, E2E-123, E2E-142, E2E-148, E2E-151, E2E-153, E2E-158, E2E-187, E2E-196c, E2E-196b, E2E-196, E2E-PLUGIN-fs-root-follows-the-calling-session |-| Quality | E2E-032, E2E-033, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-053, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-103, E2E-AGENTS-001, E2E-021a, E2E-024N, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-111, E2E-114, E2E-117, E2E-118, E2E-119, E2E-120, E2E-122, E2E-123, E2E-142, E2E-143, E2E-144, E2E-145, E2E-146, E2E-147, E2E-148, E2E-150, E2E-151, E2E-153, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-168, E2E-172, E2E-173, E2E-174, E2E-011g, E2E-176, E2E-177, E2E-178, E2E-179, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-196, E2E-201, E2E-204, E2E-202, E2E-203, E2E-205, E2E-206, E2E-207, E2E-208, E2E-209, E2E-210, E2E-218, E2E-259, E2E-219, E2E-250, E2E-252, E2E-102i, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation |+| Quality | E2E-CHAT-running-status-survives-output-pauses, E2E-032, E2E-033, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-053, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-103, E2E-AGENTS-001, E2E-021a, E2E-024N, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-111, E2E-114, E2E-117, E2E-118, E2E-119, E2E-120, E2E-122, E2E-123, E2E-142, E2E-143, E2E-144, E2E-145, E2E-146, E2E-147, E2E-148, E2E-150, E2E-151, E2E-153, E2E-155, E2E-158, E2E-159, E2E-160, E2E-161, E2E-162, E2E-163, E2E-168, E2E-172, E2E-173, E2E-174, E2E-011g, E2E-176, E2E-177, E2E-178, E2E-179, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-196a, E2E-196b, E2E-196c, E2E-198, E2E-199, E2E-200, E2E-196, E2E-201, E2E-204, E2E-202, E2E-203, E2E-205, E2E-206, E2E-207, E2E-208, E2E-209, E2E-210, E2E-218, E2E-259, E2E-219, E2E-250, E2E-252, E2E-102i, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-PLUGIN-imported-pi-package-skills, E2E-PLUGIN-fs-root-follows-the-calling-session, E2E-SUBAGENT-resume-a-settled-delegation || Quality (project ordering) | E2E-253 || C — Conversation & stream (IME slash alias) | E2E-255 || E — Tools & permissions (Skill residency) | E2E-254 |@@ -7757,7 +7795,7 @@ identify the platform validation still needed.| M2 | E2E-004, E2E-005, E2E-006, E2E-007, E2E-008, E2E-008d, E2E-008e, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-020, E2E-021, E2E-021a, E2E-027, E2E-031, E2E-036, E2E-037, E2E-042, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-144, E2E-005J, E2E-201, E2E-202, E2E-207, E2E-206 || M3 | E2E-012, E2E-013, E2E-014, E2E-015, E2E-016, E2E-017, E2E-018, E2E-019, E2E-040 || M4 | E2E-022, E2E-023, E2E-024, E2E-025, E2E-026, E2E-030, E2E-038 |-| M5 | E2E-008a, E2E-032, E2E-033, E2E-034, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-051, E2E-052, E2E-053, E2E-054, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-AGENTS-001, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-094, E2E-095, E2E-143, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-177, E2E-178, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-204, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-252, E2E-102i |+| M5 | E2E-CHAT-running-status-survives-output-pauses, E2E-008a, E2E-032, E2E-033, E2E-034, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-051, E2E-052, E2E-053, E2E-054, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-AGENTS-001, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-094, E2E-095, E2E-143, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-177, E2E-178, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-204, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-252, E2E-102i || M5 (project ordering) | E2E-253 || M2 (IME slash alias) | E2E-255 || M5 (Skill residency) | E2E-254 |diff --git a/docs/zh-CN/spec/04-ux/08-component-spec.md b/docs/zh-CN/spec/04-ux/08-component-spec.mdindex 19ce86f2c..fb221b6d6 100644--- a/docs/zh-CN/spec/04-ux/08-component-spec.md+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md@@ -626,7 +626,7 @@ expanded/collapsed 侧边栏仍为 20px/18px 且启动画面为 64 像素。|---|---|| 空 | 可滚动内容区域中的受约束的英雄+可选的入门清单,带有底部保留的主页输入框,没有入门卡或上下文快速操作层(D111/D204/D206) || 流媒体 | 固定时自动滚动;追加新标记 |-| 积极进展 | 发送后,在第一个助手或工具事件之前,会内联显示一个紧凑的本地化 `Working…` 状态以及经过的时间。它屈服于具体的思维、工具和答案行,而权限卡拥有批准状态;不会渲染大型通用进度卡。重试行在静止时保持紧凑;悬停或聚焦会弹出错误色 tooltip,底板为 `--ds-bg-elevated-opaque`,避免透出记录正文。 |+| 积极进展 | 发送后,在第一个助手或工具事件之前,会内联显示一个紧凑的本地化 `Working…` 状态以及经过的时间。思考、工具执行、工具完成后的空档和部分回答都不会隐藏该行。具体运行时阶段优先于规划/目标或工作中提示;等待权限、提问或计划/目标批准时隐藏状态,历史阅读窗口不显示实时状态;不会渲染大型通用进度卡。重试行在静止时保持紧凑;悬停或聚焦会弹出错误色 tooltip,底板为 `--ds-bg-elevated-opaque`,避免透出记录正文。 || 回合结果 | 回合失败后,会话范围的恢复卡会总结中断和工具证据。已完成的轮次使用现有的记录和消息范围的 InlineReviewCard,无需额外的成功卡;失败的回合可以重试而不会丢失转录本。 || 会话切换 | 首次打开的会话在它最新的记录处绘制;重新访问的面板在它自己保留的位置处绘制。有界的首次提交与全量历史展开显示同一个位置:绘制之后的高度校正不得在任何方向上移动可见行 || 启动(发送/重试/重新生成) | 即使用户向上滚动,在绘制之前重新固定和定位最新内容;后来保留的用户消息事件不会在其顶部闪烁记录,并且发送期间的输入框折叠/指示器布局夹紧永远不会释放跟随模式 |@@ -1038,9 +1038,9 @@ SESSIONS [msg+][↕]| 会话转换 | 热目标面板立即以其保留的内容和位置被揭示。若它仍在运行或仍持有尚未刷入的已完成回复,其实时渲染器快照在持久化再验证中保留。冷目标让可见面板在一条细进度轨道下停留在它自己的会话上,直到目标提交;没有任何内容被调暗,隐藏的面板保持挂载且惰性,当前流更新不会延迟 || 流媒体 | 追加新令牌;仅在固定到底部时自动滚动 || 回合开始 | 发送/重试/重新生成重新固定跟随模式并跳转到底部 |-| 仅思考流媒体 | 文字记录打开;披露保持开放;没有空的答案气泡或重复的工作行 |-| 流前工作中 | 在思考、工具或回答出现前,显示带跳动圆点的紧凑 Working 行 |-| 流前规划中 | 同一位置显示带跳动圆点的紧凑规划/目标行,同时 Composer 模式芯片脉冲。一旦出现工具或回答,转录本中的该行让位,避免停在输入框上方显得突兀 |+| 仅思考流媒体 | 文字记录打开;披露保持开放;没有空的答案气泡;底部状态继续标明回合仍在运行 |+| 运行中兜底 | 未知具体运行时阶段且不在规划状态时,整轮显示带跳动圆点的紧凑 Working 行,包括部分输出暂停和工具完成后的空档 |+| 运行中规划 | 整轮在同一位置显示带跳动圆点的紧凑规划/目标行,具体运行时阶段优先;等待用户操作或回合结束时隐藏。Composer 模式芯片脉冲 || 空闲 | 可滚动;没有自动滚动 || 正在等待许可 | 内嵌插入许可卡;决议后继续转录 || 上下文检查点 | 现有的转录本仍然可见;压缩在其覆盖的消息后面添加一个分隔行和一个警告 toast |@@ -1057,6 +1057,11 @@ SESSIONS [msg+][↕]`role="article"` 回合。转牌暴露了一个尾随元行和一个动作工具栏; Copy 按顺序连接所有内容片段,而 Fork 和重新生成使用最后一条内容丰富的辅助消息作为持久边界。+ 仅在这些操作可用时挂载工具栏;运行中或含助手错误的回合不保留空工具栏。+ 运行提示紧邻最后输出,避免不可见按钮占位造成额外空白。+ 保留助手消息原有 14px 底部内边距和运行状态栏完整高度,默认字号下纯文字+ 片段到状态文字为 24px。用户消息保留真实的悬停操作栏与原有间距,包括首次+ 等待阶段;按钮通过透明度隐藏但保持占位,悬停时不推动内容。- 切换思维披露:expand/collapse 独立于最终答案;当推理到达时,流式传输会重新打开它。扩展后的内容的左侧规则本身就是一个指针和键盘可聚焦的折叠diff --git a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md b/docs/zh-CN/spec/04-ux/09-interaction-patterns.mdindex 7e76a0a8f..298ee8eca 100644--- a/docs/zh-CN/spec/04-ux/09-interaction-patterns.md+++ b/docs/zh-CN/spec/04-ux/09-interaction-patterns.md@@ -503,8 +503,9 @@具有经过时间的本地化 `Working…` 状态。当运行时报告一段安静间隔时,同一行会标明:正在开始、等待模型、准备下一次请求、压缩上下文、补救空回复、重试,或等待委托工作(并带上每个- 仍在运行的 Subagent 的粗粒度动作)。一旦出现具体的思考/工具/- 回答反馈或内联权限卡,该行就被替换。+ 仍在运行的 Subagent 的粗粒度动作)。已有思考、工具或回答不会隐藏+ 该行,输出暂停时仍保留底部状态。等待权限、提问或计划/目标批准时+ 隐藏;回合结束和历史阅读窗口不显示实时状态。- 当流完成时:光标指示器被成功状态取代(2秒淡出)### 2. 2 自动滚动@@ -538,7 +539,9 @@- 主动转动可保持转录本下表面清晰。直播助手工具行与记录保持一致;没有通用的理解,- 工作卡或检查卡呈现在它们下方。+ 工作卡或检查卡呈现在它们下方。运行中的回合保留一行紧凑底部状态:+ 优先显示具体运行时阶段,否则显示规划/目标或工作中。已有文字和工具+ 不会隐藏提示;等待用户操作时隐藏。- 仅当代理被阻止时,权限卡才保持可见明确批准。这是可操作的中断,而不是进度状态卡。@@ -724,7 +727,7 @@ Agent calls a permission-gated tool (including Plan/Goal Bash under Ask or Accep2. Agent 使用选定的合约工具集进行调查。 Read/Glob/Grep 和允许使用 BrowserPreview; Bash 遵循可见权限模式。一个Contract-mode Bash 命令可能会在 Auto 下发生变化,因此模式芯片仍然可见。- 该回合处于实时 `planning` 时,Composer 模式芯片脉冲,紧凑的规划行占用与 Working 相同的流前位置;工具或回答行会替换该成绩单行,避免它单独停在输入框上方。+ 该回合处于实时 `planning` 时,Composer 模式芯片脉冲,紧凑的规划行占用与 Working 相同的预留底部位置,直到回合结束或等待用户操作。具体运行时阶段优先,工具和回答不会隐藏运行提示。3. Agent 在其工具批次中单独调用 `SubmitPlan` 或 `SubmitGoal`。Host-core 将准确的 Markdown 字节保留在新的不可变中`.pi/plan/*.md` 或 `.pi/goal/*.md` 工件,记录其 path/hash/size 并结构化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.mdindex 4f51e46a7..2bdc23ba5 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@@ -350,8 +350,9 @@ unit/integration 测试;代码 pull request 使用有选择且高价值的 E2E- **先决条件**:已配置提供商。- **步骤**:1) 创建新会话。 2) 输入消息。 3)发送。- **预期**:转录结果立即显示紧凑的本地化 `Working…`- 发送后、第一个助手或工具事件之前的状态。它产生- 具体的 thinking/tool/answer 反馈,并在回合结束时消失。+ 发送后、第一个助手或工具事件之前的状态。思考、工具和回答出现后+ 仍保留提示,已知具体阶段时显示对应等待状态。等待用户操作时隐藏,+ 回合结束时消失。- **链接规格**:`03-runtime/02-agent-runtime.md`、`03-runtime/10-session-state-machine.md`- **接受**:C(新会话,发送消息)- **里程碑**:M2@@ -2369,8 +2370,9 @@ MainChat 弥补了缺口。 Maximized/fullscreen 调用保留最新的完成。- **预期**:没有一般理解、工作、检查或完成当回合处于活动状态时,卡片会出现在成绩单下方。助理和- 工具行保持内联;只有实际的权限请求才会呈现- 可操作的卡。后台活动永远不会改变可见会话,+ 工具行保持内联;整轮保留一行紧凑底部状态,包括部分回答暂停和工具+ 完成后的空档。具体阶段优先于规划/目标或工作中,等待用户操作时隐藏。+ 只有实际的权限请求才会呈现可操作的权限卡。后台活动永远不会改变可见会话,成绩单、输入框焦点或项目。- **链接规格**:`04-ux/08-component-spec.md`,`04-ux/09-interaction-patterns.md`、`03-runtime/10-session-state-machine.md`@@ -5064,7 +5066,7 @@ IPC 请求无法关闭。| B / F / Quality — 已选模型顺序 | E2E-MODEL-selected-order-persists || A — 应用程序启动 | E2E-001、E2E-002、E2E-003、E2E-004、E2E-067、E2E-076、E2E-079、E2E-092、E2E-097、E2E-143、E2E-150、E2E-168、E2E-204、E2E-217 || B——模型配置 | E2E-005、E2E-005G、E2E-006、E2E-007、E2E-038、E2E-050、E2E-052、E2E-055、E2E-066、E2E-080、E2E-082、E2E-151、E2E-005J、E2E-199、E2E-201、E2E-202、E2E-203、E2E-209、E2E-166 |-| C — 对话和直播 | E2E-008、E2E-008d、E2E-008a、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-031、E2E-040、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-052、 E2E-053、E2E-054、E2E-055、E2E-059、E2E-059a、E2E-060c、E2E-060d、E2E-061、E2E-061a、E2E-062、E2E-064、E2E-065、E2E-068、E2E-071、 E2E-073、E2E-074、E2E-075、E2E-081、E2E-083、E2E-084、E2E-086、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-094、E2E-095、E2E-096、 E2E-097、E2E-098、E2E-099、E2E-102、E2E-102a、E2E-102b、E2E-106、E2E-109、E2E-111、E2E-114、E2E-116、E2E-117、E2E-118、E2E-119、 E2E-120、E2E-121、E2E-代理-001、E2E-142、E2E-144、E2E-145、E2E-146、E2E-147、E2E-151、E2E-199、E2E-250、E2E-166、E2E-SUBAGENT-resume-a-settled-delegation |+| C — 对话和直播 | E2E-CHAT-running-status-survives-output-pauses、E2E-008、E2E-008d、E2E-008a、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-031、E2E-040、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-052、 E2E-053、E2E-054、E2E-055、E2E-059、E2E-059a、E2E-060c、E2E-060d、E2E-061、E2E-061a、E2E-062、E2E-064、E2E-065、E2E-068、E2E-071、 E2E-073、E2E-074、E2E-075、E2E-081、E2E-083、E2E-084、E2E-086、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-094、E2E-095、E2E-096、 E2E-097、E2E-098、E2E-099、E2E-102、E2E-102a、E2E-102b、E2E-106、E2E-109、E2E-111、E2E-114、E2E-116、E2E-117、E2E-118、E2E-119、 E2E-120、E2E-121、E2E-代理-001、E2E-142、E2E-144、E2E-145、E2E-146、E2E-147、E2E-151、E2E-199、E2E-250、E2E-166、E2E-SUBAGENT-resume-a-settled-delegation || A / C / F / Quality — Tray session navigation | E2E-TRAY-bounded-session-navigation || D——工作区 | E2E-012、E2E-013、E2E-022B、E2E-024I、E2E-047、E2E-049、E2E-057、E2E-058、E2E-060、E2E-068、E2E-075、E2E-078、E2E-153 || D——工作区(项目排序) | E2E-253 |@@ -5074,7 +5076,7 @@ IPC 请求无法关闭。| G——插件 | E2E-022、E2E-022A、E2E-022B、E2E-022C、E2E-023、E2E-024、E2E-024B、E2E-024C、E2E-024D、E2E-024AA、E2E-024E、E2E-024W、E2E-024F、E2E-024G、E2E-024H、 E2E-024I、E2E-024J、E2E-024K、E2E-024L、E2E-024M、E2E-024N、E2E-024O、E2E-024P、E2E-025、E2E-026、E2E-105、E2E-117、E2E-120、E2E-122、E2E-123、E2E-148、E2E-153、E2E-PLUGIN-imported-pi-package-skills、E2E-PLUGIN-imported-pi-package-wrapper、E2E-PLUGIN-import-extension-installs-dependencies、E2E-PLUGIN-import-extension-reports-missing-dependency、E2E-PLUGIN-global-shortcut-owns-only-its-own-command、E2E-PLUGIN-permission-gate-for-real-time-capabilities、E2E-PLUGIN-background-audio-and-realtime-connection || H——诊断 | E2E-027、E2E-031、E2E-034、E2E-042、E2E-096、E2E-098、E2E-104、E2E-107、E2E-108、E2E-109、E2E-110、E2E-113、E2E-115、E2E-116、 E2E-118、E2E-121、E2E-146、E2E-194、E2E-195 || 安全性 | E2E-028、E2E-029、E2E-030、E2E-024J、E2E-024K、E2E-024M、E2E-049、E2E-068、E2E-086、E2E-105、E2E-106、E2E-107、E2E-108、E2E-109、 E2E-110、E2E-112、E2E-113、E2E-115、E2E-116、E2E-117、E2E-119、E2E-121、E2E-122、E2E-123、E2E-142、E2E-148、E2E-151、E2E-153 |-| 品质 | E2E-032、E2E-033、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-050、E2E-053、E2E-055、 E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、 E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、 E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-094、E2E-095、E2E-096、E2E-097、E2E-098、E2E-099、E2E-100、E2E-101、E2E-102、 E2E-102a、E2E-102b、E2E-103、E2E-AGENTS-001、E2E-024N、E2E-024O、E2E-059a、E2E-060b、E2E-060c、E2E-060d、E2E-061a、E2E-073a、E2E-111、 E2E-114、E2E-117、E2E-118、E2E-119、E2E-120、E2E-122、E2E-123、E2E-142、E2E-143、E2E-144、E2E-145、E2E-146、E2E-147、E2E-148、E2E-150、E2E-151、E2E-153、E2E-194、E2E-195、E2E-199、E2E-200、E2E-201、E2E-202、E2E-203、E2E-204、E2E-209、E2E-210、E2E-250、E2E-PLUGIN-imported-pi-package-skills、E2E-SUBAGENT-resume-a-settled-delegation |+| 品质 | E2E-CHAT-running-status-survives-output-pauses、E2E-032、E2E-033、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-050、E2E-053、E2E-055、 E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、 E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、 E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-094、E2E-095、E2E-096、E2E-097、E2E-098、E2E-099、E2E-100、E2E-101、E2E-102、 E2E-102a、E2E-102b、E2E-103、E2E-AGENTS-001、E2E-024N、E2E-024O、E2E-059a、E2E-060b、E2E-060c、E2E-060d、E2E-061a、E2E-073a、E2E-111、 E2E-114、E2E-117、E2E-118、E2E-119、E2E-120、E2E-122、E2E-123、E2E-142、E2E-143、E2E-144、E2E-145、E2E-146、E2E-147、E2E-148、E2E-150、E2E-151、E2E-153、E2E-194、E2E-195、E2E-199、E2E-200、E2E-201、E2E-202、E2E-203、E2E-204、E2E-209、E2E-210、E2E-250、E2E-PLUGIN-imported-pi-package-skills、E2E-SUBAGENT-resume-a-settled-delegation || 品质(项目排序) | E2E-253 || C — 对话和直播(输入法斜杠别名) | E2E-255 || E——工具和权限(Skill 常驻) | E2E-254 |@@ -5120,7 +5122,7 @@ IPC 请求无法关闭。| M2 | E2E-004、E2E-005、E2E-006、E2E-007、E2E-008、E2E-008d、E2E-009、E2E-010、E2E-011、E2E-011a、E2E-011b、E2E-020、E2E-021、E2E-027、E2E-031、 E2E-036、E2E-037、E2E-042、E2E-087、E2E-088、E2E-088b、E2E-089、E2E-090、E2E-144、E2E-005J、E2E-201 || M3 | E2E-012、E2E-013、E2E-014、E2E-015、E2E-016、E2E-017、E2E-018、E2E-019、E2E-040 || M4 | E2E-022、E2E-023、E2E-024、E2E-025、E2E-026、E2E-030、E2E-038 |-| M5 | E2E-008a、E2E-032、E2E-033、E2E-034、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-050、 E2E-051、E2E-052、E2E-053、E2E-054、E2E-055、E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、 E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、 E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-096、E2E-097、E2E-098、E2E-099、 E2E-100、E2E-101、E2E-102、E2E-102a、E2E-102b、E2E-AGENTS-001、E2E-059a、E2E-060b、E2E-060c、E2E-061a、E2E-073a、E2E-094、E2E-095、E2E-143、E2E-145、E2E-146、E2E-147、E2E-194、E2E-195、E2E-204、E2E-250 |+| M5 | E2E-CHAT-running-status-survives-output-pauses、E2E-008a、E2E-032、E2E-033、E2E-034、E2E-039、E2E-043、E2E-044、E2E-045、E2E-046、E2E-047、E2E-048、E2E-048A、E2E-049、E2E-050、 E2E-051、E2E-052、E2E-053、E2E-054、E2E-055、E2E-056、E2E-057、E2E-058、E2E-059、E2E-060、E2E-061、E2E-062、E2E-063、E2E-064、 E2E-065、E2E-066、E2E-067、E2E-068、E2E-069、E2E-070、E2E-071、E2E-072、E2E-073、E2E-074、E2E-075、E2E-076、E2E-077、E2E-078、 E2E-079、E2E-080、E2E-081、E2E-082、E2E-083、E2E-084、E2E-085、E2E-086、E2E-092、E2E-093、E2E-096、E2E-097、E2E-098、E2E-099、 E2E-100、E2E-101、E2E-102、E2E-102a、E2E-102b、E2E-AGENTS-001、E2E-059a、E2E-060b、E2E-060c、E2E-061a、E2E-073a、E2E-094、E2E-095、E2E-143、E2E-145、E2E-146、E2E-147、E2E-194、E2E-195、E2E-204、E2E-250 || M5(项目排序) | E2E-253 || M2(输入法斜杠别名) | E2E-255 || M5(Skill 常驻) | E2E-254 |@@ -7835,6 +7837,25 @@ runner 会在运行时的隔离临时目录中生成六个插件形态 fixture- **验收**:C(对话与流式)、E(工具与权限)、品质- **里程碑**:M6+- **状态**:部分自动化。`pnpm test:e2e:transcript-disclosure` 在真实的 600 CSS px Electron 视口中挂载真实的转录滚动 hook 与真实的工具行,用真实 DOM 点击标题,并对转录以及嵌套跟随滚动器断言标题相对滚动器顶边的偏移与滚动偏移;没有该修复时,同一个夹具会报告标题移动了整个展开详情的高度。夹具未链接应用样式表,因此高度来自内联填充与组件自身的固有尺寸。`disclosure-anchor.test.mjs` 覆盖纯锚点与输入归属数学,`transcript-disclosure-reading.test.mjs` 覆盖接线。键盘、滚轮与活动组动画路径仍属补充验证。+#### E2E-CHAT-running-status-survives-output-pauses++- **先决条件**:Electron 中的生产 `ChatTranscript`、真实 store 和 React DOM,使用确定性消息/状态转换,无需模型凭据。+- **步骤**:发送一轮,输出部分文字后停止增量,开始并完成工具,切换和清空具体阶段,恢复文字后完成、停止或失败。在详细与紧凑模式重复;验证规划、权限、提问与提案等待、历史阅读及会话切换。+- **预期**:输出暂停和工具完成后仍有且仅有一行本地化、可访问的底部状态。具体阶段优先于规划/目标或工作中。等待用户操作时隐藏;回合结束与历史阅读时移除。会话切换只使用对应会话的状态;已有内容与权限操作保持可用。运行中与含助手错误的回合不挂载空操作栏;默认字号下,部分回答的片段盒底部到状态文字顶部为 24 CSS px。结束后的无错误正文保留复制、分支与重新生成。详细和紧凑模式均需验证。历史阅读和权限卡保留正常消息间距;回合结束后贴底模式继续跟随底部,恢复正常操作栏高度;向上阅读时正文位置和滚动偏移保持不变。+- **链接规格**:`04-ux/08-component-spec.md`、`04-ux/09-interaction-patterns.md`+- **验收**:C(对话与流式)、品质(交互和可访问性)+- **里程碑**:M5+- **状态**:`pnpm test:e2e:transcript` 自动化(`scripts/e2e/transcript-status.tsx`)。上游 `ecece8f570fc0c18f21e4941eafe52244a7c6e5f` 可复现 #669;不代表真实模型验证。++#### E2E-CHAT-initial-wait-spacing++- 发送用户消息且助手尚未输出:保留原有用户操作栏和间距,默认纯文字用例气泡到状态文字为 52px。+- 宽窗口和窄窗口下复制可聚焦、可命中;编辑、删除、版本按钮保持运行中禁用。+ 含版本分页时,状态与所有操作按钮的命中区域也不重叠。+- 状态/底部空白右键打开会话菜单,消息右键打开消息菜单。阶段变化、首次输出或输出前停止,+ 运行状态始终只有一处,结束后恢复消息操作。+- 覆盖:`scripts/e2e/transcript-status.tsx`,`pnpm test:e2e:transcript`。+#### E2E-CHAT-runtime-status-keeps-row-position- **先决条件**:一个活动会话,其转录高于对话视口,且尾部由一行已完成的工具占用;窗格已构建(`pnpm build:js`)并已安装 Electron。@@ -7845,9 +7866,9 @@ runner 会在运行时的隔离临时目录中生成六个插件形态 fixture4. 再次清空运行时活动,让布局稳定下来。5. 结束该轮(`isRunning` 为 false),检查尾部。- **预期**:- - 等待行占用预留的状态通道:在状态出现期间以及清空之后,内容高度、滚动高度、滚动偏移,以及每一个已渲染行的位置都保持不变(误差在 0.01px 以内)。- - 空通道在深色与浅色两种主题下都保持已预留且不可见 —— 没有背景、边框或阴影。- - 状态行保持其活动区域语义(`role="status"`、`aria-live="polite"`),而空通道不携带任何可供播报的文本。+ - 等待行占用预留的状态通道:在 Working 切换到具体等待状态再恢复时,内容高度、滚动高度、滚动偏移,以及每一个已渲染行的位置都保持不变(误差在 0.01px 以内)。+ - 通道在深色与浅色两种主题下都保持预留和透明,没有背景、边框或阴影;清空具体阶段后恢复 Working。+ - 状态行保持其活动区域语义(`role="status"`、`aria-live="polite"`),等待用户操作时预留通道为空,不携带可供播报的文本。- 已结束的空闲转录完全不渲染状态通道,因此其布局不变。- **链接规格**:`04-ux/08-component-spec.md`- **验收**:C(对话与流式)、品质diff --git a/scripts/e2e-transcript-render.mjs b/scripts/e2e-transcript-render.mjsindex d5b58cee0..8d6a8c3ed 100644--- a/scripts/e2e-transcript-render.mjs+++ b/scripts/e2e-transcript-render.mjs@@ -129,7 +129,7 @@ const { app, BrowserWindow } = require("electron");const path = require("node:path");app.setPath("userData", path.join(__dirname, "profile"));app.whenReady().then(async () => {- const window = new BrowserWindow({ show: false, webPreferences: { sandbox: true, contextIsolation: true, nodeIntegration: false } });+ const window = new BrowserWindow({ show: false, webPreferences: { sandbox: true, contextIsolation: true, nodeIntegration: false, backgroundThrottling: false } });window.webContents.on("console-message", (event) => console.error(event.message));try {await window.loadFile(path.join(__dirname, "index.html"));diff --git a/scripts/e2e/transcript-render.tsx b/scripts/e2e/transcript-render.tsxindex 36306a841..cbbb9d886 100644--- a/scripts/e2e/transcript-render.tsx+++ b/scripts/e2e/transcript-render.tsx@@ -1,4 +1,5 @@import { turnProcessProbe } from "./turn-process";+import { transcriptStatusProbe } from "./transcript-status";import { createRoot } from "react-dom/client";import { flushSync } from "react-dom";import { createInstance } from "i18next";@@ -218,8 +219,10 @@ globalThis.transcriptRenderProbe = async () => {"Task completion timing did not update to 4s",);+ const statusLifecycle = await transcriptStatusProbe();return {- ok: true,+ ok: statusLifecycle.ok,+ statusLifecycle,groups,textUpdates: 20,textUpdateRenders,@@ -284,8 +287,8 @@ globalThis.transcriptRuntimeSlotProbe = async () => {message(`answer-${index}`, "assistant", `Finished step ${index}.`),);}- // A completed tool row owns the tail, so no status row is shown until the- // runtime reports the wait between tool execution and the model response.+ // A completed tool row does not finish the turn: the fallback remains until+ // the runtime reports the next phase or the turn reaches a terminal state.messages.push(message("tool-tail", "tool", "done", {toolName: "Bash",@@ -333,6 +336,8 @@ globalThis.transcriptRuntimeSlotProbe = async () => {scrollTop: scroller()?.scrollTop ?? null,firstRowTop: rows[0]?.getBoundingClientRect().top ?? null,lastRowBottom: rows.at(-1)?.getBoundingClientRect().bottom ?? null,+ lastTextBottom: [...host.querySelectorAll(".assistant-turn-fragment")]+ .at(-1)?.getBoundingClientRect().bottom ?? null,laneHeight: element?.getBoundingClientRect().height ?? null,laneChildren: element?.childElementCount ?? null,laneText: element?.textContent ?? null,@@ -395,12 +400,12 @@ globalThis.transcriptRuntimeSlotProbe = async () => {await settle();const atRest = snapshot();check(- atRest.laneChildren === 0,- `the status lane was not empty at rest: ${JSON.stringify(atRest)}`,+ atRest.laneChildren === 1,+ `the fallback status was missing: ${JSON.stringify(atRest)}`,);check(- atRest.laneText === "",- "the empty status lane still carried text for a live region to announce",+ Boolean(host.querySelector('[data-testid="working-indicator"]')),+ "the running turn did not show the fallback status",);check((atRest.laneHeight ?? 0) > 0,@@ -417,8 +422,8 @@ globalThis.transcriptRuntimeSlotProbe = async () => {`the fixture transcript is not scrolled to its own bottom: ${JSON.stringify(atRest)}`,);- // The reserve has to be invisible in either theme: a background, border, or- // shadow on an empty row reads as a stray block under the transcript.+ // The lane itself stays transparent in either theme; only its status+ // content is painted.for (const theme of ["dark", "light"]) {document.documentElement.dataset.theme = theme;await frame();@@ -473,12 +478,12 @@ globalThis.transcriptRuntimeSlotProbe = async () => {await settle();const cleared = snapshot();check(- cleared.laneChildren === 0,- "clearing the status left the indicator mounted",+ cleared.laneChildren === 1,+ "clearing the phase removed the running indicator",);check(- cleared.laneText === "",- "clearing the status left its label behind",+ Boolean(host.querySelector('[data-testid="working-indicator"]')),+ "clearing the phase did not restore the fallback",);compare("status cleared", cleared, atRest);@@ -489,6 +494,41 @@ globalThis.transcriptRuntimeSlotProbe = async () => {lane() === null,"an idle transcript still reserved the runtime status lane",);+ const compareEnd = (label: string, ended: Snap, active: Snap, pinned: boolean) => {+ // Ending restores the real toolbar; its height need not match the lane.+ // Unpinned readers must keep their text position despite that change.+ if (!pinned) {+ for (const field of ["scrollTop", "firstRowTop", "lastTextBottom"] as const) {+ const before = active[field];+ const after = ended[field];+ check(before !== null && after !== null && Math.abs(after - before) <= 0.01,+ `${label}: ${field} changed (${after} vs ${before})`);+ }+ }+ const element = scroller();+ if (pinned && element) {+ check(Math.abs(element.scrollHeight - element.clientHeight - element.scrollTop) <= 1,+ `${label}: lost pinned follow`);+ }+ };+ compareEnd("pinned turn ends", snapshot(), cleared, true);++ running = true;+ flushSync(paint);+ await settle();+ const scrollElement = scroller();+ if (scrollElement) {+ scrollElement.dispatchEvent(new WheelEvent("wheel", { deltaY: -120, bubbles: true }));+ scrollElement.scrollTop = Math.max(0, scrollElement.scrollTop - 120);+ scrollElement.dispatchEvent(new Event("scroll", { bubbles: true }));+ }+ await settle();+ const reading = snapshot();+ check((reading.scrollTop ?? 0) < (cleared.scrollTop ?? 0), "fixture did not scroll up before stopping");+ running = false;+ flushSync(paint);+ await settle();+ compareEnd("scrolled-up turn ends", snapshot(), reading, false);check(renderErrors.length === 0,`React render failed: ${renderErrors.map(String).join("; ")}`,diff --git a/scripts/e2e/transcript-status.tsx b/scripts/e2e/transcript-status.tsxnew file mode 100644index 000000000..3b4ef9328--- /dev/null+++ b/scripts/e2e/transcript-status.tsx@@ -0,0 +1,406 @@+import type { ComponentProps } from "react";+import { createRoot } from "react-dom/client";+import { flushSync } from "react-dom";+import { createInstance } from "i18next";+import { I18nextProvider } from "react-i18next";+import { en } from "@pi-desktop/i18n";+import type { AgentActivity, UiMessage } from "@pi-desktop/shared";+import { ChatTranscript } from "../../apps/desktop/src/features/chat/transcript/ChatTranscript";+import { useAppStore } from "../../apps/desktop/src/stores/app-store";++/** A turn stays visibly active even when its latest output stops changing. */+export async function transcriptStatusProbe() {+ const i18n = createInstance();+ await i18n.init({ lng: "en", resources: { en: { translation: en } } });+ const host = document.createElement("div");+ host.style.cssText =+ "position:absolute;inset:0;display:flex;flex-direction:column";+ document.body.append(host);+ const initial = useAppStore.getState();+ const root = createRoot(host);+ const failures: string[] = [];+ const checks: string[] = [];+ const check = (value: unknown, label: string) => {+ checks.push(label);+ if (!value) failures.push(label);+ };+ const sessionId = "status-lifecycle";+ const createdAt = new Date().toISOString();+ const user: UiMessage = {+ id: "user",+ role: "user",+ content: "Inspect the workspace",+ createdAt,+ };+ const answer: UiMessage = {+ id: "answer",+ role: "assistant",+ content: "I will inspect the files.",+ status: "streaming",+ createdAt,+ };+ const tool: UiMessage = {+ id: "tool",+ role: "tool",+ content: "",+ toolName: "Bash",+ toolCallId: "call",+ toolArgs: { command: "pwd" },+ toolStatus: "running",+ createdAt,+ };+ let props: ComponentProps<typeof ChatTranscript> = {+ sessionId,+ messages: [user],+ isRunning: true,+ };+ const render = async (update: Partial<typeof props> = {}) => {+ props = { ...props, ...update };+ flushSync(() =>+ root.render(+ <I18nextProvider i18n={i18n}>+ <ChatTranscript {...props} />+ </I18nextProvider>,+ ),+ );+ // Let React commit the deferred transcript projection before inspecting it.+ for (let task = 0; task < 2; task++) {+ await new Promise<void>((resolve) => {+ const channel = new MessageChannel();+ channel.port1.onmessage = () => {+ channel.port1.close();+ channel.port2.close();+ resolve();+ };+ channel.port2.postMessage(null);+ });+ }+ };+ const activity = (value: AgentActivity | undefined) => {+ flushSync(() =>+ useAppStore.setState({+ agentStatuses: {+ [sessionId]: {+ sessionId,+ isRunning: true,+ pendingToolConfirmations: 0,+ activity: value,+ },+ },+ }),+ );+ };+ const indicator = (id: string) => host.querySelector(`[data-testid="${id}"]`);+ const oneStatus = (id: string, label: string) => {+ const lane = host.querySelector(".transcript-runtime-status");+ check(lane?.childElementCount === 1 && Boolean(indicator(id)), label);+ check(+ indicator(id)?.getAttribute("role") === "status",+ `${label}: accessible status`,+ );+ check(+ !host.querySelector(".message-row.assistant .message-actions"),+ `${label}: running turn has no empty action toolbar`,+ );+ };+ const noStatus = (label: string) =>+ check(!host.querySelector(".transcript-runtime-status > *"), label);+ try {+ for (const mode of ["detailed", "compact"] as const) {+ flushSync(() =>+ useAppStore.setState({+ settings: {+ defaultMode: "agent",+ theme: "light",+ enterToSend: true,+ onboardingDismissed: true,+ thinkingDisplayMode: mode,+ },+ agentStatuses: {},+ pendingPlans: {},+ }),+ );+ await render({+ sessionId,+ messages: [user],+ isRunning: true,+ readingWindow: false,+ });+ oneStatus("working-indicator", `${mode}: send before first event`);+ await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));+ await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));+ const userBubble = host.querySelector(".message-row.user .message-bubble");+ const waitingLabel = indicator("working-indicator")?.querySelector(".working-indicator-label");+ const initialGap = userBubble && waitingLabel+ ? waitingLabel.getBoundingClientRect().top - userBubble.getBoundingClientRect().bottom+ : Number.NaN;+ check(Math.abs(initialGap - 52) <= 0.01,+ `${mode}: initial wait retains the user action row (${initialGap}px)`);++ await render({ messages: [{ ...user, revisionCount: 3, activeRevision: 2 }] });+ for (const width of [window.innerWidth, 320]) {+ host.style.width = `${width}px`;+ await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));+ const buttons = [...host.querySelectorAll<HTMLButtonElement>(".message-row.user .message-actions button")];+ const copy = buttons.find((button) => button.getAttribute("aria-label") === i18n.t("chat.copy"));+ check(buttons.length === 5 && copy && !copy.disabled &&+ buttons.filter((button) => button !== copy).every((button) => button.disabled),+ `${mode}/${width}: copy available; edit, delete and revisions disabled during wait`);+ copy?.focus();+ await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));+ const status = host.querySelector(".transcript-runtime-status")?.getBoundingClientRect();+ check(Boolean(status) && buttons.every((button) => {+ const box = button.getBoundingClientRect();+ return status && (box.left >= status.right || box.top >= status.bottom || box.right <= status.left || box.bottom <= status.top);+ }), `${mode}/${width}: status and all user action hit targets do not overlap`);+ const box = copy?.getBoundingClientRect();+ check(copy && document.activeElement === copy && box &&+ copy.contains(document.elementFromPoint(box.left + box.width / 2, box.top + box.height / 2)),+ `${mode}/${width}: copy receives keyboard focus and pointer hit`);+ }+ host.style.width = "";+ for (const [target, label] of [+ [host.querySelector(".transcript-runtime-status"), "chat.conversationMenu"],+ [host.querySelector(".message-row.user .message-bubble"), "chat.messageMenu"],+ ] as const) {+ flushSync(() => target?.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, clientX: 80, clientY: 160 })));+ check(document.querySelector('[role="menu"]')?.getAttribute("aria-label") === i18n.t(label),+ `${mode}: ${label} retains context menu ownership`);+ flushSync(() => document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true })));+ }+ activity({ phase: "waiting-model", since: Date.now() });+ oneStatus("run-activity-indicator", `${mode}: first wait receives phase changes`);+ await render({ isRunning: false });+ check(!host.querySelector(".transcript-runtime-status") &&+ host.querySelectorAll(".message-row.user button:disabled").length === 0,+ `${mode}: cancelling before output restores user actions and normal row`);+ activity(undefined);+ await render({ messages: [user, answer], isRunning: true });+ oneStatus("working-indicator", `${mode}: partial answer remains active`);+ // Geometry needs painted content, including content-visibility layout.+ await new Promise<void>((resolve) =>+ requestAnimationFrame(() => resolve()),+ );+ await new Promise<void>((resolve) =>+ requestAnimationFrame(() => resolve()),+ );+ const fragment = host.querySelector(".assistant-turn-fragment");+ const statusLabel = indicator("working-indicator")?.querySelector(+ ".working-indicator-label",+ );+ const gap =+ fragment && statusLabel+ ? statusLabel.getBoundingClientRect().top -+ fragment.getBoundingClientRect().bottom+ : Number.NaN;+ check(+ Math.abs(gap - 24) <= 0.01,+ `${mode}: status stays adjacent to partial answer (${gap}px)`,+ );+ await render({+ messages: [+ { ...user, id: "older-user" },+ { ...answer, id: "older-answer", status: "complete" },+ user,+ answer,+ ],+ });+ await new Promise<void>((resolve) =>+ requestAnimationFrame(() => resolve()),+ );+ const olderTurn = host.querySelector(+ '.assistant-turn:has([data-message-id="older-answer"])',+ );+ check(+ olderTurn &&+ getComputedStyle(olderTurn).paddingBottom === "14px" &&+ olderTurn.querySelectorAll(".message-actions button").length === 3,+ `${mode}: completed history retains its spacing and actions`,+ );+ await render({ messages: [user, answer], readingWindow: true });+ const readingTurn = host.querySelector(".assistant-turn");+ check(+ readingTurn && getComputedStyle(readingTurn).paddingBottom === "14px",+ `${mode}: history reading retains the normal message spacing`,+ );+ await render({ readingWindow: false });+ // No more deltas: an unchanged streaming message must not erase feedback.+ await render();+ oneStatus("working-indicator", `${mode}: quiet partial answer`);+ await render({ messages: [user, answer, tool] });+ oneStatus("working-indicator", `${mode}: running tool`);+ await render({+ messages: [+ user,+ answer,+ { ...tool, toolStatus: "success", content: "done" },+ ],+ });+ oneStatus(+ "working-indicator",+ `${mode}: completed tool before next status`,+ );+ activity({ phase: "waiting-model", since: Date.now() });+ oneStatus("run-activity-indicator", `${mode}: named model wait`);+ activity(undefined);+ oneStatus("working-indicator", `${mode}: cleared phase keeps fallback`);+ await render({+ messages: [+ user,+ { ...answer, content: "", thinking: "Inspecting files" },+ ],+ });+ oneStatus("working-indicator", `${mode}: thinking only`);+ await render({+ messages: [user, { ...answer, content: "Here is the result." }],+ });+ oneStatus("working-indicator", `${mode}: resumed answer`);+ for (const status of ["complete", "aborted", "error"] as const) {+ await render({+ messages: [user, { ...answer, status }],+ isRunning: false,+ });+ check(+ !host.querySelector(".transcript-runtime-status"),+ `${mode}: ${status} removes lane`,+ );+ const settledTurn = host.querySelector(".assistant-turn");+ check(+ settledTurn && getComputedStyle(settledTurn).paddingBottom === "14px",+ `${mode}: ${status} restores the normal message spacing`,+ );+ check(+ host.querySelectorAll(+ ".message-row.assistant .message-actions button",+ ).length === 3,+ `${mode}: settled non-error content retains copy, branch, and retry`,+ );+ }+ await render({+ messages: [+ user,+ {+ ...answer,+ status: "error",+ error: {+ code: "UNKNOWN",+ message: "Fixture error",+ retriable: false,+ },+ },+ ],+ isRunning: false,+ });+ check(+ !host.querySelector(".message-row.assistant .message-actions"),+ `${mode}: failed turn has no empty toolbar`,+ );+ }+ await render({ messages: [user, answer], isRunning: true });+ for (const phase of [+ "starting",+ "waiting-model",+ "preparing",+ "recovering",+ "retrying",+ ] as const) {+ activity({ phase, since: Date.now() });+ oneStatus(+ "run-activity-indicator",+ `${phase}: partial text cannot hide runtime phase`,+ );+ check(+ indicator("run-activity-indicator")?.getAttribute("data-phase") ===+ phase,+ `${phase}: correct label owner`,+ );+ }+ activity(undefined);+ await render({ planningState: "planning" });+ oneStatus("planning-indicator", "planning remains visible after output");+ activity({ phase: "waiting-model", since: Date.now() });+ oneStatus(+ "run-activity-indicator",+ "runtime phase takes precedence over planning",+ );+ await render({ askPending: true });+ noStatus("question pending yields to user interaction");+ await render({+ askPending: false,+ pendingPermission: {+ sessionId,+ requestId: "permission",+ toolCallId: "call",+ toolName: "Bash",+ argsPreview: { command: "pwd" },+ risk: "low",+ reason: "fixture",+ receivedAt: Date.now(),+ },+ });+ noStatus("permission pending yields to approval");+ check(+ host.querySelector(".permission-card button"),+ "permission actions remain mounted",+ );+ const permissionTurn = host.querySelector(".assistant-turn");+ check(+ permissionTurn &&+ getComputedStyle(permissionTurn).paddingBottom === "14px",+ "permission card keeps the normal message spacing",+ );+ await render({ pendingPermission: undefined });+ flushSync(() =>+ useAppStore.setState({+ pendingPlans: {+ [sessionId]: {+ id: "proposal",+ sessionId,+ turnId: "turn",+ toolCallId: "submit",+ kind: "plan",+ title: "Review plan",+ markdown: "Plan",+ plan: "Plan",+ question: "Proceed?",+ version: 1,+ status: "pending",+ createdAt,+ updatedAt: createdAt,+ },+ },+ }),+ );+ noStatus("plan approval yields to user interaction");+ flushSync(() => useAppStore.setState({ pendingPlans: {} }));+ oneStatus("run-activity-indicator", "approval resolved restores activity");+ await render({ readingWindow: true });+ check(+ !host.querySelector(".transcript-runtime-status"),+ "history reading has no live lane",+ );+ await render({ readingWindow: false });+ oneStatus("run-activity-indicator", "return to latest restores activity");+ await render({ sessionId: "other-session", planningState: undefined });+ oneStatus(+ "working-indicator",+ "session switch cannot inherit another session's phase",+ );+ await render({ sessionId });+ oneStatus(+ "run-activity-indicator",+ "return to running session restores its own phase",+ );+ await render({ isRunning: false });+ noStatus("terminal turn hides even a retained runtime phase");+ return { ok: failures.length === 0, checks, failures };+ } finally {+ flushSync(() => root.unmount());+ host.remove();+ useAppStore.setState({+ settings: initial.settings,+ agentStatuses: initial.agentStatuses,+ pendingPlans: initial.pendingPlans,+ });+ }+}