Skip to content

#700 Mark worktree sessions on Home - #704

Merged
ivanfenenko merged 4 commits into
mainfrom
feature/700-mark-worktree-sessions
Oct 17, 2026
Merged

ivanfenenko merged 4 commits into
mainfrom
feature/700-mark-worktree-sessions

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Home badges the project letter when the session directory is a listed worktree other than the added path. The subtitle stays the added project. A subpath is not badged, and nothing is badged until that project's inventory has loaded.
  • Session Chat drops the project letter and shows the worktree icon plus the checkout name (the last path segment) when that same predicate matches.
  • V2 loads GET /api/worktree?projectID=, then POST /api/worktree/refresh, and refetches the list on worktree.updated. V1 probes GET /experimental/workspace; a 404 stops that probe until the next connect, and V2 does not call it.

Checks

Issue

Risks / Follow-ups

  • V1 workspace bodies are parsed tolerantly (string array, or { data: [{ directory }] }). A live V1 server was not probed.
  • Android Paparazzi evidence was not generated. The published shots are iOS light and dark.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need.


Note

Medium Risk
Touches Home session merging, live SSE refetch, and V1/V2 server protocol branching; incorrect inventory or merge logic could show wrong badges or duplicate/missing sessions.

Overview
Adds worktree inventory on Android and iOS so Home and Session Chat can tell when a session runs in a listed checkout rather than the added project path.

Data & sync: New WorktreesApi / WorktreesAPIClient and DefaultWorktreeRepository load directories via V2 (GET /api/worktree, POST /api/worktree/refresh) or V1 (GET /experimental/workspace with tolerant JSON parsing). V1 404 stops probing until reconnect. Home view models load inventories per added project, optionally merge sessions from other workspace directories (V1), and refetch on worktree.updated SSE events (namedProjectId on events).

UI: WorktreeMark drives a CallSplit badge on the project letter when the session directory is a loaded checkout (not the added path). Session Chat swaps the project letter for the worktree icon and checkout name (last path segment). Component galleries document the new states.

DI / tests: Hilt and AppContainer wire worktree + project repos; view models default to no-op repos/streams for tests. Unit tests cover API, repository protocol behavior, parsing, and badge rules.

Reviewed by Cursor Bugbot for commit c674579. Bugbot is set up for automated code reviews on this repo. Configure here.

Badge a Home letter when the session directory is a listed worktree other than the added path, and name that checkout in Session Chat.
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

@cursor review

@ivanfenenko
ivanfenenko marked this pull request as ready for review October 16, 2026 20:54

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c674579. Configure here.

Refetch after refresh so a dropped worktree.updated cannot leave the pre-refresh list, and cancel a stale Session Chat refine before it publishes.
A worktree.updated during load can no longer apply the pre-refresh list after loadRefreshed. A cancelled Session Chat refine also stops before it publishes or rewrites checkout ids.
Keep worktree wiring and the main session-events import.
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.

Mark worktree sessions on Home

1 participant