Skip to content

feat(pane_group): key diff_state_models by LocalOrRemotePath + remote dispatch (5c slice) - #67

Merged
jwp2987 merged 1 commit into
mainfrom
parity-diffstate-5c-wiring
Aug 5, 2026
Merged

feat(pane_group): key diff_state_models by LocalOrRemotePath + remote dispatch (5c slice)#67
jwp2987 merged 1 commit into
mainfrom
parity-diffstate-5c-wiring

Conversation

@jwp2987

@jwp2987 jwp2987 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

First slice of the diff-state pane wiring (5c). Migrates the global diff_state_models map from PathBuf to LocalOrRemotePath and makes get_or_create_diff_state_model local/remote-aware, matching Warp:

  • Local key → local-backed DiffStateModel::new.
  • Remote key → bridge the warp_util RemotePath to the buffer_location family (util_remote_path_to_buffer), require a connected session for the host (RemoteServerManager::client_for_host, else None so the panel reads unavailable), then DiffStateModel::new_remote.

drop_unused_diff_state_models still takes local PathBuf roots and drops the matching Local keys; the 5 call sites wrap their local repo path in LocalOrRemotePath::Local.

Behavior-preserving — only Local keys are produced today, so this is functionally identical; it makes new_remote reachable through working_directories for when remote repo-root detection lands.

Remaining for 5c (documented, task zerx-lab#136)

The per-pane-group root maps (repository_roots / directory_to_terminal / pane_groups / focused_repo / code_review_views) + the WorkingDirectoriesEvent payloads are still PathBuf; and the real blocker — the fork has no remote repo-root detection at the pane layer (the detection pipeline resolves only local roots via DetectedRepositories), so producing Remote keys needs a new remote-detection path. That carries a design decision and is left for the maintainer.

Verification

  • warp lib compiles (gui,tui,local_fs,test-util)
  • working_directories 2/0, code_review 76/0

🤖 Generated with Claude Code

… dispatch

First slice of the diff-state pane wiring (5c). Migrates the global
`diff_state_models` map from `PathBuf` to `LocalOrRemotePath` and makes
`get_or_create_diff_state_model` local/remote-aware, matching Warp:

- Local key → local-backed `DiffStateModel::new`.
- Remote key → bridge the warp_util `RemotePath` to the buffer_location family
  (`util_remote_path_to_buffer`), require a connected session for the host
  (`RemoteServerManager::client_for_host`, else return None so the panel reads
  as unavailable), then `DiffStateModel::new_remote`.

`drop_unused_diff_state_models` still takes local `PathBuf` roots (the
per-pane-group root maps are local-only for now) and drops the matching `Local`
keys. The 5 call sites wrap their local repo path in `LocalOrRemotePath::Local`.

Behavior-preserving: only `Local` keys are produced today, so this is
functionally identical; it makes `new_remote` reachable through
working_directories for when remote repo-root detection lands.

Remaining for 5c: the per-pane-group root maps (repository_roots /
directory_to_terminal / pane_groups / focused_repo / code_review_views) + the
WorkingDirectoriesEvent payloads are still PathBuf; and — the real blocker —
the fork has NO remote repo-root detection at the pane layer (the detection
pipeline resolves only local roots via DetectedRepositories), so producing
`Remote` keys needs a new remote-detection path. That carries a design
decision and is left for the maintainer (task zerx-lab#136).

Verified: warp lib compiles (gui,tui,local_fs,test-util); working_directories
2/0, code_review 76/0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012gDYSHa4oDvQbfungWwG1h
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.

1 participant