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

Flash of type hint tooltips on page load #1087

Closed
mattrossman opened this issue Mar 12, 2025 · 1 comment
Closed

Flash of type hint tooltips on page load #1087

mattrossman opened this issue Mar 12, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mattrossman
Copy link

What version of Effect is running?

No response

What steps can reproduce the bug?

Visit a page with code snippets and type hint tooltips above the fold.

E.g. https://effect.website/docs/getting-started/creating-effects/

Load or reload the page. You'll see all tooltips appear for a moment before returning to the correct hidden state.

CleanShot.2025-03-12.at.19.12.07.mp4

What is the expected behavior?

I expect these tooltips will be hidden unless I hover over them.

What do you see instead?

All tooltips appear briefly before hiding.

Additional information

I see this behavior in Chrome and (to a lesser extent) Firefox.

A brief poking around in devtools suggests these tooltips are provided by the "expressive-code-twoslash" package. Based on the behavior on the website for that package, there must be a way to implement it that avoids the flash.

"expressive-code-twoslash": "^0.4.0",

The package was introduced in #943

@mattrossman mattrossman added the bug Something isn't working label Mar 12, 2025
@mattrossman
Copy link
Author

Couple things I notice:

  • Tooltip initialization aligns with the DOMContentLoaded event
  • When JavaScript is disabled, all type hints are permanently visible

I figure tooltips should instead be hidden until JS runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant