Skip to content

outline_panel: Remove toggle expanded behavior from OpenSelectedEntry#42214

Merged
smitbarmase merged 2 commits intozed-industries:mainfrom
kevinru2023:fix/outline-panel/OpenSelectedEntry-toggling-behavior
Nov 13, 2025
Merged

outline_panel: Remove toggle expanded behavior from OpenSelectedEntry#42214
smitbarmase merged 2 commits intozed-industries:mainfrom
kevinru2023:fix/outline-panel/OpenSelectedEntry-toggling-behavior

Conversation

@kevinru2023
Copy link
Contributor

Fixed outline panel space key behavior by removing duplicate toggle call

The open_selected_entry function in outline_panel.rs was incorrectly calling self.toggle_expanded(&selected_entry, window, cx) in addition to its primary logic, causing the space key to both open/close entries AND toggle their expanded state. Removed the redundant toggle_expanded call to achieve the intended behavior.

Closes #41711

Release Notes:

  • Fixed issue with the outline panel where pressing space would cause an open selected entry to collapse and cause a closed selected entry to open.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 7, 2025
@maxdeviant maxdeviant changed the title removed toggle expanded behavior from OpenSelectedEntry to address #4… Remove toggle expanded behavior from OpenSelectedEntry Nov 7, 2025
@kevinru2023
Copy link
Contributor Author

I notice that the tests that are failing are checking to see if the panel has those items open? Did I misread the intended behavior? @smitbarmase

@smitbarmase smitbarmase self-assigned this Nov 8, 2025
Copy link
Member

@smitbarmase smitbarmase left a comment

Choose a reason for hiding this comment

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

Turns out we were incorrectly using OpenSelectedEntry in tests for expand/collapse actions. Now the behaviors are more decoupled: OpenSelectedEntry just focuses the current outline entry in the editor, and we already have expand/collapse actions with the default left/right arrow key bindings for that. Thanks for working on this!

@smitbarmase smitbarmase changed the title Remove toggle expanded behavior from OpenSelectedEntry outline_panel: Remove toggle expanded behavior from OpenSelectedEntry Nov 13, 2025
@smitbarmase smitbarmase merged commit c626e77 into zed-industries:main Nov 13, 2025
24 checks passed
11happy pushed a commit to 11happy/zed that referenced this pull request Dec 1, 2025
…zed-industries#42214)

Fixed outline panel space key behavior by removing duplicate toggle call

The `open_selected_entry` function in `outline_panel.rs` was incorrectly
calling `self.toggle_expanded(&selected_entry, window, cx)` in addition
to its primary logic, causing the space key to both open/close entries
AND toggle their expanded state. Removed the redundant `toggle_expanded`
call to achieve the intended behavior.

Closes zed-industries#41711

Release Notes:

- Fixed issue with the outline panel where pressing space would cause an
open selected entry to collapse and cause a closed selected entry to
open.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

outline_panel::OpenSelectedEntry toggle the entry's state between opened and collapsed.

2 participants