feat: show full date/time and unix timestamp on time hover

Hovering over the message time now shows a tooltip with the full
human-readable date/time and the unix timestamp below it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Tudisco 2026-03-16 19:21:24 -06:00
parent b963c96915
commit 16bc3315eb

View File

@ -22,7 +22,7 @@
<div class="message-body">
<div class={'message-header ' + (props.isOwn ? 'own' : '')}>
<span class="sender-name">{props.message?.sender_name}</span>
<span class="message-time">{formatTime(props.message?.created_at)}</span>
<span class="message-time" title={fullTimestamp(props.message?.created_at)}>{formatTime(props.message?.created_at)}</span>
<span if={props.message?.hash} class="message-hash" title={props.message.hash}>{props.message.hash.slice(0, 7)}</span>
</div>
<div if={hasToolResults()} class="tool-results-section">
@ -431,6 +431,14 @@
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
},
fullTimestamp(dateStr) {
if (!dateStr) return ''
const date = new Date(dateStr)
const human = date.toLocaleString([], { dateStyle: 'full', timeStyle: 'long' })
const unix = Math.floor(date.getTime() / 1000)
return `${human}\nUnix: ${unix}`
},
formatModel(model) {
if (!model) return 'unknown'
// "openai/gpt-4o" → "gpt-4o", "anthropic/claude-3.5-sonnet" → "claude-3.5-sonnet"