Skip to content

editor: Make editor: expand excerpts actually expand all excerpts - #54717

Merged
SomeoneToIgnore merged 1 commit into
zed-industries:mainfrom
feitreim:bugfix-excerpt-expand
Apr 27, 2026
Merged

editor: Make editor: expand excerpts actually expand all excerpts#54717
SomeoneToIgnore merged 1 commit into
zed-industries:mainfrom
feitreim:bugfix-excerpt-expand

Conversation

@feitreim

@feitreim feitreim commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Expand all excerpts had a doc comment describing it as expanding all excerpts, but in practice it only expanded the excerpt that was the most relevant.

I fixed that to make it expand all excerpts.

video:

Screen.Recording.2026-04-23.at.5.49.43.PM.mov

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #54651

Release Notes:

  • editor: expand excerpts now has correct documentation explaining its function.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 23, 2026
@zed-community-bot zed-community-bot Bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Apr 23, 2026

@SomeoneToIgnore SomeoneToIgnore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you, this is quite a stark change of the existing behavior, so let's not ship the PR in this form to avoid breaking someone's workflow for an issue with no upvotes.

  • First of all, a very nice spot of the

/// Expands all excerpts in the editor.

doc being wrong: let's instead document that it expands all excerpts with selections.

  • Is it so that other actions behave differently?
    That seems wrong, but would love to get a comparison.

  • If selecting all and expanding excerpts (on macOs that's cmd-a and repeated alt-enter) does not work as a solution still, let's add a standalone action to do what's intended.
    That action could have a doc and tests similar to what's done in the PR.

@SomeoneToIgnore SomeoneToIgnore self-assigned this Apr 24, 2026
@feitreim
feitreim force-pushed the bugfix-excerpt-expand branch from ea3679e to 83b332b Compare April 24, 2026 17:00
The action only expands excerpts that overlap a selection, not every
excerpt in the editor.
@feitreim
feitreim force-pushed the bugfix-excerpt-expand branch from 83b332b to 073bf63 Compare April 24, 2026 17:03
@feitreim

Copy link
Copy Markdown
Collaborator Author

@SomeoneToIgnore Thanks for the feedback, updated it to just change the doc comment, I tested cmd+a then shift+enter to expand and that accomplished the goal just fine.

Looking into other actions this seems like the correct and consistent name for the action, the name for the action as originally described would contain the word "All", like FoldAll, UnfoldAll, StageAll.

@SomeoneToIgnore SomeoneToIgnore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Amazing, thank you for the small fix!

@SomeoneToIgnore
SomeoneToIgnore added this pull request to the merge queue Apr 27, 2026
Merged via the queue into zed-industries:main with commit 892b4ad Apr 27, 2026
31 checks passed
@feitreim
feitreim deleted the bugfix-excerpt-expand branch April 27, 2026 16:42
@hyperknot

Copy link
Copy Markdown

Sorry this is still confusing. I'm the author of the original issue #54651

Expand all should expand all excerpts, not just the selected ones. The non-all version should expand all the selected ones.

Which behaviour got chosen?

@feitreim

Copy link
Copy Markdown
Collaborator Author

@hyperknot right now there is no Expand All Excerpts command, just Expand Excerpts, previously, the doc comment for Expand Excerpts said that it would effect all, instead just selected. Naming convention wise, this isn't correct. If there were an action that did expand ALL the excerpts, it would have All in the name, like Expand All Excerpts.

so right now the behavior is Expand Excerpts expands excerpts with selections in them.
There is no Expand All Excerpts.

@hyperknot

Copy link
Copy Markdown

I see. Not having a full 2 pane view is the most painful part of Zed for me currently, coming from JetBrains. I actually keep JetBrains open only for this feature.

Ideally it'd be a setting something like "git-diff-initial-view": expanded/collapsed

@hyperknot

Copy link
Copy Markdown

Opened feature request here:
#55261

ebaah46 pushed a commit to ebaah46/zed that referenced this pull request May 6, 2026
…ed-industries#54717)

Expand all excerpts had a doc comment describing it as expanding all
excerpts, but in practice it only expanded the excerpt that was the most
relevant.

I fixed that to make it expand all excerpts. 

video:


https://github.com/user-attachments/assets/9858ebda-199c-4f72-8a2f-3cd606b0eff4

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#54651 

Release Notes:

- editor: `expand excerpts` now has correct documentation explaining its
function.
kathbigra pushed a commit to kathbigra/zed that referenced this pull request May 10, 2026
…ed-industries#54717)

Expand all excerpts had a doc comment describing it as expanding all
excerpts, but in practice it only expanded the excerpt that was the most
relevant.

I fixed that to make it expand all excerpts. 

video:


https://github.com/user-attachments/assets/9858ebda-199c-4f72-8a2f-3cd606b0eff4

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#54651 

Release Notes:

- editor: `expand excerpts` now has correct documentation explaining its
function.
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…ed-industries#54717)

Expand all excerpts had a doc comment describing it as expanding all
excerpts, but in practice it only expanded the excerpt that was the most
relevant.

I fixed that to make it expand all excerpts. 

video:


https://github.com/user-attachments/assets/9858ebda-199c-4f72-8a2f-3cd606b0eff4

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#54651 

Release Notes:

- editor: `expand excerpts` now has correct documentation explaining its
function.
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…ed-industries#54717)

Expand all excerpts had a doc comment describing it as expanding all
excerpts, but in practice it only expanded the excerpt that was the most
relevant.

I fixed that to make it expand all excerpts. 

video:


https://github.com/user-attachments/assets/9858ebda-199c-4f72-8a2f-3cd606b0eff4

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#54651 

Release Notes:

- editor: `expand excerpts` now has correct documentation explaining its
function.
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 guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

editor: expand excerpts doesn't expand all, just one

3 participants