ElyTree: any new pick leaves a file history or blame (G-01)

The branch list's click goes through Tree::pick_ref, which clears the
look like every other pick; the test covers file, commit, side,
branch and remote picks. The test window installs the app's menus
first, as tool_root does: Windows and Linux draw the menu bar in the
window and panicked on an empty one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-10 15:21:13 -04:00
1 parent d9056c3564
commit 818491ad9f
5 files changed
+31 -10

No files matched your search

+12 -8
View File
@@ -71,14 +71,7 @@ pub fn branches(tree: &Entity<Tree>, cx: &mut Context<Changes>) -> AnyElement {
let this = tree.downgrade();
move |name: &gpui::SharedString, _: &mut gpui::Window, cx: &mut gpui::App| {
let name = name.to_string();
this.update(cx, |tree, cx| {
tree.look = None;
if let Some(opened) = tree.active.and_then(|id| tree.opened_mut(id)) {
opened.picked_ref = Some((kind, name));
}
cx.notify();
})
.ok();
this.update(cx, |tree, cx| tree.pick_ref(kind, name, cx)).ok();
}
};
let switch = |kind: Kind| {
@@ -175,3 +168,14 @@ pub fn branches(tree: &Entity<Tree>, cx: &mut Context<Changes>) -> AnyElement {
)
.into_any_element()
}
impl crate::tree::Tree {
/// A branch or tag picked: it shows, nothing else.
pub fn pick_ref(&mut self, kind: Kind, name: String, cx: &mut gpui::Context<Self>) {
self.look = None;
if let Some(opened) = self.active.and_then(|id| self.opened_mut(id)) {
opened.picked_ref = Some((kind, name));
}
cx.notify();
}
}