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

EuiCodeBlock - Copy Paste Experience broken as clicking on Copy Icon also copies Line Numbers #158644

Closed
achyutjhunjhunwala opened this issue May 30, 2023 · 7 comments · Fixed by #159064
Labels
bug Fixes for quality problems that affect the customer experience EUI

Comments

@achyutjhunjhunwala
Copy link
Contributor

achyutjhunjhunwala commented May 30, 2023

Kibana version:: 8.8

Describe the bug:

When copying the code using Copy Icon from a component which used EuiCodeBlock, and if it has Line Numbers enabled, also copies the Lines numbers, breaking the copy/paste experience

Steps to reproduce:

  1. Navigate to any page which uses EuiCodeBlock, good example are the APM - Onboarding Tutorials which is highly used page - https://edge-oblt.kb.us-west2.gcp.elastic-cloud.com/app/home#/tutorial/apm
  2. Try to copy the code from the code block, using the copy icon.
  3. Paste it and see the experience broken as line numbers also get copied

Expected behavior:

Line numbers should not be copied

Screenshots (if relevant):

Screenshot 2023-05-30 at 08 23 16

image

As we are introducing the new APM Serverless Onboarding Tutorial, which is required for the next Serverless Checkpoint, it would be great to have it fixed before that. Ideally before 8.9.
#155371

@achyutjhunjhunwala achyutjhunjhunwala added bug Fixes for quality problems that affect the customer experience EUI Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels May 30, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/eui-team (EUI)

@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@achyutjhunjhunwala achyutjhunjhunwala changed the title EuiCodeBlock copy code also copies line numbers breaking the code EuiCodeBlock - Copy Paste Experience broken as clicking on Copy Icon also copies Line Numbers May 30, 2023
@cee-chen
Copy link
Member

cee-chen commented Jun 1, 2023

@achyutjhunjhunwala We'll have a fix out soon - thank you so much for finding/flagging this. Just to check, is there a need for the fix to be backported to the next v8.8 release? Or is just v8.9 fine?

@achyutjhunjhunwala
Copy link
Contributor Author

@cee-chen Thank you so much for prioritising the fix 👍🏼 . For our use case, we are fine with 8.9 as well.
But @LucaWintergerst initially reported this issue for 8.8, so i suggest we see what he says.

@achyutjhunjhunwala
Copy link
Contributor Author

@cee-chen I had a chat with @LucaWintergerst and it seems it would really good to have this backported to 8.8 as the current experience is broken and also 8.8.1 is due in 1 week, which means if we can backport it to 8.8, we will also be able to catch the 8.8.1 ship.

@cee-chen
Copy link
Member

cee-chen commented Jun 2, 2023

No problem! We can certainly get a backport fix in before 8.8.1 FF.

cee-chen added a commit that referenced this issue Jun 3, 2023
This is a backport EUI upgrade to Kibana v8.8.1 containing an
`EuiCodeBlock` bugfix requested by the Observability team:
#158644 (comment)

## [`77.1.5`](https://github.com/elastic/eui/tree/v77.1.5)

**Bug fixes**

- Fixed `EuiCodeBlock` potentially incorrectly ignoring lines ending
with a question mark when using the Copy button.
([#6794](elastic/eui#6794))
- Fixed `EuiCodeBlock` to not include line numbers when copying content
([#6824](elastic/eui#6824))
- Fixed the expanded row animation on `EuiBasicTable` causing
cross-browser Safari issues
([#6826](elastic/eui#6826))

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@cee-chen
Copy link
Member

cee-chen commented Jun 3, 2023

With #158976, this should now be fixed in the next 8.8 release. As a heads up, main/8.9 won't be fixed until the next EUI upgrade PR, which should be happening sometime next week. Feel free to close this issue out or leave it open until then, up to you!

@vadimkibana vadimkibana removed the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Jun 5, 2023
cee-chen added a commit that referenced this issue Jun 6, 2023
## Summary

`eui@81.2.0` ⏩ `eui@81.3.0`

✨ Highlights:

- fixes #158644
- Adds a new Timeline icon for use within `EuiMarkdownEditor` (cc
@kqualters-elastic)
- Expandable rows used within `EuiBasicTable` and `EuiInMemoryTable` now
have a faster and snappier expand animation

___

## [`81.3.0`](https://github.com/elastic/eui/tree/v81.3.0)

- Added `timelineWithArrow` glyph to `EuiIcon`
([#6822](elastic/eui#6822))

**Bug fixes**

- Fixed `EuiCodeBlock` potentially incorrectly ignoring lines ending
with a question mark when using the Copy button.
([#6794](elastic/eui#6794))
- Fixed `EuiCodeBlock` to not include line numbers when copying content
([#6824](elastic/eui#6824))
- Fixed the expanded row animation on `EuiBasicTable` causing
cross-browser Safari issues
([#6826](elastic/eui#6826))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience EUI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants