Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce an outline panel #12637

Merged
merged 39 commits into from
Jun 12, 2024
Merged

Introduce an outline panel #12637

merged 39 commits into from
Jun 12, 2024

Conversation

SomeoneToIgnore
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore commented Jun 4, 2024

Adds a new panel: OutlinePanel which looks very close to project panel:

Screenshot 2024-06-10 at 23 19 05

has similar settings and keymap (actions work in the OutlinePanel context and are under outline_panel:: namespace), with two notable differences:

  • no "edit" actions such as cut/copy/paste/delete/etc.
  • directory auto folding is enabled by default

Empty view:
Screenshot 2024-06-10 at 23 19 11

When editor gets active, the panel displays all related files in a tree (similar to what the project panel does) and all related excerpts' outlines under each file.
Same as in the project panel, directories can be expanded or collapsed, unfolded or folded; clicking file entries or outlines scrolls the buffer to the corresponding excerpt; changing editor's selection reveals the corresponding outline in the panel.

The panel is applicable to any singleton buffer:
Screenshot 2024-06-10 at 23 19 35

image

or any multi buffer:

(search multi buffer)

Screenshot 2024-06-10 at 23 19 41

(diagnostics multi buffer)
image

Release Notes:

  • Added an outline panel to show a "map" of the active editor

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 4, 2024
@zed-industries-bot

This comment was marked as outdated.

@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/outline-panel branch 9 times, most recently from a87207c to 997036f Compare June 5, 2024 19:18
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/outline-panel branch 16 times, most recently from c499138 to b33ae6e Compare June 10, 2024 20:28
@SomeoneToIgnore SomeoneToIgnore marked this pull request as ready for review June 10, 2024 20:28
@SomeoneToIgnore SomeoneToIgnore merged commit 8451dba into main Jun 12, 2024
8 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the kb/outline-panel branch June 12, 2024 20:22
@nervenes
Copy link
Contributor

thanks for this! 🙏

is the font size intentionally larger than everything else? is it possible to match it with the buffer_font_size or ui_font_size?
Screenshot 2024-06-13 at 01 44 53

@SomeoneToIgnore
Copy link
Contributor Author

Thank you, nothing is final here even if intentional, as the first version is a draft to iterate on mainly.
I've tried to keep outline items rendered similar to the outline modal items, but apparently did indeed used a wrong size, will try to find and fix it soon.

SomeoneToIgnore added a commit that referenced this pull request Jun 13, 2024
Follow-up of #12637

* Wrong font size for the outline items (fixes
#12637 (comment))
* Duplicate context menu item (fixes
#12957)
* Missing `space` keybinding for item opening (fixes
#12956)
* Adds 60px more to the default width (fixes
#12955)
* Incorrect scroll for singleton buffers (fixes
#12953)

Release Notes:

- N/A
ming900518 pushed a commit to ming900518/zed that referenced this pull request Jun 14, 2024
Adds a new panel: `OutlinePanel` which looks very close to project
panel:

<img width="256" alt="Screenshot 2024-06-10 at 23 19 05"
src="https://github.com/zed-industries/zed/assets/2690773/c66e6e78-44ec-4de8-8d60-43238bb09ae9">

has similar settings and keymap (actions work in the `OutlinePanel`
context and are under `outline_panel::` namespace), with two notable
differences:
* no "edit" actions such as cut/copy/paste/delete/etc.
* directory auto folding is enabled by default

Empty view: 
<img width="841" alt="Screenshot 2024-06-10 at 23 19 11"
src="https://github.com/zed-industries/zed/assets/2690773/dc8bf37c-5a70-4fd5-9b57-76271eb7a40c">


When editor gets active, the panel displays all related files in a tree
(similar to what the project panel does) and all related excerpts'
outlines under each file.
Same as in the project panel, directories can be expanded or collapsed,
unfolded or folded; clicking file entries or outlines scrolls the buffer
to the corresponding excerpt; changing editor's selection reveals the
corresponding outline in the panel.

The panel is applicable to any singleton buffer:
<img width="1215" alt="Screenshot 2024-06-10 at 23 19 35"
src="https://github.com/zed-industries/zed/assets/2690773/a087631f-5c2d-4d4d-ae25-30ab9731d528">

<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/e4f8082c-d12d-4473-8500-e8fd1051285b">

or any multi buffer:

(search multi buffer)

<img width="1728" alt="Screenshot 2024-06-10 at 23 19 41"
src="https://github.com/zed-industries/zed/assets/2690773/60f768a3-6716-4520-9b13-42da8fd15f50">

(diagnostics multi buffer)
<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/64e285bd-9530-4bf2-8f1f-10ee5596067c">

Release Notes:
- Added an outline panel to show a "map" of the active editor
ming900518 pushed a commit to ming900518/zed that referenced this pull request Jun 14, 2024
Follow-up of zed-industries#12637

* Wrong font size for the outline items (fixes
zed-industries#12637 (comment))
* Duplicate context menu item (fixes
zed-industries#12957)
* Missing `space` keybinding for item opening (fixes
zed-industries#12956)
* Adds 60px more to the default width (fixes
zed-industries#12955)
* Incorrect scroll for singleton buffers (fixes
zed-industries#12953)

Release Notes:

- N/A
SomeoneToIgnore added a commit that referenced this pull request Jun 14, 2024
Follow-up of #12637

Adds excerpt items into the outline panel: now all outline items are
initially hidden under excerpt items that could be toggled open/closed
similar to directories.


![Screenshot 2024-06-14 at 10 45
04](https://github.com/zed-industries/zed/assets/2690773/9c9ef91b-1666-43c3-acc4-96f850098a28)

On active editor's selection change, a corresponding outline will be
revealed still, expanding the corresponding excerpt

![Screenshot 2024-06-14 at 10 45
13](https://github.com/zed-industries/zed/assets/2690773/7dfd14f7-4aca-48f2-8760-8e1362b9a043)

Release Notes:

- N/A
fallenwood pushed a commit to fallenwood/zed that referenced this pull request Jun 18, 2024
Adds a new panel: `OutlinePanel` which looks very close to project
panel:

<img width="256" alt="Screenshot 2024-06-10 at 23 19 05"
src="https://github.com/zed-industries/zed/assets/2690773/c66e6e78-44ec-4de8-8d60-43238bb09ae9">

has similar settings and keymap (actions work in the `OutlinePanel`
context and are under `outline_panel::` namespace), with two notable
differences:
* no "edit" actions such as cut/copy/paste/delete/etc.
* directory auto folding is enabled by default

Empty view: 
<img width="841" alt="Screenshot 2024-06-10 at 23 19 11"
src="https://github.com/zed-industries/zed/assets/2690773/dc8bf37c-5a70-4fd5-9b57-76271eb7a40c">


When editor gets active, the panel displays all related files in a tree
(similar to what the project panel does) and all related excerpts'
outlines under each file.
Same as in the project panel, directories can be expanded or collapsed,
unfolded or folded; clicking file entries or outlines scrolls the buffer
to the corresponding excerpt; changing editor's selection reveals the
corresponding outline in the panel.

The panel is applicable to any singleton buffer:
<img width="1215" alt="Screenshot 2024-06-10 at 23 19 35"
src="https://github.com/zed-industries/zed/assets/2690773/a087631f-5c2d-4d4d-ae25-30ab9731d528">

<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/e4f8082c-d12d-4473-8500-e8fd1051285b">

or any multi buffer:

(search multi buffer)

<img width="1728" alt="Screenshot 2024-06-10 at 23 19 41"
src="https://github.com/zed-industries/zed/assets/2690773/60f768a3-6716-4520-9b13-42da8fd15f50">

(diagnostics multi buffer)
<img width="1728" alt="image"
src="https://github.com/zed-industries/zed/assets/2690773/64e285bd-9530-4bf2-8f1f-10ee5596067c">

Release Notes:
- Added an outline panel to show a "map" of the active editor
fallenwood pushed a commit to fallenwood/zed that referenced this pull request Jun 18, 2024
Follow-up of zed-industries#12637

* Wrong font size for the outline items (fixes
zed-industries#12637 (comment))
* Duplicate context menu item (fixes
zed-industries#12957)
* Missing `space` keybinding for item opening (fixes
zed-industries#12956)
* Adds 60px more to the default width (fixes
zed-industries#12955)
* Incorrect scroll for singleton buffers (fixes
zed-industries#12953)

Release Notes:

- N/A
fallenwood pushed a commit to fallenwood/zed that referenced this pull request Jun 18, 2024
Follow-up of zed-industries#12637

Adds excerpt items into the outline panel: now all outline items are
initially hidden under excerpt items that could be toggled open/closed
similar to directories.


![Screenshot 2024-06-14 at 10 45
04](https://github.com/zed-industries/zed/assets/2690773/9c9ef91b-1666-43c3-acc4-96f850098a28)

On active editor's selection change, a corresponding outline will be
revealed still, expanding the corresponding excerpt

![Screenshot 2024-06-14 at 10 45
13](https://github.com/zed-industries/zed/assets/2690773/7dfd14f7-4aca-48f2-8760-8e1362b9a043)

Release Notes:

- N/A
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.

3 participants