From 0c5fef739de40a406d2db33c127c7234b73bd48d Mon Sep 17 00:00:00 2001 From: Ariane Emory Date: Sat, 21 Feb 2026 15:12:52 -0500 Subject: [PATCH 1/3] feat: show full datetime for non-today messages in timeline and fork dialogs --- .../session/dialog-fork-from-timeline.tsx | 2 +- .../tui/routes/session/dialog-timeline.tsx | 2 +- packages/opencode/src/util/locale.ts | 21 +++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx index 62154cce563..d85a39a1a0f 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx @@ -30,7 +30,7 @@ export function DialogForkFromTimeline(props: { sessionID: string; onMove: (mess result.push({ title: part.text.replace(/\n/g, " "), value: message.id, - footer: Locale.time(message.time.created), + footer: Locale.shortDateTime(message.time.created), onSelect: async (dialog) => { const forked = await sdk.client.session.fork({ sessionID: props.sessionID, diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/dialog-timeline.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-timeline.tsx index 87248a6a8ba..2cf50ef2e42 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/dialog-timeline.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/dialog-timeline.tsx @@ -31,7 +31,7 @@ export function DialogTimeline(props: { result.push({ title: part.text.replace(/\n/g, " "), value: message.id, - footer: Locale.time(message.time.created), + footer: Locale.shortDateTime(message.time.created), onSelect: (dialog) => { dialog.replace(() => ( diff --git a/packages/opencode/src/util/locale.ts b/packages/opencode/src/util/locale.ts index 653da09a0b7..26898c85048 100644 --- a/packages/opencode/src/util/locale.ts +++ b/packages/opencode/src/util/locale.ts @@ -1,4 +1,6 @@ export namespace Locale { + const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + export function titlecase(str: string) { return str.replace(/\b\w/g, (c) => c.toUpperCase()) } @@ -28,6 +30,25 @@ export namespace Locale { } } + export function shortDateTime(input: number): string { + const date = new Date(input) + const now = new Date() + const isToday = + date.getFullYear() === now.getFullYear() && + date.getMonth() === now.getMonth() && + date.getDate() === now.getDate() + + const timeStr = time(input) + + if (isToday) { + return timeStr + } else { + const month = MONTHS[date.getMonth()] + const day = date.getDate() + return `${month} ${day} ${timeStr}` + } + } + export function number(num: number): string { if (num >= 1000000) { return (num / 1000000).toFixed(1) + "M" From 79a6608e980e51c42acf533c3b36bd47ce3525ca Mon Sep 17 00:00:00 2001 From: Ariane Emory Date: Tue, 3 Mar 2026 19:25:07 -0500 Subject: [PATCH 2/3] fix: remove dot separator and pad days for alignment --- packages/opencode/src/util/locale.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/util/locale.ts b/packages/opencode/src/util/locale.ts index 26898c85048..8a8e8f62031 100644 --- a/packages/opencode/src/util/locale.ts +++ b/packages/opencode/src/util/locale.ts @@ -13,8 +13,13 @@ export namespace Locale { export function datetime(input: number): string { const date = new Date(input) const localTime = time(input) - const localDate = date.toLocaleDateString() - return `${localTime} ยท ${localDate}` + const month = date.getMonth() + 1 + const day = date.getDate() + const year = date.getFullYear() + // Pad day with leading space if single digit for alignment + const paddedDay = day < 10 ? ` ${day}` : day.toString() + const localDate = `${month}/${paddedDay}/${year}` + return `${localTime} ${localDate}` } export function todayTimeOrDateTime(input: number): string { From 25e5391dc8dd90f3587c0adcefc8747a6a3d83c6 Mon Sep 17 00:00:00 2001 From: Ariane Emory Date: Tue, 3 Mar 2026 20:06:15 -0500 Subject: [PATCH 3/3] fix: pad single-digit days in shortDateTime for alignment --- packages/opencode/src/util/locale.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/util/locale.ts b/packages/opencode/src/util/locale.ts index 8a8e8f62031..e61fdbd1c6d 100644 --- a/packages/opencode/src/util/locale.ts +++ b/packages/opencode/src/util/locale.ts @@ -50,7 +50,9 @@ export namespace Locale { } else { const month = MONTHS[date.getMonth()] const day = date.getDate() - return `${month} ${day} ${timeStr}` + // Pad day with leading space if single digit for alignment + const paddedDay = day < 10 ? ` ${day}` : day.toString() + return `${month} ${paddedDay} ${timeStr}` } }