From b64515225517811e17d51ddf4ce76da7e9960c58 Mon Sep 17 00:00:00 2001
From: zhb <50901800+zhbdesign@users.noreply.github.com>
Date: Sun, 28 Jun 2026 01:53:15 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=8F=98?=
=?UTF-8?q?=E5=8C=96=EF=BC=8C=E6=B6=88=E6=81=AF=E6=97=B6=E9=97=B4=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=9C=88=E6=97=A5=E6=97=B6=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复查看更新更新时间变化,消息时间显示月日时分
---
desktop/src/stores/sessionStore.ts | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/desktop/src/stores/sessionStore.ts b/desktop/src/stores/sessionStore.ts
index ceeaaf82..439ec0d0 100644
--- a/desktop/src/stores/sessionStore.ts
+++ b/desktop/src/stores/sessionStore.ts
@@ -244,9 +244,10 @@ function mergeSessionList(
for (const item of incoming) {
const current = currentById.get(item.id)
const candidate = preserveLocalTitle(current, item)
- const existing = byId.get(candidate.id)
- if (!existing || sessionModifiedTime(candidate) > sessionModifiedTime(existing)) {
- byId.set(candidate.id, candidate)
+ const merged = preserveStaleModifiedAt(current, candidate)
+ const existing = byId.get(merged.id)
+ if (!existing || sessionModifiedTime(merged) > sessionModifiedTime(existing)) {
+ byId.set(merged.id, merged)
}
}
@@ -269,6 +270,21 @@ function preserveLocalTitle(
return incoming
}
+function preserveStaleModifiedAt(
+ current: SessionListItem | undefined,
+ incoming: SessionListItem,
+): SessionListItem {
+ if (!current) return incoming
+ // Preserve modifiedAt when the effective title hasn't changed — indicates no meaningful
+ // content change. messageCount is NOT used here because listSessions always returns 0
+ // (a placeholder for performance), while fetchSessionSummary returns the real count,
+ // so comparing them would always fail and defeat the preservation logic.
+ if (current.title === incoming.title) {
+ return { ...incoming, modifiedAt: current.modifiedAt }
+ }
+ return incoming
+}
+
function syncOpenSessionTabTitles(sessions: SessionListItem[]): void {
const titleById = new Map(sessions.map((session) => [session.id, session.title]))
const { tabs, updateTabTitle } = useTabStore.getState()
From 8cf0b10f5609922811198287063a24fb99370c59 Mon Sep 17 00:00:00 2001
From: zhb <50901800+zhbdesign@users.noreply.github.com>
Date: Sun, 28 Jun 2026 01:55:58 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=8F=98?=
=?UTF-8?q?=E5=8C=96=EF=BC=8C=E6=B6=88=E6=81=AF=E6=97=B6=E9=97=B4=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=9C=88=E6=97=A5=E6=97=B6=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复查看更新更新时间变化,消息时间显示月日时分
---
desktop/src/lib/formatMessageTimestamp.ts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/desktop/src/lib/formatMessageTimestamp.ts b/desktop/src/lib/formatMessageTimestamp.ts
index 65d71877..2ff72d77 100644
--- a/desktop/src/lib/formatMessageTimestamp.ts
+++ b/desktop/src/lib/formatMessageTimestamp.ts
@@ -46,6 +46,18 @@ export function formatExactMessageTimestamp(value: number | string | Date, local
}).format(date)
}
+export function formatMessageHoverTime(
+ value: number | string | Date,
+ locale: Locale,
+ now = Date.now(),
+): string {
+ const date = coerceDate(value)
+ if (!date) return ''
+ return isSameLocalYear(date, new Date(now))
+ ? formatMonthDayTime(date, locale)
+ : formatYearMonthDayTime(date, locale)
+}
+
function coerceDate(value: number | string | Date): Date | null {
const date = value instanceof Date ? value : new Date(value)
return Number.isFinite(date.getTime()) ? date : null
From bd80c13421e1c69bcbd7bcaa75c69f1af4d22a71 Mon Sep 17 00:00:00 2001
From: zhb <50901800+zhbdesign@users.noreply.github.com>
Date: Sun, 28 Jun 2026 02:01:51 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=8F=98?=
=?UTF-8?q?=E5=8C=96=EF=BC=8C=E6=B6=88=E6=81=AF=E6=97=B6=E9=97=B4=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=9C=88=E6=97=A5=E6=97=B6=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复查看更新更新时间变化,消息时间显示月日时分
---
desktop/src/components/chat/MessageActionBar.tsx | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/desktop/src/components/chat/MessageActionBar.tsx b/desktop/src/components/chat/MessageActionBar.tsx
index 4d39c377..7a8b0b1e 100644
--- a/desktop/src/components/chat/MessageActionBar.tsx
+++ b/desktop/src/components/chat/MessageActionBar.tsx
@@ -1,7 +1,6 @@
import { Check, Copy, GitFork } from 'lucide-react'
-import { useTranslation } from '../../i18n'
import { useSettingsStore } from '../../stores/settingsStore'
-import { formatExactMessageTimestamp, formatMessageTimestamp } from '../../lib/formatMessageTimestamp'
+import { formatExactMessageTimestamp, formatMessageHoverTime } from '../../lib/formatMessageTimestamp'
import { CopyButton } from '../shared/CopyButton'
export type MessageBranchAction = {
@@ -25,11 +24,10 @@ export function MessageActionBar({
align = 'start',
timestamp,
}: Props) {
- const t = useTranslation()
const locale = useSettingsStore((state) => state.locale)
const hasCopy = Boolean(copyText?.trim())
- const timeLabel = typeof timestamp === 'number'
- ? formatMessageTimestamp(timestamp, t, locale)
+ const hoverTimeLabel = typeof timestamp === 'number'
+ ? formatMessageHoverTime(timestamp, locale)
: ''
const exactTimeLabel = typeof timestamp === 'number'
? formatExactMessageTimestamp(timestamp, locale)
@@ -69,12 +67,12 @@ export function MessageActionBar({
) : null}
- {timeLabel ? (
+ {hoverTimeLabel ? (
- {timeLabel}
+ {hoverTimeLabel}
) : null}
From 4e48584da64fbb8a2653f32499bac28f0edfd098 Mon Sep 17 00:00:00 2001
From: zhb <50901800+zhbdesign@users.noreply.github.com>
Date: Sun, 28 Jun 2026 09:11:02 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=8F=98?=
=?UTF-8?q?=E5=8C=96=EF=BC=8C=E6=B6=88=E6=81=AF=E6=97=B6=E9=97=B4=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=9C=88=E6=97=A5=E6=97=B6=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复查看更新更新时间变化,消息时间显示月日时分
---
desktop/src/stores/sessionStore.ts | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/desktop/src/stores/sessionStore.ts b/desktop/src/stores/sessionStore.ts
index 439ec0d0..ceeaaf82 100644
--- a/desktop/src/stores/sessionStore.ts
+++ b/desktop/src/stores/sessionStore.ts
@@ -244,10 +244,9 @@ function mergeSessionList(
for (const item of incoming) {
const current = currentById.get(item.id)
const candidate = preserveLocalTitle(current, item)
- const merged = preserveStaleModifiedAt(current, candidate)
- const existing = byId.get(merged.id)
- if (!existing || sessionModifiedTime(merged) > sessionModifiedTime(existing)) {
- byId.set(merged.id, merged)
+ const existing = byId.get(candidate.id)
+ if (!existing || sessionModifiedTime(candidate) > sessionModifiedTime(existing)) {
+ byId.set(candidate.id, candidate)
}
}
@@ -270,21 +269,6 @@ function preserveLocalTitle(
return incoming
}
-function preserveStaleModifiedAt(
- current: SessionListItem | undefined,
- incoming: SessionListItem,
-): SessionListItem {
- if (!current) return incoming
- // Preserve modifiedAt when the effective title hasn't changed — indicates no meaningful
- // content change. messageCount is NOT used here because listSessions always returns 0
- // (a placeholder for performance), while fetchSessionSummary returns the real count,
- // so comparing them would always fail and defeat the preservation logic.
- if (current.title === incoming.title) {
- return { ...incoming, modifiedAt: current.modifiedAt }
- }
- return incoming
-}
-
function syncOpenSessionTabTitles(sessions: SessionListItem[]): void {
const titleById = new Map(sessions.map((session) => [session.id, session.title]))
const { tabs, updateTabTitle } = useTabStore.getState()