feat(pane_group): key diff_state_models by LocalOrRemotePath + remote dispatch (5c slice) - #67
Merged
Merged
Conversation
… 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
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.
First slice of the diff-state pane wiring (5c). Migrates the global
diff_state_modelsmap fromPathBuftoLocalOrRemotePathand makesget_or_create_diff_state_modellocal/remote-aware, matching Warp:DiffStateModel::new.warp_utilRemotePathto thebuffer_locationfamily (util_remote_path_to_buffer), require a connected session for the host (RemoteServerManager::client_for_host, elseNoneso the panel reads unavailable), thenDiffStateModel::new_remote.drop_unused_diff_state_modelsstill takes localPathBufroots and drops the matchingLocalkeys; the 5 call sites wrap their local repo path inLocalOrRemotePath::Local.Behavior-preserving — only
Localkeys are produced today, so this is functionally identical; it makesnew_remotereachable throughworking_directoriesfor 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) + theWorkingDirectoriesEventpayloads are stillPathBuf; and the real blocker — the fork has no remote repo-root detection at the pane layer (the detection pipeline resolves only local roots viaDetectedRepositories), so producingRemotekeys needs a new remote-detection path. That carries a design decision and is left for the maintainer.Verification
warplib compiles (gui,tui,local_fs,test-util)working_directories2/0,code_review76/0🤖 Generated with Claude Code