Skip to content

fix(app): match home sessions to projects by id - #50440

Closed
Mattheinrichs wants to merge 1 commit into
anomalyco:devfrom
Mattheinrichs:home-session-project-match
Closed

Mattheinrichs wants to merge 1 commit into
anomalyco:devfrom
Mattheinrichs:home-session-project-match

Conversation

@Mattheinrichs

Copy link
Copy Markdown

Issue for this PR

Closes #46444

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The web/desktop Home list could show "Nothing here yet" while sessions existed on disk. buildHomeSessionRecords kept only sessions whose directory string matched a project worktree/sandbox. Sessions created outside a git repo belong to the global project, whose worktree is forced to / (and which records no sandboxes), so /home/... never matched / and those sessions were dropped — even though they had already been fetched.

This matches sessions to the scoped projects by projectID first, falling back to the existing directory match, and keeps the id map scoped to the selected project so selecting a project still filters the list.

How did you verify your code works?

Added home-session-records.test.ts covering the global-project case, the out-of-scope project case, and the directory fallback.

  • cd packages/app && bun test --conditions=solid --preload ./happydom.ts ./src/pages/home/home-session-records.test.ts → 3 pass, 0 fail
  • cd packages/app && bun typecheck → pass

Screenshots or recordings

Not included — verified by unit tests; the empty-list symptom is reproduced in #46444.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@Mattheinrichs

Copy link
Copy Markdown
Author

Closing this in favour of #46520 by @SeashoreShi — pre-existing, smaller diff (1 file, +8/−1), same fix for #46444. No need for two PRs competing for the same reactions.

@SeashoreShi the offer stands: I have a unit test for the global-project case (session kept when its directory doesn't match the global worktree /) at packages/app/src/pages/home/home-session-records.test.ts in my fork branch home-session-project-match if you want to fold it in — entirely optional, your call.

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.

Web Home hides global-project sessions (empty list for sessions created outside git repos)

1 participant