Skip to content

Conversation

@terakael
Copy link
Contributor

Enables custom widgets to display tooltips, with the ability to use the same data object that the label has access to.

@amnweb
Copy link
Owner

amnweb commented Nov 21, 2025

This can be in one line

if not self._tooltip:
    return

if not self._exec_data:
    return

like

if not self._tooltip or not self._exec_data:

Remove import json line 227

Also, if someone has HTML in JSON like I do, it will show in the tooltip
Screenshot 2025-11-21 172127
Screenshot 2025-11-21 172332

Maybe we can remove any HTML tags from the tooltip text ? Something like

tooltip_text = re.sub(r'<[^>]+>', '', tooltip_text)
Screenshot 2025-11-21 173159

Edit: Also, please clean up the commit history so we can have a single clear commit about this

- Add tooltip configuration option with custom label support

- Support both custom tooltip_label formatting and default JSON display

- Add tooltip delay configuration (400ms default)

- Include comprehensive documentation and examples

- Add validation schema for tooltip options
@terakael
Copy link
Contributor Author

Thanks for the review! I've made the changes you requested.

For the json showing the raw html - I feel like if you used the tooltip_label feature like:

tooltip_label: "{data[absoluteChange]}<br>{data[lastPrice]}"

you'd get your expected formatting (similar to how the Weather widget is working). This also leaves it up to the one configuring their widget to choose whether they want the full raw json or to have some formatting.

What do you think?

@amnweb amnweb merged commit 23e4c05 into amnweb:main Nov 24, 2025
3 checks passed
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.

2 participants