Skip to content

fix(app): show sessions from unadded projects - #43727

Open
Hona wants to merge 1 commit into
anomalyco:v2from
Hona:home-all-sessions
Open

fix(app): show sessions from unadded projects#43727
Hona wants to merge 1 commit into
anomalyco:v2from
Hona:home-all-sessions

Conversation

@Hona

@Hona Hona commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

  • show root sessions from every server project on Home, even when the project was never added locally
  • keep selected-project scoping and preserve project metadata with the session's exact directory
  • cover unadded-project visibility and selected-project filtering

Testing

  • bun typecheck (packages/app)
  • bun run test:unit (packages/app): 553 passed
  • bun run test:browser (packages/app): 44 passed
  • pre-push workspace typecheck: 33 packages passed

Performance

Production Home benchmark, one serial run before and after:

  • open session stable paint: 291.6 ms before, 320.7 ms after
  • restore Home stable paint: 59.2 ms before, 45.8 ms after
  • the existing review-pane scenario failed because the review element did not appear, both before and after this change

Copilot AI lite review requested due to automatic review settings August 20, 2026 22:05
@Hona
Hona requested a review from Brendonovich as a code owner August 20, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Enough1122

Copy link
Copy Markdown

AI code review — automated review; please use your judgment.

  • packages/app/src/pages/home/home-sessions-model.ts:26 — For sessions under unadded projects the fallback synthesizes a project whose worktree is the session's own directory, so two sessions living in different sandboxes of the same unadded repo render as two unrelated projects (fragmented avatars/grouping); consider checking server-side project metadata for a sandbox/worktree that encloses session.location.directory and preferring that as the synthetic project root.
  • packages/app/src/pages/home/home-sessions-model.ts:28 — Precedence puts the locally-added projectByID ahead of server projectMetadataByID; if a project was renamed or removed server-side while still present in local layout state, the home list shows the stale local identity — worth confirming this order is intentional and documenting it, since the fix's spirit is "trust the server view for unadded projects."
  • packages/app/src/pages/home/home-sessions-model.ts:31 — When neither map contains the projectID, displayName receives a bare {worktree, expanded} object with no id/name; both new tests exercise the named-metadata path only — add a case asserting the anonymous fallback renders a sane name (basename) and doesn't crash downstream consumers expecting project.id.
  • packages/app/src/pages/home/home-sessions-controller.test.ts:30 — Coverage is good for the two headline behaviors but misses multi-session-per-unadded-project grouping (several sessions sharing projectID across directories should collapse to one projectName) and dedup semantics when the same session id appears twice; cheap additions that protect the new code path's main invariants.

— AI code review (automated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants