Skip to content

Fix Ctrl+Tab palette getting stuck on fast presses#11222

Open
simone-panico wants to merge 2 commits into
warpdotdev:masterfrom
simone-panico:fix-palette-getting-stuck
Open

Fix Ctrl+Tab palette getting stuck on fast presses#11222
simone-panico wants to merge 2 commits into
warpdotdev:masterfrom
simone-panico:fix-palette-getting-stuck

Conversation

@simone-panico
Copy link
Copy Markdown

Description

Problem

When pressing Ctrl+Tab quickly, the MRU palette would sometimes stay open instead of switching tabs. You'd have to press Ctrl again to dismiss it.
The palette commits its selection when it receives the Ctrl-release event via its own on_modifier_state_changed listener. That listener is part of the palette's render tree, so it only fires once the palette has been added to the rendered scene. On a fast press you can release Ctrl before the next frame renders the palette, so the release event passes through the workspace and is lost.
There was also a secondary bug in open_palette: when opened via Ctrl+Tab it focuses self.palette instead of self.ctrl_tab_palette, sending focus to a view that isn't even mounted.

Solution

Two small changes in app/src/workspace/view.rs:

  1. Focus the palette that was actually opened.
  2. Add a fallback on_modifier_state_changed on the workspace root. Thanks to child-first event dispatch, it only fires when the palette isn't in the scene yet, i.e. the bug case. It dispatches a new WorkspaceAction::CtrlTabPaletteCommit, whose handler uses dispatch_typed_action_deferred to queue Action::CtrlPressed(false) targeted at the palette. Deferring is necessary because the palette's commit path synchronously re-enters the workspace via root_view:activate_tab_by_pane_group_id, which would otherwise panic with "Circular view update".

Normal (slow) Ctrl+Tab is unchanged: the palette's own listener handles it and stops propagation before the workspace fallback runs.

Linked Issue

#11221

  • The linked issue is labeled ready-to-spec or ready-to-implement.

Testing

  • I have manually tested my changes locally with ./script/run

CHANGELOG-BUG-FIX: Fix Ctrl+Tab palette getting stuck open when releasing Ctrl quickly

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 18, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @simone-panico on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 18, 2026

@simone-panico

This PR is not linked to an issue that is marked with ready-to-implement.

Issue-state enforcement details:

  • Associated same-repo issues checked: none

  • Required readiness label: ready-to-implement

To continue, link this PR to a same-repo issue such as Closes #123 in the PR description, and make sure that issue has ready-to-implement.

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simone-panico

This PR is not linked to an issue that is marked with ready-to-implement.

Issue-state enforcement details:

  • Associated same-repo issues checked: none

  • Required readiness label: ready-to-implement

To continue, link this PR to a same-repo issue such as Closes #123 in the PR description, and make sure that issue has ready-to-implement.

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 18, 2026
@simone-panico
Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label May 18, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 18, 2026

The cla-bot has been summoned, and re-checked this pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant