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

Add excerpts into outline panel #13034

Merged
merged 10 commits into from
Jun 14, 2024
Merged

Conversation

SomeoneToIgnore
Copy link
Contributor

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

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

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 14, 2024
@SomeoneToIgnore
Copy link
Contributor Author

CI seems unrelated, as the PR with only README.md changed fails the same way: #13036

https://github.com/zed-industries/zed/actions/runs/9513364665/job/26223318236?pr=13036#step:5:792

@SomeoneToIgnore SomeoneToIgnore merged commit eb7a09b into main Jun 14, 2024
8 of 9 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the kb/excerpts-in-outline-panel branch June 14, 2024 09:03
@baldwindavid
Copy link
Contributor

baldwindavid commented Jun 14, 2024

@SomeoneToIgnore Thanks for adding this outline panel. The main reason I'd use this is to wade through search results in a multi-buffer similar to the screenshots above. If it never changes from here it will still be useful, but I find this display of excerpts and nodes a bit disorienting. Really the only thing I'd want to see after performing a search is a list of lines containing the search term underneath the file. So instead of...

- .idea
  - local_test_2.iml
    Lines 3-11

...more like...

- .idea
  - local_test_2.iml
    ...$MODULE_DIR$/src" isTestSource="false" />
    ...type="sourceFolder" forTests="false" />

...with the word "Test" highlighted in each result in the panel. As it is the excerpt and node hierarchy make it difficult to click/visualize and find the actual line where the search result is. I understand that what I have proposed here maybe conflicts with the name "Outline Panel", but I'm suggesting keeping the folder/file outline but, specifically for search, displaying search results rather than a tree of nodes in the file.

@SomeoneToIgnore
Copy link
Contributor Author

Sounds very reasonable, but I'd want to keep things this way for now, and explore how "project git diff" works with this feature — keeping the outlines there is odd too, and with 3 different cases of sub-item display, it might be simpler to have a good abstraction on top of them all.

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
@SomeoneToIgnore
Copy link
Contributor Author

@baldwindavid , have you considered how would you want to see these entries in the panel?

I am not sure still, considering options — seems like I'd like to preserve the FS entries' representation (down to files and, maybe, excerpts) as a tree structure.
But afterwards — what would be beneficial to show per search result/diagnostic/git entry in your opinion?
Or would you be opposed to the tree-like structure entirely?

@baldwindavid
Copy link
Contributor

baldwindavid commented Jul 22, 2024

Hi @SomeoneToIgnore - I'm really speaking to just search results here so this probably won't help from a holistic abstraction perspective...

I'm not opposed to the tree-like structure entirely; just not a fan of it down to the excerpt level and, especially, the syntax tree within the excerpts. When I search for a term I really only care about the specific lines that that term matches. The excerpt lines just seem like more of an ephemeral/changeable display concern than something relevant to a search result.

Thus, my view on it is pretty much as mentioned above in #13034 (comment) - Directories and file names, but with a bit of text per match with the match highlighted in the text.

Not that things need to be just like VSCode but, as an example, this is effectively exactly how it displays search results and it makes it easy to navigate through them. VSCode does also have "sticky headers" which makes this easier to see, but that's a whole other feature (#7243). Lastly, VSCode also has a non-tree view that can be toggled. I tend to use the tree view more, but they're both good.

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.

2 participants