Skip to content

Show Git workspace state badges in the session list #170

Description

@jongio

I want Dispatch to show whether a session points at a dirty, clean, missing, or diverged Git workspace before I open it. That helps me pick the session with real local work instead of guessing from the conversation title.

flowchart TD
  A[Session list] --> B[Workspace state loader]
  B --> C[Git status]
  B --> D[Branch ahead behind]
  B --> E[Missing path]
  C --> F[Badge cache]
  D --> F
  E --> F
  F --> G[List row]
  G --> H[Status filter]
Loading

Problem

The session list already shows attention and work completion signals, but it does not show the state of the Git checkout behind each session. I can resume an old session only to find the directory is gone, the branch changed, or the repo has uncommitted work that should have been obvious.

Proposed solution

Add a lightweight Git workspace state loader under internal/data or internal/platform that runs bounded git commands against each session directory when it is inside a repo. Surface compact badges in internal/tui/components/sessionlist.go for clean, dirty, untracked, ahead, behind, and missing path states. Cache results during a refresh cycle, add a manual refresh path through the existing r behavior, and add tests with temporary fixture repos in the existing data or platform test packages.

User impact

I can see which sessions still have local work, avoid opening broken directories, and prioritize work that needs a commit or sync.

Acceptance criteria

  • Show a compact Git workspace badge on session rows when a Git checkout is available.
  • Detect clean, dirty, untracked, ahead, behind, and missing path states without blocking the TUI.
  • Recompute badges during normal refresh and manual refresh.
  • Add an optional status filter entry for sessions with local Git changes.
  • Add tests for state detection and row rendering.

Complexity

M

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions