mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-10 06:28:18 +00:00
refactor(sidebar): rely on canonical session lastActivity timestamps
Sidebar session sorting and time labels currently normalize timestamps through getUpdatedTimestamp. That helper still checked session.updated_at as a fallback, but in the current project/session API shape the sidebar no longer receives raw DB session rows. Why this cleanup matters: - Sidebar session items are built from project payload SessionSummary objects, where lastActivity is already the canonical field. - The backend guarantees lastActivity is populated from updated_at ?? created_at ?? now before data reaches the client. - Keeping a client-side updated_at fallback implies mixed payload contracts and hides schema drift instead of surfacing it. - Removing the fallback narrows the UI contract to one timestamp source, which reduces ambiguity in session ordering and display-time logic. This change intentionally keeps behavior the same while making the dependency explicit: sidebar timestamp logic now reads only session.lastActivity.
This commit is contained in:
@@ -58,7 +58,7 @@ const getCreatedTimestamp = (session: SessionWithProvider): string => {
|
||||
};
|
||||
|
||||
const getUpdatedTimestamp = (session: SessionWithProvider): string => {
|
||||
return String(session.lastActivity || session.updated_at || '');
|
||||
return String(session.lastActivity || '');
|
||||
};
|
||||
|
||||
export const getSessionDate = (session: SessionWithProvider): Date => {
|
||||
|
||||
Reference in New Issue
Block a user