fix(chat): wrap long slash command chips in the transcript (#1019) - #1031
Merged
Merged
Conversation
The transcript chip for typed slash invocations kept the single-line truncation written for short commands like /compact: white-space nowrap with a text-overflow ellipsis. Skill invocations (D393/ADR 0219) store the user's whole typed body in the same command field, so sending a long skill invocation collapsed the message to one ellipsized line that could not be read. Drop the truncation rules and let the chip follow the wrapping model of .message-user-text (white-space pre-wrap, overflow-wrap anywhere), so the typed body wraps at the bubble edge with the user's paragraph breaks preserved and long unbroken tokens cannot overflow. Vertical alignment moves to the top so multi-line chips sit flush with the bubble like single-line ones. Short commands remain compact single-line chips.
Restore stable tab-panel associations after the shared control migration and keep composer menus on the existing theme and scrollbar contracts. These regressions blocked CI independently of transcript command wrapping. Update stale source assertions for the current settings and compact menu layout, and cover localized tab associations and selection semantics with a rendered shared-control regression test.
Electron delivers synthetic Tab input asynchronously. Wait for the first search field to receive focus before the probe blurs it, so the initial unfocused paint sample cannot race with the keyboard focus seed.
vastsa
force-pushed
the
fix/transcript-command-chip-wrap
branch
from
September 24, 2026 18:31
7443f68 to
7e20006
Compare
Contributor
Author
|
@vastsa 佬,中秋快乐,晚安 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / 问题
在输入框选择一个 Skill(如
/nature-polishing),粘贴多段较长文字后发送,聊天记录中的用户消息被渲染为单行命令 chip,超出气泡宽度时以省略号截断;同样的正文不带 Skill 时可以正常换行(与 issue #1019 的现象一致)。修复前:Skill 消息与普通消息的对比(同一段正文)——
原因:
.chat-command-chip沿用了短 slash 命令时代的white-space: nowrap+text-overflow: ellipsis。D393 / ADR 0219 之后,Skill 调用的 typed form(命令名 + 用户整段正文)也存入command字段并渲染为同一个 chip,单行截断对这种内容不再成立。普通消息容器.message-user-text本身是pre-wrap+overflow-wrap: break-word的换行模型,chip 把它覆盖了。Proposed change / 期望改动
让 chip 跟随
.message-user-text的换行模型:white-space: pre-wrap、overflow-wrap: anywhere,移除overflow: hidden/text-overflow: ellipsis;加vertical-align: top,多行 chip 与单行一样贴齐气泡。短命令(/compact等)仍是紧凑单行 chip。规范只要求记录中以等宽命令 chip 呈现 typed form(component-spec §11.8),未要求单行,无规范改动。修复后:正文按气泡宽度换行、段落与超长 token 均正常折行——
Verification / 验证
ChatTranscript组件 + 构建产物样式,Electron 内量几何):修复前长 chip 单行 23.4px、内容水平被裁约 2998px;修复后约 13 行,段落换行保留,无水平裁剪,不超出气泡;/compact短 chip 仍为单行。即上文两张截图。pnpm --filter @pi-desktop/desktop typecheck通过;node scripts/e2e-transcript-render.mjs、node scripts/e2e-composer-autocomplete.mjs通过。35d690374的 2 处样式违规和 13 项 desktop 测试失败已在后续提交修复(见下方)。CI 跟进修复
首次 CI 被主分支已有的样式违规阻塞。后续提交保留原有换行改动,并修复阻塞项:
本地验证:
pnpm build:js、desktop typecheck、pnpm lint、架构检查通过;完整 JS 测试 5,460 项通过、1 项按既有条件跳过。e2e-transcript-render、e2e-composer-autocomplete、e2e-theme-surfaces通过。当前基线35d690374;远端 CI 结果以本 PR checks 为准。Fixes #1019