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 tree view for source files in editor. #1137

Conversation

xiaoniu-578fa6bff964d005

Implement #1136 .

Some Previews:
s1
s2

Some possible improvements:

  1. Tweak the style.
  2. Decide whether we still want sources and list_sources.

@yagebu
Copy link
Member

yagebu commented Aug 25, 2020

Hi @xiaoniu-578fa6bff964d005, thanks for the PR :)

I'm not willing to merge such a substantial change without any tests and I'm somewhat hesitant to merge such a big change for this feature at all. Could this maybe be implemented more succinctly by not rendering a full tree, but rather by just splitting the path into directory and filename and then just grouping by directory? I think that would already vastly reduce the visual clutter.

@xiaoniu-578fa6bff964d005
Copy link
Author

xiaoniu-578fa6bff964d005 commented Aug 25, 2020

Hi @yagebu, I am also not convinced that my design is the best approach. I would like to regard it as a mitigation of current difficulty and hopefully trigger the development of some serious solutions.

Do you have any example of "splitting the path into directory and filename and then just grouping by directory"?

@yagebu
Copy link
Member

yagebu commented Aug 25, 2020

Do you have any example of "splitting the path into directory and filename and then just grouping by directory"?

Well, it would look like your example image, but instead of having a tree of directories it would just be a list of directories and under each directory the files in that directory would be listed.

@xiaoniu-578fa6bff964d005
Copy link
Author

xiaoniu-578fa6bff964d005 commented Aug 25, 2020

Well, it would look like your example image, but instead of having a tree of directories it would just be a list of directories and under each directory the files in that directory would be listed.

Does each directorey show the full path? Do we need to handle nested folders?

@yagebu
Copy link
Member

yagebu commented Oct 15, 2020

Hey @xiaoniu-578fa6bff964d005, sorry for the long silence, I was on vacation and somewhat forgot about this.

Does each directorey show the full path? Do we need to handle nested folders?

I don't really have a strong opinion on this. I guess ignoring nested folders and showing the full path would be "good enough" without having to add about 150 lines of code.

If you really want to implement this as a tree view, it should be done completely in the frontend. The stratify function in frontend/src/lib/tree could be used to generate the tree from the array of source files (it would have to be slightly modified to obtain the "parent" for a file path instead of an account path).

@yagebu
Copy link
Member

yagebu commented Nov 29, 2020

I'm closing this stale PR. If you want to continue to work on this, feel free to reopen

@yagebu yagebu closed this Nov 29, 2020
@xiaoniu-578fa6bff964d005
Copy link
Author

xiaoniu-578fa6bff964d005 commented Jul 23, 2021

Sorry for the absence for almost one year.
During this time, have we introduced any other way to alleviate the problem that the file list is difficult to read when there are a large number of files?
In the past year I was using my implementation in the PR. Recently I wish to merge the upstream but it appears to be hard as many refactor has happened.
If there is any "good enough" implementation, I think I will just abandon the tree view in this PR and use the official repository.

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

Successfully merging this pull request may close these issues.

2 participants