Skip to content

fix(app): match assistant reply timestamp size with user messages - #5429

Merged
chengluyu merged 2 commits into
MoonshotAI:mainfrom
kimi-agent-bot:fix/chat-assistant-time-font-size
Nov 25, 2026
Merged

chengluyu merged 2 commits into
MoonshotAI:mainfrom
kimi-agent-bot:fix/chat-assistant-time-font-size

Conversation

@kimi-agent-bot

@kimi-agent-bot kimi-agent-bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Screenshots / Recordings

以下截图均来自真实桌面端 Electron 窗口(2 倍局部放大,上:修改前;下:修改后)。请看两处时间戳:修改前助手回复点赞 / 点踩按钮旁的时间比上方用户消息时间更小、更淡(12px);修改后两处时间戳字号、行高与颜色完全一致(14px / 20px)。

深色主题

深色主题修改前后对比

浅色主题

浅色主题修改前后对比

原始比例截图(深色 / 浅色 · 修改前 / 修改后)
深色 · 修改前 深色 · 修改后
深色修改前 深色修改后
浅色 · 修改前 浅色 · 修改后
浅色修改前 浅色修改后

Requirement or Bug

桌面端与 kimi web 会话中,当助手回复下方显示点赞 / 点踩反馈按钮时,按钮旁的消息时间戳字号(12px)比上方用户消息的时间戳(14px)更小,颜色也更淡,同一组对话里的两处时间显示不一致。

本 PR 去掉反馈操作栏对助手时间戳的字号、行高与颜色覆盖,让助手回复时间戳与用户消息时间戳统一为 14px / 20px 和 --color-text-muted,同时保留原有的 6px 水平间距。

Bug Reproduction Steps

  1. 在支持回复反馈的桌面端或 kimi web 会话中发送一条消息(如 hi)。
  2. 等待助手回复完成,确认回复下方出现复制、分叉、点赞、点踩按钮及时间戳。
  3. 对比用户气泡下方的时间戳与助手回复反馈按钮旁的时间戳:修改前助手侧为 12px / 18px 且颜色更淡,用户侧为 14px / 20px。

Root Cause

packages/app-components/src/chat/ChatPane.vue 中 .a-time 的基础样式本就是 font-size: var(--text-base)(14px)、line-height: 20px、color: var(--color-text-muted),与用户消息时间 .u-meta :deep(.msg-time) 一致。但回复反馈功能引入的 .a-msg-meta:has(> .a-reply-actions > *) .a-time 在渲染点赞 / 点踩按钮时额外覆盖了 font-size: var(--ui-c1)(12px)、line-height: 1.5(18px)以及 color: light-dark(rgb(0 0 0 / 45%), rgb(255 255 255 / 42%)),导致助手时间戳变小变淡。

这是根本修复:删除这三条视觉覆盖,让时间戳自然回落到 .a-time 基础样式,仅保留该规则原本用于分隔按钮与时间的 margin-inline: 6px。

Code Changes

 .a-msg-meta:has(> .a-reply-actions > *) .a-time {
   margin-inline: 6px;
-  color: light-dark(rgb(0 0 0 / 45%), rgb(255 255 255 / 42%));
-  font-size: var(--ui-c1);
-  line-height: 1.5;
 }

改动只涉及 ChatPane.vue 一处 CSS 规则:间距仍由 .a-msg-meta:has(> .a-reply-actions > *) 的 gap: 2px 和 .a-time 的 margin-inline: 6px 控制,所以按钮与时间之间的布局间距不变;因为字号、行高和颜色不再被覆盖,带反馈按钮的助手回复时间戳与用户消息、无反馈按钮的助手回复及会话内其他时间戳保持一致。

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
显示点赞 / 点踩按钮时助手回复的时间戳字号、行高与颜色 12px 字号、18px 行高;浅色 rgb(0 0 0 / 45%)、深色 rgb(255 255 255 / 42%) 14px 字号(--text-base)、20px 行高、--color-text-muted(浅色 rgb(0 0 0 / 68%)、深色 rgb(255 255 255 / 64%)),与用户消息时间戳一致 桌面端与 kimi web 中查看已完成助手回复的用户;无 API 或数据消费者依赖旧样式 无(纯视觉对齐)
反馈按钮与时间戳的水平间距 6px 保持 6px 不变 桌面端与 kimi web 用户 N/A
无回复反馈按钮的助手回复时间戳、用户消息时间戳 14px / 20px、--color-text-muted 不变 不支持反馈的会话及所有用户消息 N/A
会话数据、KAP 协议、CLI TUI、VS Code、ACP、SDK — 不变:仅修改共享聊天组件 CSS TUI、print、VS Code、ACP、SDK 及外部 KAP 调用方 N/A

受影响模块与测试覆盖:

  • packages/app-components/src/chat/ChatPane.vue 同时服务于桌面端(kimi-code-app)和 Web 端(@moonshot-ai/kimi-code 的 kimi web),两端样式一并修复。
  • 按要求本次不新增或修改测试文件;通过真实 Electron 应用(Electron 45,Linux xvfb)在同一假模型会话(hi / Hi! What can I help you with today?)中分别截取修改前与修改后画面,并用 getComputedStyle 与文本 Range 实测两处时间戳。
真实 Electron 实测计算样式与验证命令

深色主题实测:

元素 修改前 font-size / line-height / color 修改后 font-size / line-height / color 修改前文本 Range 宽×高 修改后文本 Range 宽×高
用户消息时间 .u-meta .msg-time 14px / 20px / rgba(255, 255, 255, 0.64) 14px / 20px / rgba(255, 255, 255, 0.64) 29.78 × 18 29.84 × 18
助手回复时间 .a-msg-meta .a-time 12px / 18px / rgba(255, 255, 255, 0.42) 14px / 20px / rgba(255, 255, 255, 0.64) 25.53 × 15 29.84 × 18

浅色主题实测:用户消息时间为 14px / 20px / rgba(0, 0, 0, 0.68);助手回复时间由 12px / 18px / rgba(0, 0, 0, 0.45) 变为 14px / 20px / rgba(0, 0, 0, 0.68),与用户消息完全一致。

验证命令(串行执行,全部通过):

  • pnpm exec vitest run --reporter=agent packages/app-components:99 个测试文件、993 条既有用例全部通过。
  • pnpm typecheck:全仓类型检查(含 vue-tsc --noEmit -p tsconfig.renderer.json)通过。
  • pnpm lint:通过,0 警告 0 错误。
  • pnpm run check:duplication e105ef0d25feb346bfda0bd4ad4246805fc2009f:通过,无新增重复代码。
  • 平台核对:Linux(xvfb + Electron 45 真实构建产物);改动仅为跨平台 CSS 声明删除,不涉及路径、子进程或终端差异,Windows / macOS 未单独实测。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.(按要求不新增测试文件,以既有单测与真实 Electron 前后实测验收)
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T13:25:50.178055Z 7ec07d0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

kimi-agent-bot added a commit that referenced this pull request Nov 25, 2026
@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@77637f6
npx https://pkg.pr.new/@moonshot-ai/kimi-code@77637f6

commit: 77637f6

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 7ec07d0566

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@changeset-bot

changeset-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 77637f6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kimi-code-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chengluyu
chengluyu merged commit 0d50327 into MoonshotAI:main Nov 25, 2026
21 checks passed
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Dec 2, 2026
`bun scripts/upstream-ledger.mjs --refresh` at upstream/main 4eb2919
added 126 rows, so every open upstream commit and every PR it references
now has a ledger row: 0/596, down from 125 at 8bf8ba3 and 126 at the
fetched tip. The refresh only reads `upstream/main ^ main`, so the three
release-2.6.2 commits named by the mission (MoonshotAI#4875/MoonshotAI#4905/MoonshotAI#4922) gained
rows with the refresh's row shape.

Settled with live probes in this tree:

- ported: MoonshotAI#5533 (docs 2.8.1 changelog), MoonshotAI#4875 (registry search_url and
  feedback_url plus the feedback service), MoonshotAI#4905 (Kimi upload status
  validation in packages/core), MoonshotAI#4922 (swarm task events in
  sessionTaskFeed), MoonshotAI#5438 (unload only declared dynamic tools), MoonshotAI#5592
  (dynamic tool replacement order), MoonshotAI#5595 (append-log known length),
  MoonshotAI#5573 (skill roots for every work dir), MoonshotAI#5576 (date reminder cwd
  comparison), MoonshotAI#5618 (session titles for skill openers), MoonshotAI#5638 (frozen
  loop tool baseline), MoonshotAI#5626 (legacy turn-input origins)
- partial: MoonshotAI#5505 (processLiveness source and consumers present; the
  upstream unit test file was never carried), MoonshotAI#5571 (program-resume and
  OSC 7577 present; the upstream test helper was never carried), MoonshotAI#5532
  (gitService half present; fsService still leaks the environment lease
  at fsService.ts:1133 and :1267), MoonshotAI#5557 (app-client icon registry kept;
  the move to app-ui was never carried)
- not-applicable: MoonshotAI#4655 (upstream reverted auto review in MoonshotAI#5649), MoonshotAI#5333
  (PLAYBOOK:111 deliberate flat experimental flags)

M39's "likely present" list was checked, not trusted: MoonshotAI#5438 is present
(upstream test passes), MoonshotAI#5487 is not (nativeStartSettleMs/leg.nativeSettled
absent), MoonshotAI#5635 is not (ToolsSettled absent), MoonshotAI#5429 needs a visual probe.
The remaining 194 pending rows stay open with their reasons; no feature
was ported and no upstream-drift allowlist entry was added.

Verification: verify -> 332 closed rows, 332 carry every file of their
PR; 317 probes pass, 2 foreign-runner skips, 0 fail; a second verify is
byte-identical (ledger sha256 cbf53638...). Probe tests 29 pass; bun run
lint and node scripts/checks/ratchet.mjs green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants