sourcebot icon indicating copy to clipboard operation
sourcebot copied to clipboard

File search recents are shared across browse revisions

Open DivyamTalwar opened this issue 5 months ago • 1 comments

Problem

The browse file-search dialog stores recently opened files under a key scoped only by repository name. When a user switches branches or revisions, recents from another revision can still appear.

Reproduction

Open file search for a repo on one revision, select a file, then switch to another branch or revision in the same repo and open file search again.

Expected

Recently opened files should be scoped to the revision context that can resolve those paths.

Actual

The dialog can show repo-level recents from a different revision. Selecting one navigates with the current revision, which can point to a path that does not exist there.

Impact

Users browsing multiple branches can get stale file suggestions and confusing dead-end navigation.

DivyamTalwar avatar Jun 29 '26 09:06 DivyamTalwar

Picking this up. The recents are stored under recentlyOpenedFiles-${repoName} in fileSearchCommandDialog.tsx — scoped by repo only. revisionName is already available from useBrowseParams(), so scoping the key by revision (${repoName}@${revisionName ?? 'HEAD'}, matching how the rest of browse defaults the revision) keeps recents from leaking across branches. PR incoming.

rachit367 avatar Jul 02 '26 08:07 rachit367