Skip to content

feat(messages): show message timestamp on hover#1986

Merged
piorpua merged 1 commit intomainfrom
zk/feat/message-timestamp
Mar 31, 2026
Merged

feat(messages): show message timestamp on hover#1986
piorpua merged 1 commit intomainfrom
zk/feat/message-timestamp

Conversation

@kaizhou-lab
Copy link
Copy Markdown
Collaborator

Summary

  • Display the message creation time next to the copy button when hovering over a message
  • Shows HH:mm for today's messages, MM-DD HH:mm for older ones
  • Uses the same opacity transition as the existing copy button for consistent UX

Closes #1985

Test plan

  • Hover over a message and verify the timestamp appears alongside the copy button
  • Verify today's messages show HH:mm format
  • Verify older messages show MM-DD HH:mm format
  • Verify user messages (right-aligned) show time on the correct side
  • Verify timestamp hides when cursor leaves the message

Display the creation time next to the copy button when hovering over a
message. Shows HH:mm for today's messages and MM-DD HH:mm for older ones.
@piorpua piorpua added the bot:reviewing Review in progress (mutex) label Mar 31, 2026
@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 31, 2026

Code Review:feat(messages): show message timestamp on hover (#1986)

变更概述

本 PR 在消息气泡的复制按钮旁新增了悬停显示时间戳的功能。当日消息显示 HH:mm,非当日消息显示 MM-DD HH:mm。改动集中在 MessagetText.tsx 一个文件,新增约 20 行代码。


方案评估

结论:✅ 方案合理

方案简洁有效:复用已有的 group-hover 机制实现悬停显示,与复制按钮的交互模式一致;flex-row-reverse 替代原有的 justify-end/justify-start 方案更优雅,自动处理了用户消息(右对齐)场景下时间戳和按钮的位置关系;formatTime 使用 useCallback 包裹且无外部依赖,实现正确。


问题清单

✅ 未发现明显问题,代码质量良好,建议批准合并。


汇总

无问题。

结论

批准合并 — 改动简洁、方案合理,与现有 UX 模式一致,无阻塞性问题。


本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。

CONCLUSION: APPROVED
IS_CRITICAL_PATH: false
PR_NUMBER: 1986

@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 31, 2026

✅ 已自动 review,无阻塞性问题,正在触发自动合并。

@piorpua piorpua merged commit b03f371 into main Mar 31, 2026
17 checks passed
@piorpua piorpua deleted the zk/feat/message-timestamp branch March 31, 2026 11:15
@piorpua piorpua added bot:done Auto-merged by bot and removed bot:reviewing Review in progress (mutex) labels Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:done Auto-merged by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: show message creation time on hover

2 participants