Skip to content

Commit cde5355

Browse files
aksOpsclaude
andcommitted
feat(ui): show last tool call time on session card
Card primary age now prefers last_tool_call_at over last_attached_at so the "X ago" next to each session matches the list sort order (a session you attached an hour ago but just ran a tool call in appears as "2m" not "1h"). When both timestamps are known: ⏵ 2m 1h where ⏵ 2m is the tool-call recency (dim foreground for the glyph, solid foreground for the number) and the trailing 1h shows last-attached dimmed — so users can see both "is it live" and "when did I last touch it" at a glance. Tooltips on each <time> element spell out which timestamp it is. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 232164a commit cde5355

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

ui/src/components/SessionCard.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ export function SessionCard({ session, active }: SessionCardProps) {
2727
tmux_alive: session.tmux_alive,
2828
last_tool_call_at: session.last_tool_call_at,
2929
});
30-
const last = session.last_attached_at ?? session.created_at;
30+
// Primary age display prefers live tool-call activity so the card's
31+
// "last X" matches the list sort; falls back through last-attached
32+
// and created-at when the engine hasn't seen a tool call yet.
33+
const lastTC = session.last_tool_call_at;
34+
const lastAttach = session.last_attached_at ?? session.created_at;
35+
const primary = lastTC ?? lastAttach;
36+
const primaryLabel = lastTC ? "last tool call" : "last attached";
3137

3238
return (
3339
<Link
@@ -70,7 +76,24 @@ export function SessionCard({ session, active }: SessionCardProps) {
7076
{Math.round(session.context_pct)}%
7177
</span>
7278
)}
73-
<time dateTime={last}>{relativeTime(last)}</time>
79+
{lastTC && (
80+
<time
81+
dateTime={lastTC}
82+
title={`last tool call ${lastTC}`}
83+
className="font-mono tabular-nums text-fg"
84+
aria-label="last tool call"
85+
>
86+
<span aria-hidden className="text-fg-muted"></span>{" "}
87+
{relativeTime(lastTC)}
88+
</time>
89+
)}
90+
<time
91+
dateTime={primary}
92+
title={`${primaryLabel} ${primary}`}
93+
className={cn(lastTC && "text-fg-muted")}
94+
>
95+
{lastTC ? relativeTime(lastAttach) : relativeTime(primary)}
96+
</time>
7497
</div>
7598
</div>
7699

0 commit comments

Comments
 (0)