gitea
gitea copied to clipboard
Rework repo buttons
- Replace "New PR" and "Go to File" button with Icon Button
- Move all "Add File" actions into a dropdown button
- Remove most custom styling of clone buttons
Buttons are now all equal height, mobile layout wraps gracefully.
Fixes: https://github.com/go-gitea/gitea/issues/13671 Replaces: https://github.com/go-gitea/gitea/pull/20375
Maybe should backport this into 1.17. I think all these "Add file" buttons there are a eyesore.
So unfortunately there's still a way to get this to totally break:

Did a few more fixes:
- Added margin back below subfolder path
- Made branch button render correctly without JS, eliminating the layout shift when JS loads
- Remove "Add File" button in subtree view, it seems to provide no value there.
Looks cool but I think it would better to stick a named class on these things as the string of 2-letter codes as a classes - all of which use !important seems likely to cause trouble.
I like to keep the CSS small and these helper they target a single element with a single CSS rule, that can't cause issues, the indent is clear.
I do wonder about whether dropping the New Pull Request label from the new pull request button makes it a bit difficult to see - previously it was pretty clear how to create a PR from a branch
Guess it is fine. My initial idea was to remove this button completely. But like it is now, it takes up little space so I kept it.
So unfortunately there's still a way to get this to totally break:
Hmm, I guess long branch name can be ellipsed there to prevent it.
Added truncation for long branch name:
Another slightly related fix included: When clicking the clone URL input, the whole URL is selected. Sometimes one only wants to select part of the URL. I changed the handler to focus so manual selection after first click is still possible and this matches GH behaviour as well.
Rebased, squashed and added one more commit which brings margins in-line and added a few css rules for wiki only.
For backport, we should wait a bit until we have a few translations.
Shoul be ready to merge, CI failure is unrelated.
:rocket:
🚀
please backport
Release branches don't receive translation updates, so I think it'd be best to wait a bit until add_file has some translations on main, then backport along with those.