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

Clipboard copy enhancements #27669

Merged
merged 5 commits into from
Oct 18, 2023
Merged

Clipboard copy enhancements #27669

merged 5 commits into from
Oct 18, 2023

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Oct 17, 2023

  1. Do not show temporary tooltips that are triggered from within dropdowns. Previously this resulted in the tooltip being stuck to top-left of the page like seen on issue comment URL copy. I could not figure out any tippy options that prevent this, so I think it's better to just not show it.
  2. Refactor initGlobalCopyToClipboardListener so that it does not run a often useless document.querySelector on every click, make data-clipboard-text-type work with data-clipboard-target. No use in current code base but still good to have. Finally some minor code cleanup in the function.

Point 1 is for this copy button:

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 17, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 17, 2023
@silverwind silverwind changed the title Clipboard copy enhancments Clipboard copy enhancements Oct 17, 2023
@silverwind silverwind added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Oct 17, 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 Oct 17, 2023
@silverwind silverwind added the backport/v1.21 This PR should be backported to Gitea 1.21 label Oct 17, 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 Oct 18, 2023
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.

Line 7 comment could also be updated accordingly.

@silverwind
Copy link
Member Author

Line 7 comment could also be updated accordingly.

It's still accurate, but I guess we can rewrite it to also mention data-clipboard-text-type.

@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 18, 2023
@silverwind silverwind removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 18, 2023
@silverwind
Copy link
Member Author

Comment updated.

@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 18, 2023
@silverwind silverwind enabled auto-merge (squash) October 18, 2023 15:03
@silverwind silverwind merged commit 0b654fa into go-gitea:main Oct 18, 2023
25 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Oct 18, 2023
GiteaBot added a commit to GiteaBot/gitea that referenced this pull request Oct 18, 2023
1. Do not show temporary tooltips that are triggered from within
dropdowns. Previously this resulted in the tooltip being stuck to
top-left of the page like seen on issue comment URL copy. I could not
figure out any tippy options that prevent this, so I think it's better
to just not show it.
1. Refactor `initGlobalCopyToClipboardListener` so that it does not run
a often useless `document.querySelector` on every click, make
`data-clipboard-text-type` work with `data-clipboard-target`. No use in
current code base but still good to have. Finally some minor code
cleanup in the function.

Point 1 is for this copy button:

<img width="229" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/81f34746-8ea5-43d9-8c6f-f6f417a9e4ad">

---------

Co-authored-by: Giteabot <[email protected]>
@GiteaBot GiteaBot added backport/done All backports for this PR have been created and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Oct 18, 2023
@silverwind silverwind deleted the dropdowntip branch October 18, 2023 16:22
silverwind added a commit that referenced this pull request Oct 18, 2023
Backport #27669 by @silverwind

1. Do not show temporary tooltips that are triggered from within
dropdowns. Previously this resulted in the tooltip being stuck to
top-left of the page like seen on issue comment URL copy. I could not
figure out any tippy options that prevent this, so I think it's better
to just not show it.
1. Refactor `initGlobalCopyToClipboardListener` so that it does not run
a often useless `document.querySelector` on every click, make
`data-clipboard-text-type` work with `data-clipboard-target`. No use in
current code base but still good to have. Finally some minor code
cleanup in the function.

Point 1 is for this copy button:

<img width="229" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/81f34746-8ea5-43d9-8c6f-f6f417a9e4ad">

Co-authored-by: silverwind <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 19, 2023
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Add link for repositories README file (go-gitea#27684)
  Fix typo "GetLatestRunnerToken" (go-gitea#27680)
  Clipboard copy enhancements (go-gitea#27669)
  Remove unnecessary parameter (go-gitea#27671)
  Always delete existing scheduled action tasks (go-gitea#27662)
  Support allowed hosts for webhook to work with proxy (go-gitea#27655)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.21 This PR should be backported to Gitea 1.21 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. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants