Skip to content

Add message timestamps with relative/absolute formatting#48

Merged
trialiya merged 5 commits into
mainfrom
claude/elegant-brahmagupta-mf2n4f
Jun 21, 2026
Merged

Add message timestamps with relative/absolute formatting#48
trialiya merged 5 commits into
mainfrom
claude/elegant-brahmagupta-mf2n4f

Conversation

@trialiya

Copy link
Copy Markdown
Owner

Summary

Add timestamp display to chat messages with smart formatting: relative time (e.g., "5 мин. назад") for messages < 24 hours old, and absolute date (e.g., "15 янв.") for older messages.

Changes

  • Message.jsx:

    • Add formatTimestamp() utility function that converts timestamps to user-friendly labels (relative for < 24h, absolute date otherwise)
    • Accept timestamp prop in Message component
    • Restructure AI message UI: move copy/source buttons into new .message-footer container below message content, add timestamp display
    • Restructure user message UI: move timestamp and copy button into .message-footer below message text
  • toolbar.css:

    • Replace .message-source-toggle and .message-toolbar with unified .message-footer layout
    • Footer uses space-between to position timestamp on left and action buttons on right
    • Add .message-footer-time styling (small, muted text, no selection)
    • Adjust spacing and alignment for both AI and user message variants
  • ChatWindow.jsx: Pass createdAt timestamp from message data to bubble objects

  • MessageList.jsx: Forward timestamp prop to Message component

Implementation notes

  • Timestamps are optional (gracefully handle null/undefined)
  • Relative time formatting uses Russian locale and labels ("мин.", "ч.", "назад")
  • Timestamps older than 24 hours display as short date format (day + abbreviated month in Russian)
  • Invalid/future timestamps are filtered out

https://claude.ai/code/session_0197sTYR9EjMxRR9Q2m46cbL

claude and others added 5 commits June 20, 2026 22:42
…tamp

Buttons (copy, source toggle) moved from top to bottom of each message bubble.
Timestamp shown left-aligned in the footer: relative time (< 24h) or short date.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197sTYR9EjMxRR9Q2m46cbL
# Conflicts:
#	frontend/src/components/chatPanel/Message.jsx
#	frontend/src/components/chatPanel/MessageList.jsx
…roper alignment

- transformPage read wrong field (m.createdAt → m.timestamp); backend ChatMessage
  exposes `timestamp`, so dates were always null. History now shows time/date.
- Live bubbles (optimistic user echo, streamed AI) now get a client-side timestamp
  so the date appears immediately, before reload.
- Message render reverted during rebase: footer was back inside the bubble without
  the .message-block wrapper, breaking width and alignment. Restored footer outside
  the bubble; AI block left-aligned with buttons on the right, user block right-
  aligned with buttons on the left.
- toolbar.css footer styles updated for the new out-of-bubble placement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197sTYR9EjMxRR9Q2m46cbL
User message footer: copy button left, date right (mirror of AI layout).
Both AI and user time labels show full date+time on hover via native title tooltip.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197sTYR9EjMxRR9Q2m46cbL
@trialiya trialiya merged commit 24da06a into main Jun 21, 2026
5 checks passed
@trialiya trialiya deleted the claude/elegant-brahmagupta-mf2n4f branch June 21, 2026 14:10
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