Skip to content

Commit 33e2840

Browse files
stevenpollackclaude
andcommitted
feat(worktrees): make the worktrees popup available from any tab
Move the Shift+W trigger from the Status tab into the global key handler in App::event (alongside Options), so the popup opens from any tab, and register it in App::commands for the global help/command bar. The dedicated ViewWorktrees internal event is dropped: the global handler opens the popup directly, mirroring how Options works. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BMQxBdr5f3B3jmDtdvGtTu
1 parent 51f7f34 commit 33e2840

3 files changed

Lines changed: 14 additions & 17 deletions

File tree

src/app.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ impl App {
362362
) {
363363
self.options_popup.show()?;
364364
NeedsUpdate::ALL
365+
} else if key_match(
366+
k,
367+
self.key_config.keys.view_worktrees,
368+
) {
369+
self.worktree_popup.open()?;
370+
NeedsUpdate::ALL
365371
} else {
366372
NeedsUpdate::empty()
367373
};
@@ -801,9 +807,6 @@ impl App {
801807
InternalEvent::ViewSubmodules => {
802808
self.submodule_popup.open()?;
803809
}
804-
InternalEvent::ViewWorktrees => {
805-
self.worktree_popup.open()?;
806-
}
807810
InternalEvent::Tags => {
808811
self.tags_popup.open()?;
809812
}
@@ -1150,6 +1153,14 @@ impl App {
11501153
)
11511154
.order(order::NAV),
11521155
);
1156+
res.push(
1157+
CommandInfo::new(
1158+
strings::commands::view_worktrees(&self.key_config),
1159+
true,
1160+
!self.any_popup_visible(),
1161+
)
1162+
.order(order::NAV),
1163+
);
11531164

11541165
res.push(
11551166
CommandInfo::new(

src/queue.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ pub enum InternalEvent {
147147
///
148148
ViewSubmodules,
149149
///
150-
ViewWorktrees,
151-
///
152150
ViewRemotes,
153151
///
154152
CreateRemote,

src/tabs/status.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -804,12 +804,6 @@ impl Component for Status {
804804
true,
805805
true,
806806
));
807-
808-
out.push(CommandInfo::new(
809-
strings::commands::view_worktrees(&self.key_config),
810-
true,
811-
true,
812-
));
813807
}
814808

815809
self.commands_nav(out, force_all);
@@ -953,12 +947,6 @@ impl Component for Status {
953947
) {
954948
self.queue.push(InternalEvent::ViewSubmodules);
955949
Ok(EventState::Consumed)
956-
} else if key_match(
957-
k,
958-
self.key_config.keys.view_worktrees,
959-
) {
960-
self.queue.push(InternalEvent::ViewWorktrees);
961-
Ok(EventState::Consumed)
962950
} else {
963951
Ok(EventState::NotConsumed)
964952
};

0 commit comments

Comments
 (0)