Repository navigation
Conversation
An opt-in toggle in the Home search row switches the sessions list between date groups and per-project groups: collapsible compact headers, groups ordered by most recent session, worktree and sandbox sessions resolved to their parent project, and grouped rows indented under their header's chevron column without the per-row project suffix. The mode and collapsed groups persist per user.
There was a problem hiding this comment.
The project grouping works as described. I ran the full home.spec.ts e2e suite in headless Chromium (12/12, including the new case), the src/home/sessions unit tests (27/27) and bun run typecheck in packages/app (clean). The screenshots below are both from this branch: the default date view, then the grouped view.
Public API: unchanged. The only addition is an app-local persisted key, home.sessions.
One thing to fix before merge: the spacing change on the group body also applies to the default date view, so it changes the existing Home layout for everyone, not just the opt-in mode (inline). A smaller point: collapsed state is stored globally and keyed by folder path (inline). Also, the description mentions a test for skipping collapsed groups and a per-directory identity unit test, but neither is in the diff. Please update the description or add them.
| </Show> | ||
| <div | ||
| class={`flex min-w-0 flex-col gap-px pt-2 md:pt-4 ${index === props.groups.length - 1 ? "" : "mb-6"}`} | ||
| class={`flex min-w-0 flex-col gap-px pt-1 ${index === props.groups.length - 1 ? "" : "mb-2"}`} |
There was a problem hiding this comment.
This wrapper is shared by both modes, so going from pt-2 md:pt-4 / mb-6 to pt-1 / mb-2 also tightens the existing Today/Yesterday/Older layout, which stays the default. Could the compact spacing apply only when props.groupedByProject is true, so the date view keeps its current spacing?
| const queryClient = useQueryClient() | ||
|
|
||
| const [storedView, setStoredView] = persisted( | ||
| Persist.global("home.sessions"), |
There was a problem hiding this comment.
collapsed is keyed by pathKey(worktree), but it's stored under Persist.global. So the same path on two servers (e.g. /home/me/app locally and on a remote) shares one collapsed state, and entries are never pruned. If Home can show other servers, Persist.serverGlobal(...) (used elsewhere for per-server state) might fit better, at least for collapsed.
|
Sorry - this was not supposed to have been submitted. |


Issue for this PR
Closes #55446
Type of change
What does this PR do?
Adds an opt-in toggle in the Home search row that switches the sessions list between the existing date groups and per-project groups. Default stays date grouping.
Grouped view: one collapsible header per project (chevron + avatar + name), groups ordered by most recent session, sessions resolved through the project inventory so worktree and sandbox sessions join their parent project instead of splitting it. Grouped rows indent under the header's chevron column and drop the per-row project suffix (the header already names the project); search results keep the suffix since that list spans projects. The grouping mode and collapsed groups persist per user under a
home.sessionsstorage key.The partition logic lives in a new leaf module,
home/sessions/grouping.ts, so it is unit-testable without the component graph.How did you verify your code works?
bun typecheckinpackages/appandbun run checkat the repo root, both green.grouping.test.tscases (first-occurrence group order, within-group recency, sandbox sessions under their parent project, per-directory identity); existingrecords.test.tscases still green.home.spec.tscovers the toggle, group order, suffix suppression, collapse, cycle-skip and reload persistence, and the compact header height. Fullhome.spec.tssuite is 12/12 locally.Screenshots / recordings
Home sessions grouped by project (toggle lives at the right of the search row):
Checklist
Added by the opencode bot (AI-generated).
Related: #51759, #54115