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

Add pointer cursor when hovering over copybtn #7490

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Nov 14, 2024

When starting to use the new copy code button I felt that it was lacking the pointer cursor compared to ChatGPT.

copy-code.mp4

This PR adds the pointer.

I have not tested this as I don't know how to trigger Panel to use the updated css file.

Workaround

Until this PR is released you can work around the problem as below:

import panel as pn
from panel.chat import ChatInterface

pn.extension("perspective")

CSS = """
.codehilite:hover .copybtn {
  cursor: pointer;
}
"""

if not CSS in pn.pane.Markdown._stylesheets:
    pn.pane.Markdown._stylesheets.append(CSS)

code = """
Some code

```python
a=1
b=a+1
print(a, b)
```
"""

pn.template.FastListTemplate(
    title="Copy Button",
    sidebar=[code],
    main=[code],
).servable()

@MarcSkovMadsen
Copy link
Collaborator Author

The failing tests has nothing to do with this PR.

@hoxbro
Copy link
Member

hoxbro commented Nov 14, 2024

The failing tests has nothing to do with this PR.

Opened #7491

I have not tested this as I don't know how to trigger Panel to use the updated css file.

Can you try running panel bundle --all with the environment variable BOKEH_RESOURCES=server set?

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Will merge, thanks!

@philippjfr philippjfr merged commit e24f443 into main Nov 14, 2024
10 of 17 checks passed
@philippjfr philippjfr deleted the enhancement/copy-button-style branch November 14, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants