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

Option for Tree view when depth value is set #165

Closed
LamprosPitsillos opened this issue Jul 29, 2022 · 10 comments
Closed

Option for Tree view when depth value is set #165

LamprosPitsillos opened this issue Jul 29, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@LamprosPitsillos
Copy link

Have the option to view the directories in a tree instead of having to read the whole path to find something.

filetree_W

Something like this but with all the functionality of this plugin!

@LamprosPitsillos LamprosPitsillos added the enhancement New feature or request label Jul 29, 2022
@fdschmidt93
Copy link
Member

fdschmidt93 commented Jul 29, 2022

I don't really follow your request. There's lots of open questions as to what exactly you actually want to achieve. Please don't be that lazy and make a more comprehensible feature request that discusses:

  • UI: how are users exactly supposed to see a tree view (file- or folder-browser), e.g. in results or preview buffer?
  • UX: what are potential UX improvements here?

Both aspects I perceive as very clean right now in telescope-file-browser.nvim. Once users grok switching between file and folder-browsing, I believe speed of execution for even complex file edit operations is not easily matched by more vanilla file explorers.

That said, neo-tree can perfectly co-exists with telescope-file-browser.nvim.

E: More broadly, I encourage you to put more work into these sorts of issues. Please consider going forward that maintainers that want to reduce maintenance and overhead on a single or more public repositories they host all the while being motivated to attend to users issues and requests.

@schoblaska
Copy link

I think that @LamprosPitsillos was proposing showing the file browser results as a tree if the depth option is greater than 1. Eg (current UI on the left, proposed UI on the right):

image

I find the tree view is easier to scan visually and I think it would be a nice option to have. It does get a little tricky because you would still want to be able to fuzzy search on the full path of all files / folders, even though the tree view is hiding part of that path for any nested items.

If this seems feasible I'm happy to take a crack at implementing it.

Thanks for the great plugin!

@LamprosPitsillos
Copy link
Author

Yes , forgive me for not posting after with a more detailed explanation, but yes , this is exactly what i had in mind!

@fdschmidt93
Copy link
Member

If this seems feasible I'm happy to take a crack at implementing it.

Sure, it's feasible. I'm mostly wary of things would have to change to preserve the simple status quo all the while enabling this. You're very happy to take a crack and we'd take things in a PR from there.

It does get a little tricky because you would still want to be able to fuzzy search on the full path of all files / folders, even though the tree view is hiding part of that path for any nested items.

In principle, this is feasible though telescope wasn't really designed with some of the requirements here in mind (there's some workarounds already in telescope-file-browser.nvim).

At the first tree view, the screenshot looks fine (I suppose some users would like connecting vertical lines, but it's probably a lot more overhead than worthwhile vis-a-vis simple indentation).

When a user starts searching, nested items would require the full relative part (or "smart", etc. as per telescope path_display) to visually distinguish between potentially identically named options (entry.display). Sorting is a different thing (entry.ordinal). All elements are tracked by their absolute path to begin with (entry.value). For more reference see

I hope that's sufficient to get you started, happy to answer more questions if needed.

One more note -

local action_state = require "telescope.actions.state"
local current_picker = action_state.get_current_picker(prompt_buf or vim.api.nvim_get_current_buf())
local prompt = current_picker:_get_prompt()

gets you the prompt, to e.g. differentiate when a user is searching or not. There is a very general use case function for this in telescope-file-browser nvim to get the prompt already (get_fb_prompt).

@schoblaska
Copy link

That's massively helpful, thank you!

@ttytm
Copy link

ttytm commented Sep 24, 2022

would love to see this. If nobody is already on this, I should be able to make the time to give it a shot next week.

@schoblaska
Copy link

@tobealive Go for it! I haven't started on anything, but let me know if you want someone to bounce ideas off of.

@ttytm
Copy link

ttytm commented Oct 15, 2022

Hey @joeyschoblaska,

I wanted to come back real quick to my call about working on this. Unfortunately, I have to admit that putting work into it lost priority. The reason is that I found a satisfying alternative and having a lot of back and forth between two new projects at work.

In case someone is interested in the alternative:
As regular tree plugin I'm using neo-tree. For telescope-like file browsing use-cases it can be toggled in floating mode. Additionally, it allows different kinds of filtering, has configurable tree views, previews etc. So it's more than just visualizing tree depth, so it would be quiet some work to catch up with those functionalities.

Please let me know if it's inappropriate to talk about other plugins here, so I can remove the paragraph.

Of course eventually - speaking from an end users perspective - it would be super nice to have this feature for telescope-file-browser for an even more uniform experience using telescope directly.

@jamestrew
Copy link
Collaborator

I'm going to close this consider we closed the PR for this while back.
See more on this #210

@jamestrew jamestrew closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2024
@schoblaska
Copy link

This is the route I ended up going: nvim-telescope/telescope.nvim#3052 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants