Detect and surface missing session workspaces#253
Merged
Conversation
Sessions whose working directory no longer exists on disk (for example after a git worktree is removed) are now surfaced across the TUI: - Add a 'Missing workspace' row to the session status filter picker so users can isolate sessions with a removed working directory. - Show a 'Workspace: Missing' badge in the preview panel for the selected session. - Guard launches: single launch reports an error and batch launch skips missing sessions with a count, so opening a terminal never starts in a path that no longer exists. The filter, count, preview badge, and launch guard all read the existing async git-state scan (GitStateMissing), so the state refreshes on reload and stays consistent with the session list badge. Closes #184 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Surface sessions whose working directory no longer exists on disk, and stop launches from starting a terminal in a path that is gone.
This happens often with git worktrees: you remove a worktree, but the session that pointed at it stays in the list. Selecting it and pressing Enter used to try to start a shell in a directory that no longer exists.
Closes #184.
Changes
Workspace: Missingline for the selected session when its folder no longer exists.Cannot launch: workspace folder no longer exists.Skipped N session(s): workspace folder no longer exists, so the rest still open.All four surfaces read the existing async git-state scan (
GitStateMissing), which already powers the session-list badge. That keeps everything consistent and means the state refreshes on reload. Sessions with an empty working directory are treated as present, so folder-only launches are unaffected.Tests
HasSelection, count, and view rendering for the new row.sessionWorkspaceMissing,missingWorkspaceSessionCount,filterMissingWorkspaceSessions/Groups, and the launch guards (single blocked, present allowed, empty cwd allowed, batch skip count, all-missing returns nil).Workspace: Missingbadge shows only when the flag is set.Verification
go build ./...go test ./... -count=1go vet ./...golangci-lint run(v2.12.2)All pass.