Skip to content

Commit 9af0347

Browse files
authored
Merge pull request #11 from JasonLow8/fix/session-group-buckets
fix: prevent yesterday sessions from leaking into lower time buckets
2 parents d934855 + a616a2f commit 9af0347

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

web/src/hooks/useServerData.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ export function useServerData(config: ServerConfig) {
5555
)
5656

5757
const filteredSessions = useMemo(() => {
58-
const text = query.trim().toLowerCase()
58+
const isSubagent = (title: string) => /\(@\S+ subagent\)$/i.test(title)
5959
return sessions.filter((session) => {
60+
if (isSubagent(session.title)) return false
61+
const text = query.trim().toLowerCase()
6062
if (!text) return true
6163
return session.title.toLowerCase().includes(text) || session.directory.toLowerCase().includes(text)
6264
})

web/src/screens/SessionsScreen.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ export default function SessionsScreen({
147147
})
148148
const lastWeek = rest.filter((s) => {
149149
const t = normalizeTime(s.updated)
150-
return t >= startOfLastWeek && t < startOfWeek
150+
return t >= startOfLastWeek && t < Math.min(startOfWeek, startOfYesterday)
151151
})
152152
const thisMonth = rest.filter((s) => {
153153
const t = normalizeTime(s.updated)
154-
return t >= startOfMonth && t < startOfLastWeek
154+
return t >= startOfMonth && t < Math.min(startOfLastWeek, startOfYesterday)
155155
})
156-
const older = rest.filter((s) => normalizeTime(s.updated) < startOfMonth)
156+
const older = rest.filter((s) => normalizeTime(s.updated) < Math.min(startOfMonth, startOfYesterday))
157157

158158
if (today.length > 0) sections.push({ label: `Today · ${today.length}`, sessions: today })
159159
if (yesterday.length > 0) sections.push({ label: `Yesterday · ${yesterday.length}`, sessions: yesterday })

0 commit comments

Comments
 (0)