qwen-code/packages/web-shell/client/components/MessageTimestamp.module.css
Shaojin Wen 84d01e7070
feat(web-shell): show message time on hover (#5079)
* fix(acp-bridge): preserve original timestamp when replaying session history

History replay re-emits each persisted record with its original epoch-ms time nested in update._meta, but BridgeClient.sessionUpdate published the frame without lifting it to the envelope. EventBus.publish then stamped envelope _meta.serverTimestamp with publish-time Date.now(), which the client's extractServerTimestamp picks up at higher priority than the nested original — so a resumed session rendered every historical message at the resume moment instead of when it was sent.

Lift update._meta.timestamp (or serverTimestamp) to the envelope serverTimestamp so EventBus preserves it. Live updates without such a timestamp keep the Date.now() fallback unchanged.

* feat(web-shell): show each history message's time on hover

Carry each transcript block's wall-clock time (serverTimestamp ?? clientReceivedAt) onto every message and reveal it as a CSS-only hover tooltip in the message list. Same-day messages show HH:mm:ss; older ones show yyyy-MM-dd HH:mm:ss (local time, zero-padded).
2026-06-13 15:30:44 +08:00

28 lines
696 B
CSS

.row {
position: relative;
}
/*
* Anchored inside the message's top-right corner rather than floating above
* it: the message list (`.list`) is `overflow-y: auto`, so a tooltip spilling
* outside the row box would be clipped or trigger a scrollbar. Staying within
* the row keeps it visible at the scroll edges. `pointer-events: none` lets
* clicks and inner hover interactions (tool expand, links) pass through.
*/
.tip {
position: absolute;
top: 2px;
right: 4px;
z-index: 5;
color: var(--text-dimmed);
font-size: 11px;
line-height: 1.4;
white-space: nowrap;
pointer-events: none;
opacity: 0;
transition: opacity 0.12s ease;
}
.row:hover > .tip {
opacity: 1;
}