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

fix(ui): ClipboardText tooltip properly positioned #11946

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

agilgur5
Copy link

@agilgur5 agilgur5 commented Oct 4, 2023

Motivation

This was found by a user and noted on Slack. I then reproduced this myself, see below screenshot with incorrect positioning:
Screenshot 2023-10-04 at 5 13 33 PM -- clipboard before

Modifications

  • the original PR fix: long code blocks overflow in ui. Fixes #8916 #8947 that added overflow here was for horizontal scrolling for multi-line args in code blocks (<pre> elements)
    • so I moved the overflow into the pre element's class more specifically and made it specific for the x direction
      • note that these code block elements do not have a clipboard button to copy their text

Verification

Tested locally with a few different variations, see screenshots below.

Single-line clipboard tooltip positioned correctly:
Screenshot 2023-10-04 at 5 34 25 PM -- clipboard one-line

Multi-line clipboard tooltip positioned correctly:
Screenshot 2023-10-04 at 5 06 11 PM -- clipboard multi-line

Horizontal overflow on code blocks still works:
Screenshot 2023-10-04 at 5 07 16 PM -- overflow horizontal still works

Horizontal overflow on multi-line code blocks still works:
Screenshot 2023-10-04 at 5 11 23 PM -- horizontal scroll multi-line

- it seems that with the [new version of `tippy`](argoproj/argo-ui@d726f6c), the `overflow` property made it show up directly above the text (in the z direction)
  - this meant that you could not click on the clipboard to copy because it would cover the icon 😕

- the [original commit](argoproj@6c244f3) that added `overflow` here was for horizontal scrolling for multi-line args in code blocks (`<pre>` elements)
  - so I moved the `overflow` into the `pre` element's `class` and made it specific for the `x` direction

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Thanks!

@terrytangyuan terrytangyuan enabled auto-merge (squash) October 4, 2023 21:37
@terrytangyuan terrytangyuan merged commit 05c6db1 into argoproj:master Oct 4, 2023
@agilgur5 agilgur5 deleted the fix-ui-clipboard-copy branch October 5, 2023 00:04
dpadhiar pushed a commit to dpadhiar/argo-workflows that referenced this pull request May 9, 2024
Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants