Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/src/workspace/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ pub enum WorkspaceAction {
ActivateLastTab,
CyclePrevSession,
CycleNextSession,
CtrlTabPaletteCommit,
MoveActiveTabLeft,
MoveActiveTabRight,
MoveTabLeft(usize),
Expand Down Expand Up @@ -964,6 +965,7 @@ impl WorkspaceAction {
| FixSettingsWithOz { .. }
| OpenLocalToCloudHandoffPane { .. }
| ShowHandoffEnvironmentCreationModal
| CtrlTabPaletteCommit => false,
| ShowCloudModeV2EnvironmentCreationModal
| OpenCreateAuthSecretModal { .. }
| OpenNetworkLogPane => false,
Expand Down
29 changes: 28 additions & 1 deletion app/src/workspace/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12677,7 +12677,11 @@ impl Workspace {
PaletteMode::Conversations => self.open_conversations_palette(ctx),
}

ctx.focus(&self.palette);
if matches!(source, PaletteSource::CtrlTab { .. }) {
ctx.focus(&self.ctrl_tab_palette);
} else {
ctx.focus(&self.palette);
}

send_telemetry_from_ctx!(TelemetryEvent::PaletteSearchOpened { mode, source }, ctx);

Expand Down Expand Up @@ -20914,6 +20918,15 @@ impl TypedActionView for Workspace {
ActivateLastTab => self.activate_last_tab(ctx),
CyclePrevSession => self.cycle_prev_session(ctx),
CycleNextSession => self.cycle_next_session(ctx),
CtrlTabPaletteCommit => {
if self.current_workspace_state.is_ctrl_tab_palette_open {
self.ctrl_tab_palette.update(ctx, |_, palette_ctx| {
palette_ctx.dispatch_typed_action_deferred(
crate::search::command_palette::view::Action::CtrlPressed(false),
);
});
}
}
MoveActiveTabLeft => self.move_tab(self.active_tab_index, TabMovement::Left, ctx),
MoveActiveTabRight => self.move_tab(self.active_tab_index, TabMovement::Right, ctx),
MoveTabLeft(index) => self.move_tab(*index, TabMovement::Left, ctx),
Expand Down Expand Up @@ -24293,6 +24306,20 @@ impl View for Workspace {
#[cfg_attr(not(any(windows, target_os = "linux")), allow(unused_mut))]
let mut event_handler = EventHandler::new(stack);

event_handler =
event_handler.on_modifier_state_changed(|ctx, _app, key_code, state| {
if matches!(state, warpui::event::KeyState::Released)
&& matches!(
key_code,
warpui::platform::keyboard::KeyCode::ControlLeft
| warpui::platform::keyboard::KeyCode::ControlRight
)
{
ctx.dispatch_typed_action(WorkspaceAction::CtrlTabPaletteCommit);
}
DispatchEventResult::PropagateToParent
});

#[cfg(any(windows, target_os = "linux"))]
{
event_handler =
Expand Down