gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Rework repo buttons

Open silverwind opened this issue 3 years ago • 10 comments
trafficstars

  • 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

Screen Shot 2022-08-01 at 21 37 53 Screen Shot 2022-08-01 at 21 37 36 Screen Shot 2022-08-01 at 21 29 22

silverwind avatar Aug 01 '22 19:08 silverwind

Maybe should backport this into 1.17. I think all these "Add file" buttons there are a eyesore.

silverwind avatar Aug 01 '22 19:08 silverwind

So unfortunately there's still a way to get this to totally break:

Screenshot from 2022-08-01 21-39-40

zeripath avatar Aug 01 '22 20:08 zeripath

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.

silverwind avatar Aug 01 '22 21:08 silverwind

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.

silverwind avatar Aug 01 '22 21:08 silverwind

So unfortunately there's still a way to get this to totally break:

Screenshot from 2022-08-01 21-39-40

Hmm, I guess long branch name can be ellipsed there to prevent it.

silverwind avatar Aug 01 '22 21:08 silverwind

Added truncation for long branch name:

Screen Shot 2022-08-01 at 23 36 42 Screen Shot 2022-08-01 at 23 36 15

silverwind avatar Aug 01 '22 21:08 silverwind

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.

silverwind avatar Aug 01 '22 22:08 silverwind

Rebased, squashed and added one more commit which brings margins in-line and added a few css rules for wiki only.

silverwind avatar Aug 02 '22 18:08 silverwind

For backport, we should wait a bit until we have a few translations.

silverwind avatar Aug 03 '22 07:08 silverwind

Shoul be ready to merge, CI failure is unrelated.

silverwind avatar Aug 05 '22 20:08 silverwind

:rocket:

lafriks avatar Aug 06 '22 18:08 lafriks

🚀

lafriks avatar Aug 07 '22 23:08 lafriks

please backport

lafriks avatar Aug 07 '22 23:08 lafriks

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.

silverwind avatar Aug 08 '22 10:08 silverwind