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:
parent
b963c96915
commit
16bc3315eb
@ -22,7 +22,7 @@
|
|||||||
<div class="message-body">
|
<div class="message-body">
|
||||||
<div class={'message-header ' + (props.isOwn ? 'own' : '')}>
|
<div class={'message-header ' + (props.isOwn ? 'own' : '')}>
|
||||||
<span class="sender-name">{props.message?.sender_name}</span>
|
<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>
|
<span if={props.message?.hash} class="message-hash" title={props.message.hash}>{props.message.hash.slice(0, 7)}</span>
|
||||||
</div>
|
</div>
|
||||||
<div if={hasToolResults()} class="tool-results-section">
|
<div if={hasToolResults()} class="tool-results-section">
|
||||||
@ -431,6 +431,14 @@
|
|||||||
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
|
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) {
|
formatModel(model) {
|
||||||
if (!model) return 'unknown'
|
if (!model) return 'unknown'
|
||||||
// "openai/gpt-4o" → "gpt-4o", "anthropic/claude-3.5-sonnet" → "claude-3.5-sonnet"
|
// "openai/gpt-4o" → "gpt-4o", "anthropic/claude-3.5-sonnet" → "claude-3.5-sonnet"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user