agent: Include active file in recent history (#27914)

This happened because of two reasons:

- `Workspace::recent_navigation_history` didn't include the current file
- The context picker added the current file to a exclude list

The latter was actually intentional because we already show the file in
the suggested context, but now that we actually have mentions, it's just
inconvenient not to have it there.

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-04-03 10:29:41 -03:00 committed by GitHub
parent 9693eab098
commit fe27d11f08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 95 deletions

View file

@ -468,15 +468,9 @@ impl Matches {
path: found_path.clone(),
panel_match: None,
};
self.matches
.extend(currently_opened.into_iter().map(path_to_entry));
self.matches.extend(
history_items
.into_iter()
.filter(|found_path| Some(*found_path) != currently_opened)
.map(path_to_entry),
);
self.matches
.extend(history_items.into_iter().map(path_to_entry));
return;
};