fix(activity): roll subagent activity up to its root and accept only selectable windows

- List child sessions in the activity query and credit each child's latest update
  to its root, so Recent includes roots whose subagents were active inside the
  window; children never become rows, and only roots of in-window children are
  fetched
- Show and sort activity rows by that rolled-up time
- Restrict activityWindowMinutes to the selectable options on write, and coerce a
  stored unknown value to the default on read so it cannot reset every preference
This commit is contained in:
Chris Scott committed 2026-10-16 11:57:52 -04:00
1 parent 8b6251d83b
commit 84cdffa261
22 files changed
+343 -48

No files matched your search

@@ -131,11 +131,13 @@ function activeWorkItem(
state: ActiveWorkState = 'recent',
): ActiveWorkItem {
const itemRepo = mocks.repos.find((candidate) => candidate.fullPath === directory) ?? mocks.repos[0]
const itemSession = session(id, title, directory)
return {
key: `${directory}:${id}`,
session: session(id, title, directory),
session: itemSession,
repo: itemRepo,
state,
updatedAt: itemSession.time.updated,
path: `/repos/${itemRepo.id}/sessions/${id}`,
}
}
@@ -72,6 +72,7 @@ interface SessionPickerRow {
key: string
session: Session
repo: Repo
updatedAt?: number
}
interface SessionPickerSection {
@@ -262,7 +263,7 @@ const SessionPickerRowItem = memo(function SessionPickerRowItem({
>
{showRepo && <span className="max-w-32 truncate">{getRepoDisplayName(row.repo)}</span>}
{!showRepo && label && <span className="max-w-32 truncate">{label}</span>}
<span>{formatShortRelativeTime(new Date(row.session.time.updated))}</span>
<span>{formatShortRelativeTime(new Date(row.updatedAt ?? row.session.time.updated))}</span>
</span>
</div>
<div className="flex shrink-0 items-center pr-1">
@@ -811,7 +812,7 @@ function ActivePickerContent({
const rows: SessionPickerRow[] = []
for (const item of groups[definition.key]) {
if (needle && !(item.session.title ?? '').toLowerCase().includes(needle)) continue
rows.push({ key: item.key, session: item.session, repo: item.repo })
rows.push({ key: item.key, session: item.session, repo: item.repo, updatedAt: item.updatedAt })
}
return rows.length > 0 ? [{ id: definition.key, heading: definition.heading, rows }] : []
})