-
Notifications
You must be signed in to change notification settings - Fork 4k
Remove copy button for empty codeblocks #2808
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add an enzyme test for this if it's not too much effort (mostly I'm not sure how much work it is to get the copy button to actually show up/not show up since in the real world it happens on mouse hover).
Also I believe this probably needs @asaini to glance at it since it's technically a user-facing behavior change
|
@vdonato Ok, I removed the As @kantuni requested, here's the refactor in a separate PR. Just waiting on @asaini for product review now. |
vdonato
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also still a test to write if it's feasible 🙂
|
Added test and fixed typo. Turned out, no need to check hover in test, just need to check if the copy button is mounted or not. |
|
LGTM 👍 |
* develop: (29 commits) Update bug_report.md Refactor CodeBlock.tsx (#2814) Remove copy button for empty codeblocks (#2808) Add image format deprecation config with expiration (#2865) Remove unneeded "use_column_width=True" from our doc examples (#2692) Extend our st.cache MagicMock handling logic to Mock (#2846) save work (#2862) Remove .stale-element class (#2848) Release 0.77 (#2849) Fix watchdog import failure (#2856) 🔥 Fully remove `format` param from st.image (#2637) Don't memoize config._server_headless (#2858) hide empty columns on mobile (#2756) st.beta_secrets (#2757) `watch_file` utility function (#2851) Align st.beta_columns (#2811) Update "showErrorDetails" config description and docs (#2841) Pause Dependabot updates for non-security-related issues (#2840) client.showTracebacks -> showErrorDetails (per product) (#2837) Color picker - show value (#2817) ...
Fixes #2743.
The visual overflow happens because empty code blocks are too small to contain the clipboard button. On top of that, a clipboard button seems pointless as there's nothing to copy. So I just removed it.