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(asktool): scroll long question prompts inside the card (#1531)
Frank-zhu2000747c34cd262d
diff --git a/apps/desktop/src/styles/messages.css b/apps/desktop/src/styles/messages.cssindex a44acfdf0..d3d3a918f 100644--- a/apps/desktop/src/styles/messages.css+++ b/apps/desktop/src/styles/messages.css@@ -219,6 +219,13 @@.asktool-question-body {display: block;min-width: 0;+ /* Long prompts scroll here so header actions stay on screen (#1531).+ Short prompts keep today's layout: no reserved scrollbar gutter. */+ max-height: min(208px, 24vh);+ max-height: min(208px, 24dvh);+ overflow-x: hidden;+ overflow-y: auto;+ overscroll-behavior-y: contain;}.asktool-options {diff --git a/apps/desktop/test/permission-inline.test.mjs b/apps/desktop/test/permission-inline.test.mjsindex 3855fbf37..082e7559d 100644--- a/apps/desktop/test/permission-inline.test.mjs+++ b/apps/desktop/test/permission-inline.test.mjs@@ -173,6 +173,23 @@ test("asktool card is a stepwise, non-expiring composer question surface", () =>assert.match(messageStyleSource, /\.asktool-options[\s\S]*?overflow-y:\s*auto/);assert.match(messageStyleSource, /\.asktool-options[\s\S]*?max-height:\s*min\(208px,\s*24dvh\)/);assert.match(messageStyleSource, /\.asktool-options[\s\S]*?overscroll-behavior-y:\s*contain/);+ // A long question prompt scrolls inside the question body. Header actions+ // stay outside that scroller so Decline, Skip, and Next/Submit remain+ // reachable (issue #1531). The cap matches the option list.+ const questionBody = messageStyleSource.match(+ /\n\.asktool-question-body \{([^}]*)\}/,+ )?.[1];+ assert.ok(questionBody);+ assert.match(questionBody, /max-height:\s*min\(208px,\s*24vh\)/);+ assert.match(questionBody, /max-height:\s*min\(208px,\s*24dvh\)/);+ assert.match(questionBody, /overflow-x:\s*hidden/);+ assert.match(questionBody, /overflow-y:\s*auto/);+ assert.match(questionBody, /overscroll-behavior-y:\s*contain/);+ assert.doesNotMatch(questionBody, /scrollbar-gutter/);+ assert.match(+ askCardSource,+ /className="asktool-card-header-actions"[\s\S]*className="asktool-question-body"/,+ );// The card is a dock surface, not an in-flow tile: it paints the composer// plate with its shadow and its rows are inlaid on that plate (issue #360).assert.match(diff --git a/docs/spec/04-ux/11-asktool-question-card.md b/docs/spec/04-ux/11-asktool-question-card.mdindex 910ff5d0a..618a59f3d 100644--- a/docs/spec/04-ux/11-asktool-question-card.md+++ b/docs/spec/04-ux/11-asktool-question-card.md@@ -80,9 +80,14 @@ option list becomes the scroll container instead of allowing the composer dockto grow beyond the viewport. The list uses a dynamic viewport cap of`min(320px, 36dvh)` (with a `vh` fallback), keeps a stable scrollbar gutter,contains scroll chaining, and preserves keyboard scroll padding. The question-header, question text, custom-answer input, and Skip / Next / Submit actions-remain visible while the user scrolls through the options. This behavior also-applies on narrow screens; the card does not rely on page-level scrolling.+header, custom-answer input, and Skip / Next / Submit actions remain visible+while the user scrolls through the options. A long question prompt scrolls+inside the question body instead of growing the dock: the body uses+`min(208px, 24dvh)` with a `24vh` fallback, hides horizontal overflow, and+contains scroll chaining. Decline, Skip, and Next/Submit stay in the card+header, outside that scroller, so they remain reachable. Short prompts do not+reserve a scrollbar gutter. This behavior also applies on narrow screens; the+card does not rely on page-level scrolling.## Request transitionsdiff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.mdindex 12aaa7fcf..f054a558f 100644--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@ -10784,7 +10784,9 @@ This test plan spec is accepted when:fixture contains enough options to overflow, only that list scrolls and thequestion header, custom-answer input, and Skip / Next / Submit actions remainreachable. Scrolling the list does not move the conversation page or hide the- action row. The tool output is ordered as+ action row. A long question prompt is bounded the same way: the question body+ scrolls inside the card (`min(208px, 24dvh)`, with a `24vh` fallback) and the+ header actions stay outside that scroller. The tool output is ordered as`question:answer`, uses `、` between multiple answers and `\n---\n`between questions, andkeeps `question:` for the skipped question. Markdown renders as rich textdiff --git a/docs/zh-CN/spec/04-ux/11-asktool-question-card.md b/docs/zh-CN/spec/04-ux/11-asktool-question-card.mdindex b086a986e..9ec7bb787 100644--- a/docs/zh-CN/spec/04-ux/11-asktool-question-card.md+++ b/docs/zh-CN/spec/04-ux/11-asktool-question-card.md@@ -24,7 +24,9 @@ Asktool 卡是内联输入框批准表面,而不是许可该卡没有倒计时或到期副本。在窄屏幕上,选项仍然存在全角和动作可以共享行;问题文本和自定义输入可能-自然包裹,无需剪裁。+自然包裹,无需剪裁。问题正文过长时在正文内滚动,而不是把卡片撑出视口:+高度上限为 `min(208px, 24dvh)`,并提供 `24vh` 回退,横向溢出被隐藏,滚动链被限制在正文内。+Decline、Skip 和 Next/Submit 留在卡片标题栏,位于该滚动区域之外,因此仍然可点。短问题不预留滚动条槽。## 版式层级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 d25630fca..10b3760a5 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@@ -6551,7 +6551,8 @@ eleven-tool-round desktop paths are verified by- **预期**:一次可见一个问题;小指标显示输入框批准区域中已回答、当前和跳过的状态Plan 和 Goal 批准使用的停靠位置相同。请求没有- 倒计时。工具输出排序为 `question:answer`,使用 `、`+ 倒计时。过长的问题正文在卡片内滚动(`min(208px, 24dvh)`,并有 `24vh` 回退),标题栏上的+ Decline、Skip 和 Next/Submit 留在该滚动区域之外。工具输出排序为 `question:answer`,使用 `、`多个答案之间和问题之间的 `\n---\n` 之间,并保持`question:` 用于跳过的问题。拒绝所有产生空每个问题的占位符,仍然完成工具调用。