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

Add branch name-copy buttons on the branches list #25569

Closed

Conversation

puni9869
Copy link
Member

@puni9869 puni9869 commented Jun 28, 2023

Fix:: #25120

There are some observation in different platforms like Github, Gitlab, Bitbucket and bunch of more platform.
I have observed they all have copy option for branch name. They don't have copy option for tags.

As a UX prespective for tags we don't need copy option.

By above observation I am suggsting the following UI changes, I know they might not align with UX point of way.But they are simplest to make quick.

Here is my suggestions:
image

When Hover on Copy
image

When Clicked on Copy
image

Code changes in files:-

<button class="btn interact-bg gt-p-3" data-clipboard-text="{{.Name}}" data-tooltip-content="{{$.locale.Tr "repo.branch.copy_branch_name"}}">{{svg "octicon-copy"}}</button>

Translations:-
en-US.ini

[repo]
branch.copy_branch_name = Copy Branch Name

@silverwind @delvh
I am open for any UI/UX suggestion which work the best.

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 28, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 28, 2023
silverwind
silverwind previously approved these changes Jun 28, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 28, 2023
@delvh delvh changed the title Issue 25120 put copy icon for branch name Add branch name-copy buttons on the branches list Jun 28, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 28, 2023
@techknowlogick techknowlogick added the topic/ui Change the appearance of the Gitea UI label Jun 29, 2023
@techknowlogick
Copy link
Member

@puni9869 could you check the "allow edits from maintainers" checkbox on this PR?

@lunny
Copy link
Member

lunny commented Jun 29, 2023

How about moving the copy button following the branch name? There are too many buttons at the end of this line.

@silverwind
Copy link
Member

How about moving the copy button following the branch name? There are too many buttons at the end of this line.

I think that would look strange. Imho it looks better when the buttons are together.

@@ -2474,6 +2474,7 @@ branch.create_branch_operation = Create branch
branch.new_branch = Create new branch
branch.new_branch_from = Create new branch from "%s"
branch.renamed = Branch %s was renamed to %s.
branch.copy_branch_name = Copy Branch Name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text could be Copy branch name, to match other texts like Create new branch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggestion below

@@ -2474,6 +2474,7 @@ branch.create_branch_operation = Create branch
branch.new_branch = Create new branch
branch.new_branch_from = Create new branch from "%s"
branch.renamed = Branch %s was renamed to %s.
branch.copy_branch_name = Copy Branch Name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branch.copy_branch_name = Copy Branch Name
branch.copy_branch_name = Copy branch name

@lunny
Copy link
Member

lunny commented Jun 29, 2023

How about moving the copy button following the branch name? There are too many buttons at the end of this line.

I think that would look strange. Imho it looks better when the buttons are together.

I have the opposite opinion. I don't think putting too many buttons together is a good design. And look like all other places, copy button is near the content.

@silverwind
Copy link
Member

silverwind commented Jun 29, 2023

We can move it after branch name, with a styling like in diff header, e.g. no padding and 14px:

Screenshot 2023-06-29 at 06 28 47

@silverwind silverwind self-requested a review June 29, 2023 04:29
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Jun 29, 2023
@silverwind silverwind dismissed their stale review June 29, 2023 04:30

need changes

@puni9869
Copy link
Member Author

Due to conflicts. Pr is moved to #25596

@puni9869 puni9869 closed this Jun 29, 2023
@puni9869 puni9869 deleted the punit/ISSUE-25120-put-copy-icon branch June 29, 2023 18:43
silverwind pushed a commit that referenced this pull request Jun 30, 2023
Adding  branch-name copy  to clipboard and button in branches screen

Replaces #25569
Fixes #25120


New mocks:
<img width="876" alt="Screenshot 2023-06-30 at 12 01 41 AM"
src="https://github.com/go-gitea/gitea/assets/80308335/a34ab00f-5625-4529-ba17-f2bf7af58e2a">
<img width="822" alt="Screenshot 2023-06-30 at 12 03 59 AM"
src="https://github.com/go-gitea/gitea/assets/80308335/3a32dffc-52cd-49e1-a437-6d11d58d0939">

<img width="476" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/85e8f361-5cb7-45d4-aced-ad2523d54ab0">
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants