-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Follow file symlinks in the UI to their target #28835
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
Conversation
Only problem at the moment is that `git.TreeEntry` does not store the full path of the entry, only the actual filename without directory.
Trivia: If we merge this, we are even ahead of GitHub in terms of behavior as GitHub still shows the |
Could you add a test for |
And the test promptly caught a bug.
However, I have no idea how to implement |
As expected, it doesn't 😒 |
After reading the code, I have some new ideas, maybe more simple to do: backend does nothing, but let frontend navigate. For example:
Otherwise, if we really would like to resolve the link in backend, I guess it needs some big refactoring to make things clear. |
@wxiaoguang the problem with the frontend approach is that the frontend cannot recursively resolve links ( |
For me, I would like to see the direct link target on the UI, instead of recursively resolving the links ahead. For example: suppose there is a link If an end user would like to follow, the frontend approach could also work: use a href like |
But what is it you want to achieve when you click on a (symlinked) file? |
I updated the previous comment, a "/bar?follow_symlink=1" trick could work IMO. |
Are you working on this at the moment? |
# Conflicts: # templates/repo/view_list.tmpl
@delvh is there still anything to improve? |
A quick skim over your changes looked good. |
So, I tested it out now and pushed a small fix.
|
@delvh please fix the merge conflicts. 🍵 |
* giteaofficial/main: Fix modal + form abuse (go-gitea#34921) [skip ci] Updated translations via Crowdin Follow file symlinks in the UI to their target (go-gitea#28835) Fix issue filter (go-gitea#34914) Fix: RPM package download routing & missing package version count (go-gitea#34909) Add support for 3D/CAD file formats preview (go-gitea#34794)
…h/gitea into feature/enhanced-workflow-runs-api * 'feature/enhanced-workflow-runs-api' of github.com:bdruth/gitea: [skip ci] Updated translations via Crowdin Follow file symlinks in the UI to their target (go-gitea#28835) Fix issue filter (go-gitea#34914) Fix: RPM package download routing & missing package version count (go-gitea#34909) Add support for 3D/CAD file formats preview (go-gitea#34794) Add a `login`/`login-name`/`username` disambiguation to affected endpoint parameters and response/request models (go-gitea#34901) Improve tags list page (go-gitea#34898) [skip ci] Updated translations via Crowdin docs: fix typo in pull request merge warning message text (go-gitea#34899) Refactor container package (go-gitea#34877) [skip ci] Updated translations via Crowdin
Description
Previously, when you clicked on a symlink, a document was opened that only displayed
<target>
.While this follows git's behavior of implementing symlinks, it is not user-friendly for users using the web UI to access a file.
Now, symlinks are resolved when you click on a link next to them, either until a file has been found or until we know that the link is dead.
When the link cannot be accessed, we fall back to the current behavior of showing the document containing the target.
Before
Screenshots
After