Enable cmd-O and @ context on remote SSH session#11295
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR extends file search, opened-file tracking, and @ context gating to use LocalOrRemotePath so remote SSH sessions can surface repo-backed file/code actions.
Concerns
- The non-local_fs FileSearchModel stub introduces a compile break because LocalOrRemotePath is only imported under feature = "local_fs".
- This is a user-facing behavior change, but the PR description does not include screenshots or a screen recording demonstrating Cmd-O and @ context menu behavior in a remote SSH session end to end.
- No approved spec context was available; I did not find security findings in the changed code.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
5e35125 to
38b18bf
Compare
moirahuang
left a comment
There was a problem hiding this comment.
- called this out over slack but we should fix the at context menu outside of repos, this can be in a follow-up PR
Screen.Recording.2026-05-19.at.4.16.16.PM.mov
-
also in the above video, i'm seeing some flicker from "Loading" to "No results" which might be unavoidable but maybe we can debounce or skip "Loading" if we quickly are able to know we have no results
-
not related to this PR but we're missing path on hover of the tooltip when we open a remote code file
| let relative_path = | ||
| file_local.strip_prefix(&canonical_repo_path).ok()?; | ||
| Some(FileSearchResult { | ||
| path: relative_path.to_string_lossy().to_string(), |
There was a problem hiding this comment.
should we store the host id as well?
There was a problem hiding this comment.
Erm why do we need the host ID here?
| // Force the workspace to re-evaluate | ||
| // ActiveSession::working_directory. The | ||
| // AppStateChanged at line 11671 already ran | ||
| // update_active_session once, but for remote |
There was a problem hiding this comment.
should we make this the definitive place for us to evaluate ActiveSession::working_directory?
There was a problem hiding this comment.
There are multiple sources for ActiveSession's working directory to change. I think semantically what we want to communicate here is remote repo path updating is a valid state change which should cause us to re-evaluate active session data
3b848a8 to
49608eb
Compare
|
I addressed (1) I will look into (2)(3) as a followup |

Summary
Enable Cmd-O file search palette and @ context menu file/code categories in remote SSH sessions.
Both features were broken in SSH because the client-side gating assumed local-only paths. The underlying repo metadata layer already supported remote repos — this PR threads
LocalOrRemotePaththrough the remaining client-side consumers.Changes
Core: Workspace
ActiveSessionstoresLocalOrRemotePathWindowActiveSession.path_if_local: Option<PathBuf>→working_directory: Option<LocalOrRemotePath>working_directory()accessor returnsOption<&LocalOrRemotePath>(local or remote)path_if_local()remains as a derived convenience for callers that only need local pathsupdate_active_sessionnow callsterminal.pwd_as_local_or_remote()to populate itFileSearchModel— remote repo contents + cacherepo_root_location()method usesActiveSession::working_directory()→DetectedRepositories::get_root_for_path()(handles both local/remote)get_contents_from_repo()refactored to accept&LocalOrRemotePathand handle both local and remote reposHashMap<PathBuf, ...>toHashMap<LocalOrRemotePath, ...>RepositoryIdentifier::Remotevia newto_local_or_remote_path()helperRepositoryIdentifier— new conversion helperto_local_or_remote_path()method for cleanRepositoryIdentifier→LocalOrRemotePathconversionOpenedFilesModel— remote path supportHashMap<PathBuf, ...>→HashMap<LocalOrRemotePath, ...>HashMap<PathBuf, Instant>→HashMap<String, Instant>(repo-relative paths as strings)file_opened()usesstrip_repo_prefix()to compute relative paths (works for both local/remote)code_pane.rsFileOpenedhandler now tracks files for all repo types, not just localUI gating updates
data_sources.rs): usesrepo_root_location()to detect remote reposview.rs):is_active_dir_in_git_repousesActiveSession::working_directory()directlysnapshot_last_openedusesworking_directory()→get_root_for_path()Plan
Enable File Search Palette (Cmd-O) and @ Context Menu in Remote SSH
Conversation
https://staging.warp.dev/conversation/700915cd-6778-4a7e-9686-3a25eeb476ce