Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork6.3k
Add repo file tree item link behavior#34730
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
wxiaoguang commentedJun 15, 2025
It should also follow the browser's default behavior: |
bytedream commentedJun 16, 2025
Done, thanks for pointing this out |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
wxiaoguang commentedJun 16, 2025
By doing some searches, I think "middle key" is not a widely used approach to "open a new window". I do not see browsers officially support it. The widely supported approach is "Ctrl+LeftClick" |
wxiaoguang commentedJun 16, 2025
If you'd like to support "middle click", the ideal approach can be like this:
|
silverwind commentedJun 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I think we should just render a native This way, stuff like middle click, ctrl+click, cmd+click will all work natively and don't even need explicit handlers. |
wxiaoguang commentedJun 17, 2025
The same as#34730 (comment) ? Or is there something I missed? |
silverwind commentedJun 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Basically the same, but I guess the code still need to check whether any modifier key is held, and only |
wxiaoguang commentedJun 17, 2025
I see, maybe ideally it could be like this:
|
silverwind commentedJun 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes, so basically: if(e.button!==0||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey){return;// let browser handle the click}e.preventDefault();// update view to clicked file Maybe |
bytedream commentedJun 18, 2025
Thanks for the suggestions, I've updated the PR accordingly by using
Interesting, I almost exclusively use the middle click to open links and such in a new tab.
Shift+LeftClick opens the link in a new browser window, so I've kept it. |
silverwind commentedJun 18, 2025
Yes, we need to keep all modifiers, they all have a purpose and mine opens new window on shift+click too. middle click and ctrl+click are both known to me, so they are not so obscure :) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
lunny commentedJun 19, 2025
It seems when a subtree is loaded, the whole screen flashes briefly. |
bytedream commentedJun 19, 2025
Fixed |
7346ae7 intogo-gitea:mainUh oh!
There was an error while loading.Please reload this page.
* giteaofficial/main: [skip ci] Updated translations via Crowdin Add ff_only parameter to POST /repos/{owner}/{repo}/merge-upstream (go-gitea#34770) Add repo file tree item link behavior (go-gitea#34730) Fix tag target (go-gitea#34781)
Uh oh!
There was an error while loading.Please reload this page.
Converts the repo file tree items into
<a>elements to have default link behavior. Dynamic content load is still done when no special key is pressed while clicking on an item.