Skip to content

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

fix(transcript): size a message chip by the message's own line

vastsa9b44856b7b6b
diff --git a/apps/desktop/src/styles/messages.css b/apps/desktop/src/styles/messages.css
index 489a553c5..c785789bc 100644
--- a/apps/desktop/src/styles/messages.css
+++ b/apps/desktop/src/styles/messages.css
@@ -51,15 +51,17 @@
}
/* A chip inside a message belongs to that message: it borrows the message's own
- face, size and leading and only keeps the tile surface. The composer's
- compact 11.5px/20px metric is a draft-only box. */
+ face, size and leading and only keeps the tile surface. The composer's fixed
+ 11.5px/20px box is a draft-only metric, and as a message chip it clipped the
+ message's own line box. Sized by the inherited leading and aligned to the
+ line, the tile covers exactly one line of message text, so the label sits on
+ that line's baseline and the chip reads as a run of it. */
.message-row .composer-chip {
height: auto;
- min-height: 20px;
- padding: 1px 7px;
+ padding: 0 6px;
font: inherit;
line-height: inherit;
- vertical-align: middle;
+ vertical-align: top;
}
.message-row.assistant .message-col,
diff --git a/apps/desktop/test/renderer-review-fixes.test.mjs b/apps/desktop/test/renderer-review-fixes.test.mjs
index 13070cb0d..e5e91e7cf 100644
--- a/apps/desktop/test/renderer-review-fixes.test.mjs
+++ b/apps/desktop/test/renderer-review-fixes.test.mjs
@@ -71,12 +71,15 @@ test("a chip inside a message reads at that message's own type scale", () => {
const start = messages.indexOf(".message-row .composer-chip {");
assert.notEqual(start, -1, "message chip type rule is missing");
const block = messages.slice(start, messages.indexOf("}", start));
- // The composer's compact 11.5px/20px chip is a draft-only box; in a message
- // the chip borrows the face, size and leading around it.
+ // The composer's fixed 11.5px/20px chip is a draft-only box. In a message the
+ // tile is sized by the inherited leading and sits on the line, so the label
+ // reads on the message's own baseline instead of poking out of a 20px tile.
assert.match(block, /font: inherit;/);
assert.match(block, /height: auto;/);
assert.match(block, /line-height: inherit;/);
+ assert.match(block, /vertical-align: top;/);
assert.doesNotMatch(block, /--text-xs-plus/);
+ assert.doesNotMatch(block, /height: 20px/);
});
test("dead components are gone", () => {
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 3f87d48c5..ac9907d86 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -4238,8 +4238,10 @@ Conversation overflow Composer draft (unsent)
unknown id, or a `remote:` identifier stays plaintext rather than becoming a
reference. A paste cannot make the app read a transcript its reader could not
open.
-- A chip inside a message borrows that message's own face, size and leading;
- the composer's compact 11.5px/20px metric is a draft-only box.
+- A chip inside a message borrows that message's own face, size and leading, and
+ its tile is sized and aligned by that leading so it covers exactly one line of
+ message text: the label sits on the line's baseline instead of poking out of
+ the composer's compact box. The 11.5px/20px metric is draft-only.
- The chip is a button with a catalog-built accessible name and a tooltip
naming the conversation it opens; it is keyboard-activatable and leaves the
surrounding selectable message text intact.
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 471008bfe..b201bfdca 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -2943,7 +2943,8 @@ Sidebar footer Popover (360px max)
- 边界:只读取同一项目的对话,当前对话在任何读取之前就被丢弃,指向其他项目、不存
在的 id 或 `remote:` 标识的链接保持纯文本,不会变成引用。粘贴无法让应用读取读者
本来打不开的转写。
-- 消息里的芯片沿用该消息自身的字体、字号与行高;输入框那套 11.5px/20px 的紧凑尺寸只属于草稿。
+- 消息里的芯片沿用该消息自身的字体、字号与行高,底色块按该行高取尺寸与对齐,正好覆盖
+ 一行消息文本:标签落在该行基线上,不再从输入框那套紧凑盒子里冒出来。11.5px/20px 的尺寸只属于草稿。
- 芯片是按钮,无障碍名称由语言目录生成,工具提示说明它会打开哪段对话;可键盘激活,
并保持周围可选中的消息文本不变。
- `pi-desktop://` 目前还不是操作系统协议处理器;从应用外打开链接是另一项改动