Skip to content

outline_panel: Add setting to hide symbols in multi-buffer views - #63404

Merged
SomeoneToIgnore merged 4 commits into
zed-industries:mainfrom
FrantisekGazo:feat/outline-panel-hide-symbols
Aug 31, 2026
Merged

outline_panel: Add setting to hide symbols in multi-buffer views#63404
SomeoneToIgnore merged 4 commits into
zed-industries:mainfrom
FrantisekGazo:feat/outline-panel-hide-symbols

Conversation

@FrantisekGazo

@FrantisekGazo FrantisekGazo commented Aug 29, 2026

Copy link
Copy Markdown

Closes #60242

Objective

When reviewing a branch diff — or project search results — the outline panel lists every affected excerpt and symbol beneath each file. On a diff touching more than a handful of files, this consumes so much vertical space that you cannot see the list of changed files at all, which is usually the thing you want the panel for.

Existing settings don't cover this:

  • expand_outlines_with_depth: 0 still renders excerpt rows and top-level symbol rows.
  • Collapsing a file row in the panel is coupled to folding that buffer in the editor, so it can't be used purely to tidy the panel.

Solution

A display-only mode that reduces multi-buffer views to just the directory/file tree.

  • New outline_panel.multi_buffer_hide_symbols setting (default false). When enabled, multi-buffer views render only directory, file and folded-directory rows — excerpt, symbol and search-match rows are hidden.
  • New outline panel: toggle symbols action, plus a button in the panel footer, which toggles an in-memory per-panel override of the setting (the same pattern as editor: toggle inlay hints). Changing the setting clears the override, so the setting wins.
  • Single-file views are exempt, and the footer button is not shown there — the panel contains only symbols in that case, so hiding them would leave it empty.
  • The filter is display-only: collapsed_entries and editor buffer folding are never touched.
  • Outline fetching is skipped while the mode is active, so large diffs don't pay for outlines that will not be rendered. Turning the mode off re-triggers fetching.

This adds one new icon, file_code_off, used by the footer button when symbols are hidden. cc @zed-industries/design for review per the icon guidelines — it is file_code with the slash and outline gaps from file_ignored, keeping the parts of the chevrons that fall on the near side of the slash.

Testing

Three new tests in crates/outline_panel/src/outline_panel.rs:

  • test_hide_symbols_in_multibuffer — outline rows are present by default; only Fs/FoldedDirs entries remain once the mode is enabled via the setting (which also exercises the settings observer) and via the action; outline rows return when it is toggled off, confirming outlines are re-fetched; asserts collapsed_entries is unchanged at every step, covering the display-only guarantee.
  • test_hide_symbols_exempts_singleton — a single-file view still renders its outline with the setting enabled.
  • test_hide_symbols_hides_search_matches — project search match rows are hidden while files and directories still render, and return when toggled off.

cargo test -p outline_panel (15 passing), cargo test -p icons, cargo test -p settings_ui -p settings_content, and ./script/clippy on the touched crates are all green.

Tested manually on macOS against a branch diff, project search results, and single-file buffers, checking both the setting and the action (from the panel footer button and from the command palette with focus outside the panel), and that expanding/collapsing directories and editor folding still behave as before.

Self-Review Checklist:

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

Showcase

Symbols shown (default) Symbols hidden
Footer toggle
Branch diff
Project search

Single-file views are unaffected — symbols still render, and the toggle is not offered:


Release Notes:

  • Fixed too many outlines shown per excerpt in the outline panel. Added an outline_panel.multi_buffer_hide_symbols setting and an outline panel: toggle symbols action to show only files and directories in the outline panel for multi-buffer views.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 29, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Aug 29, 2026
@SomeoneToIgnore SomeoneToIgnore self-assigned this Aug 29, 2026
Adds `outline_panel.multi_buffer_hide_symbols` (default false) and an
`outline panel: toggle symbols` action with a panel footer button, which
reduce multi-buffer views to just the directory/file tree by hiding
excerpt, symbol and search-match rows.

The action toggles an in-memory per-panel override of the setting;
changing the setting clears the override. Single-file views are exempt.
The filter is display-only: collapsed entries and editor buffer folding
are never touched. Outline fetching is skipped while the mode is active,
and re-triggered when it is turned off.
@FrantisekGazo
FrantisekGazo force-pushed the feat/outline-panel-hide-symbols branch from 77e0665 to d6d7b33 Compare August 29, 2026 09:57
@MrSubidubi MrSubidubi added the area:outline Feedback for outline view, symbols, etc label Aug 29, 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.

Thanks, nice idea!

Took a liberty to push a fix for incorrect outline filtering in excerpts; and had to fix the focus issues: removing the symbols did not re-select anything in the pane, spoiling its uninterrupted navigation ergonomics.

@SomeoneToIgnore
SomeoneToIgnore added this pull request to the merge queue Aug 31, 2026
Merged via the queue into zed-industries:main with commit e8fbacb Aug 31, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:outline Feedback for outline view, symbols, etc cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outline repeats full-file symbols for each reference excerpt in Find All References

3 participants