Skip to content

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

fix(transcript): read message chips at the message's own type scale

vastsad3c2ba211d34
diff --git a/apps/desktop/src/styles/messages.css b/apps/desktop/src/styles/messages.css
index dbed064fe..489a553c5 100644
--- a/apps/desktop/src/styles/messages.css
+++ b/apps/desktop/src/styles/messages.css
@@ -50,6 +50,18 @@
max-width: 240px;
}
+/* 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. */
+.message-row .composer-chip {
+ height: auto;
+ min-height: 20px;
+ padding: 1px 7px;
+ font: inherit;
+ line-height: inherit;
+ vertical-align: middle;
+}
+
.message-row.assistant .message-col,
.message-row.system .message-col,
.message-row.tool .message-col {
diff --git a/apps/desktop/test/renderer-review-fixes.test.mjs b/apps/desktop/test/renderer-review-fixes.test.mjs
index 526d789a6..13070cb0d 100644
--- a/apps/desktop/test/renderer-review-fixes.test.mjs
+++ b/apps/desktop/test/renderer-review-fixes.test.mjs
@@ -67,6 +67,18 @@ test("message image chips carry no tile or stroke of their own (D297)", () => {
assert.match(block, /display: inline-flex;/);
});
+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.
+ assert.match(block, /font: inherit;/);
+ assert.match(block, /height: auto;/);
+ assert.match(block, /line-height: inherit;/);
+ assert.doesNotMatch(block, /--text-xs-plus/);
+});
+
test("dead components are gone", () => {
assert.ok(!existsSync(join(here, "../src/components/Topbar.tsx")));
assert.ok(!existsSync(join(here, "../src/components/HomeQuickActions.tsx")));
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index 13a5c07d6..3f87d48c5 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -4238,6 +4238,8 @@ 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.
- 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 f1a4e49f2..471008bfe 100644
--- a/docs/zh-CN/spec/04-ux/08-component-spec.md
+++ b/docs/zh-CN/spec/04-ux/08-component-spec.md
@@ -2943,6 +2943,7 @@ Sidebar footer Popover (360px max)
- 边界:只读取同一项目的对话,当前对话在任何读取之前就被丢弃,指向其他项目、不存
在的 id 或 `remote:` 标识的链接保持纯文本,不会变成引用。粘贴无法让应用读取读者
本来打不开的转写。
+- 消息里的芯片沿用该消息自身的字体、字号与行高;输入框那套 11.5px/20px 的紧凑尺寸只属于草稿。
- 芯片是按钮,无障碍名称由语言目录生成,工具提示说明它会打开哪段对话;可键盘激活,
并保持周围可选中的消息文本不变。
- `pi-desktop://` 目前还不是操作系统协议处理器;从应用外打开链接是另一项改动