GeezerVison is showing github.com — feat(app): group Home sessions by project by liambreen · Pull Request #57895 · anomalyco/opencode
Conversation
liambreen
commented
Oct 21, 2026
•
edited by opencode-agent
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #55446
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
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.sessions storage 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 typecheck in packages/app and bun run check at the repo root, both green.
- Unit: new
grouping.test.ts cases (first-occurrence group order, within-group recency, sandbox sessions under their parent project, per-directory identity); existing records.test.ts cases still green.
- E2E: new keeper case in
home.spec.ts covers the toggle, group order, suffix suppression, collapse, cycle-skip and reload persistence, and the compact header height. Full home.spec.ts suite is 12/12 locally.
Screenshots / recordings
Home sessions grouped by project (toggle lives at the right of the search row):

Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Added by the opencode bot (AI-generated).
Related: #51759, #54115
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
This was referenced Oct 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Related: #51759, #54115


Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
</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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
const queryClient = useQueryClient()
|
|
|
|
|
|
const [storedView, setStoredView] = persisted(
|
|
|
Persist.global("home.sessions"),
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Sorry - this was not supposed to have been submitted.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 31, 2026
This was referenced Nov 6, 2026
Reviewers
Hona
Awaiting requested review from Hona
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|