Skip to content

Add action listener to workspace for pane::CloseActiveItem#46421

Merged
dinocosta merged 2 commits intozed-industries:mainfrom
FloppyDisco:Add-action-listener-to-workspace-for-pane-close-active-item
Jan 19, 2026
Merged

Add action listener to workspace for pane::CloseActiveItem#46421
dinocosta merged 2 commits intozed-industries:mainfrom
FloppyDisco:Add-action-listener-to-workspace-for-pane-close-active-item

Conversation

@FloppyDisco
Copy link
Contributor

@FloppyDisco FloppyDisco commented Jan 9, 2026

Closes #45261

similar to #42588
this PR adds an action listener to the workspace that checks if the focus is currently on a dock that does not contain panes.
if that is true. it retrieves the active center pane from the workspace and closes the active item.

this improvement will allow users to set cmd-w to pane::CloseActiveItem instead of workspace::CloseActiveDock if that is the behavior they would prefer, which is also the typical behavior in most other editors.

here is a video showing the center panes being closed while focus is on the Project Panel. and the panes in the Terminal Panel closing as normal.

closeActiveItem.mov

Release Notes:

  • Improved pane::CloseActiveItem to close center pane items even when focus is on a dock panel like the project panel or outline panel

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 9, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Jan 9, 2026
Adds test for how the workspace handles the `pane::CloseActiveItem`
action to close center pane items when focus is on a dock panel that
doesn't contain a pane, for example, the project panel.
@dinocosta
Copy link
Member

Thanks @FloppyDisco ! I've pushed a small commit adding a test for these new changes.

I wonder if having a dedicated, workspace-specific, action for this, like workspace::ClosePaneActiveItem would be better or more obvious but, seeing as #42588 also updates the workspace to handle pane-specific actions, I guess we can also merge these 🤔

@dinocosta dinocosta enabled auto-merge (squash) January 19, 2026 12:29
@dinocosta dinocosta merged commit 5492901 into zed-industries:main Jan 19, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Key bindings don't work on tabs when dock has focus

2 participants