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

Show something different for there is no conent. #82

Open
HWienhold opened this issue Oct 31, 2024 · 2 comments
Open

Show something different for there is no conent. #82

HWienhold opened this issue Oct 31, 2024 · 2 comments

Comments

@HWienhold
Copy link
Contributor

Hey,
i realized there is not really anything displayed when selecting folders. So naturally i would go for displaying a gif with a carlton dance instead of the folder as a file

Alternatively might also be an idea to display diffs from contained files...

@xfbs
Copy link
Owner

xfbs commented Oct 31, 2024

You have a point there :D I think it would be good to show something.. although, I'm not fully sold on the dance 😆

I had some ideas too:

  • Could display a file list... but doesn't make so much sense, because there is already one on the left
  • Could display diffs from all contained files
  • Could make it so you can't select/click on folders
  • We could also go the GitHub/GitLab route and render the README.md (if there is one in the folder). Although, I don't know if there would be much value in doing so

If we show diffs from contained files, there are some advantages and disadvantages:

  • Downside: Might potentially be a lot of data, which could make the user interaction slow (there are ways around that, we can do some hacky stuff like lazy rendering only files that are visible, I wrote a hook for that in the yew-hooks crate called use_visible() that lets us do that.
  • Advantage: it means you can search through all files using the browser built-in Ctrl+F

To be honest I don't fully know what the best move would be.

@HWienhold
Copy link
Contributor Author

HWienhold commented Oct 31, 2024

I'm not fully sold on the dance 😆

Bummer

* We could also go the GitHub/GitLab route and render the `README.md` (if there is one in the folder). Although, I don't know if there would be much value in doing so

I think diif.rs is more comparable to a PR view than to a repo view so i d say the Githuh route1 and imho the more useful for any user would prob be

* Could display diffs from all contained files

Especially if you d use it to check all the changes - it seems just easier to scroll to a few files than to open them all separately. But might be a good idea for the "repo browsing case"

* Could make it so you can't select/click on folders

well you should be able to expand the folder to see the files :-p.

I think the advantage you mentioned is quite huge - and the disadvantage - well in the end it could be a feature, nobody needs to use?

I wrote a hook for that in the yew-hooks crate called use_visible() that lets us do that.

Damn, thats helpful :-o

Footnotes

  1. i think the all diffs -View might be actually the only view there is for diffs - at least for gitea with anchor for files and clickhandler on folder s just expand/reduce filetree - dont know github by heart, but presumably it s similar

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

No branches or pull requests

2 participants