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

Adding branch-name copy to clipboard branches screen. #25596

Merged
merged 6 commits into from
Jun 30, 2023

Conversation

puni9869
Copy link
Member

@puni9869 puni9869 commented Jun 29, 2023

Adding branch-name copy to clipboard and button in branches screen

Replaces #25569
Fixes #25120

New mocks:
Screenshot 2023-06-30 at 12 01 41 AM
Screenshot 2023-06-30 at 12 03 59 AM

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 29, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 29, 2023
@puni9869
Copy link
Member Author

puni9869 commented Jun 29, 2023

@silverwind @lunny @wxiaoguang
Mobile view
image

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

There could be some existing CSS classes for the styles.

templates/repo/branch/list.tmpl Outdated Show resolved Hide resolved
templates/repo/branch/list.tmpl Outdated Show resolved Hide resolved
@puni9869 puni9869 changed the title Adding branch-name copy to clipboard and button in branches screen. Adding branch-name copy to clipboard branches screen. Jun 29, 2023
<div class="gt-df gt-ac">
<a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a>
<button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button>
</div>
Copy link
Member

@silverwind silverwind Jun 29, 2023

Choose a reason for hiding this comment

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

You can probably avoid the extra wrapper via gt-ac gt-ellipsis on the <a>.

Copy link
Member Author

@puni9869 puni9869 Jun 29, 2023

Choose a reason for hiding this comment

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

Not possible
image

image

we want the whole flex-box div item to be in centered alinged.
And if we apply gt-ac

image

The branch anchor tag is perfectly centered.

@silverwind
Copy link
Member

Wow, this table looks so bad in those screenshots, but probably not this PRs fault (alone). Please provide comparison before/after screenshots here to ensure this didn't regress it further.

@puni9869
Copy link
Member Author

puni9869 commented Jun 30, 2023

Wow, this table looks so bad in those screenshots, but probably not this PRs fault (alone). Please provide comparison before/after screenshots here to ensure this didn't regress it further.

My soul is also hearting when I see <tr><td></td></tr> , in the instead of flex and grid and with specially in the mobile layout.

Here is the before and after comparison.

Before
image

After applying copy button:
image

--

Mobile view:
image

After applying copy button:
image


image

After

image

IMO we should change <table> layout in next followup PR. Let this PR address copy functionality changes.

Copy link
Member

@lunny lunny left a comment

Choose a reason for hiding this comment

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

Approve the copy button position.

@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 30, 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 30, 2023
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 30, 2023
@silverwind silverwind enabled auto-merge (squash) June 30, 2023 17:47
@silverwind silverwind merged commit 4583cbd into go-gitea:main Jun 30, 2023
23 checks passed
@GiteaBot GiteaBot added this to the 1.21.0 milestone Jun 30, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 30, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 2, 2023
* giteaoffical/main: (89 commits)
  Move some files under repo/setting (go-gitea#25585)
  Following-up improvments for various PRs (go-gitea#25620)
  Set SSH_AUTHORIZED_KEYS_BACKUP to false (go-gitea#25412)
  Fix bug of branches API with tests (go-gitea#25578)
  [skip ci] Updated translations via Crowdin
  Application as a maintainer (go-gitea#25614)
  Adding  branch-name copy  to clipboard branches screen. (go-gitea#25596)
  Use AfterCommitId to get commit for Viewed functionality (go-gitea#25529)
  Fix branch commit message too long problem (go-gitea#25588)
  Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (go-gitea#25581)
  Add API for changing Avatars (go-gitea#25369)
  read-only checkboxes don't appear and don't entirely act the way one might expect (go-gitea#25573)
  Redirect to package after version deletion (go-gitea#25594)
  Update emoji set to Unicode 15 (go-gitea#25595)
  Fix `lint-swagger` action (go-gitea#25593)
  Replace fomantic divider module with our own (go-gitea#25539)
  Add documentation about supported workflow trigger events (go-gitea#25582)
  Sync branches into databases (go-gitea#22743)
  Fix milestones deletion (go-gitea#25583)
  Reduce table padding globally (go-gitea#25568)
  ...

# Conflicts:
#	templates/repo/wiki/revision.tmpl
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 28, 2023
@denyskon denyskon added the type/enhancement An improvement of existing functionality label Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "copy branch name" (icon) on dropdown branch selector
6 participants