Skip to content

Chat: show a datetime on each message (bottom-right) - #308

Merged
pufit merged 1 commit into
mainfrom
arsenmuk/chat-message-timestamps
Aug 13, 2026
Merged

Chat: show a datetime on each message (bottom-right)#308
pufit merged 1 commit into
mainfrom
arsenmuk/chat-message-timestamps

Conversation

@arsenmuk

Copy link
Copy Markdown
Member

What

Adds a compact local datetime to the bottom-right corner of every user prompt and assistant reply in the chat view.

  • Reuses the collapsed session-group counter styling (text-[10px] text-text-faint/60 tabular-nums); full precision on hover via title.
  • Format: Aug 13, 2:41 AM (locale-aware; yearless, no seconds).

How

Pure visualization of data that already exists: every message row persists created_at, GET /api/sessions/{id}/messages returns it, and hydrateMessage already copies it onto ChatMessage on history load. So historical/reloaded messages needed only a render.

Live (just-sent / just-streamed) messages are built client-side without a server timestamp, so they're stamped with the client clock at creation — the current turn shows a time immediately without a reload. Stamp sites: optimistic send (chatStore), assistant finalize done/stopped (streamingHandlers), backstop-finalize / answer-injected / cross-client user (sessionHandlers).

Files

  • new web/src/utils/messageTime.tsformatMessageTime()
  • web/src/components/Chat/{UserMessage,AssistantMessage}.tsx — render
  • web/src/stores/chatStore.ts, web/src/stores/handlers/{streamingHandlers,sessionHandlers}.ts — client-stamp live messages

Notes

  • Skipped on review-loop milestone cards and transient error bubbles (not conversational turns).

Test

  • npm run build (tsc typecheck + vite bundle) — green.

🤖 Generated with Claude Code

Visualize the per-message created_at (already persisted server-side and
preserved by hydrateMessage on history load) as a compact local datetime
in the bottom-right corner of every user prompt and assistant reply. The
label reuses the collapsed session-group counter styling
(text-[10px] text-text-faint/60 tabular-nums); full precision on hover.

Live (just-sent / just-streamed) messages are created client-side without
a server timestamp, so stamp them with the client clock at creation, so the
current turn shows a time immediately without needing a reload.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pufit
pufit merged commit 5bd26ea into main Aug 13, 2026
2 checks passed
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