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

Tooltip issues #4887

Closed
jbednar opened this issue May 18, 2023 · 8 comments · Fixed by #4890
Closed

Tooltip issues #4887

jbednar opened this issue May 18, 2023 · 8 comments · Fixed by #4890
Labels
type: enhancement Minor feature or improvement to an existing feature
Milestone

Comments

@jbednar
Copy link
Member

jbednar commented May 18, 2023

The new tooltips on widgets in Panel 1.0 are great! However, the UX isn't quite right, because hovering over the (?) takes so long that I reflexively click on the (?), which then stops the hover text from appearing. I think the delay should be maybe half what it is, and clicking on it should make the tooltip first appear, then (if clicked again) disappear, rather than suppress it silently without ever having shown it. That's probably a Bokeh issue rather than Panel, but maybe Panel sets the defaults.

Also, I think Panel or Param should strip out leading spaces that appear either on all lines of the doc or on all but the first line, so that docstrings can be formatted naturally in the code but also display naturally in the UI:

image
@jbednar jbednar added the TRIAGE Default label for untriaged issues label May 18, 2023
@philippjfr
Copy link
Member

Most of this is a request for Bokeh. I certainly agree that the timeout is too long and clicking shouldn't have any effect.

@mattpap
Copy link
Collaborator

mattpap commented May 19, 2023

I certainly agree that the timeout is too long and clicking shouldn't have any effect.

Note that plain text (string) description uses HTML's title attribute, so we don't have any control over how this behaves. If you want full control, then those descriptions have to be wrapped in an explicit Tooltip(content=...). Thus in bokeh:

input_widget.description = "string"

and

input_widget.description = Tooltip(content="string")

are not equivalent.

@philippjfr
Copy link
Member

Maybe I don't know how to use it correctly, but this doesn't work for me at all:

input_widget.description = Tooltip(content="string")

No tooltip is ever shown.

@philippjfr
Copy link
Member

Nevermind, had to provide a position. I'll probably switch to explicit tooltips immediately.

@philippjfr
Copy link
Member

Much better:

Screen Shot 2023-05-19 at 14 51 25

That said, when used on a server this causes serialization errors:

Error rendering Bokeh items: Error: [object HTMLDivElement] is not serializable

Seems to originate here, where you're setting the actual DOM element as an attribute of the Model:

https://github.com/bokeh/bokeh/blob/branch-3.2/bokehjs/src/lib/models/widgets/input_widget.ts#L78

@philippjfr
Copy link
Member

Was able to resolve that by setting syncable=False on the Tooltip model but still seems like an issue.

@philippjfr philippjfr added this to the v1.0.2 milestone May 19, 2023
@philippjfr philippjfr added type: enhancement Minor feature or improvement to an existing feature and removed TRIAGE Default label for untriaged issues labels May 19, 2023
@mattpap
Copy link
Collaborator

mattpap commented May 19, 2023

Was able to resolve that by setting syncable=False on the Tooltip model but still seems like an issue.

Setting syncable=False in such cases is a generally good idea. The serialization error is a bug and I thought I already fixed it. Or maybe it was reported somewhere and got forgotten.

@mattpap
Copy link
Collaborator

mattpap commented May 19, 2023

Nevermind, had to provide a position. I'll probably switch to explicit tooltips immediately.

The API of tooltips is not well refined. Setting position is one of those issue, which I trip over every time I use Tooltip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants