jlfwong / speedscope

🔬 A fast, interactive web-based viewer for performance profiles.
https://www.speedscope.app
MIT License
5.58k stars 247 forks source link

Tooltip partially hidden under mouse #444

Open sparrowt opened 1 year ago

sparrowt commented 1 year ago

Thanks for such a useful tool!

One slight issue is the tooltip seems to show up directly under the mouse which can end up obscuring key information such as the duration or amount of memory, for example this is what I see: image

How many MB were allocated in that stack? <something>.11 but I find myself having to move my head very close to the screen to actually read it!

A simple offset would hopefully mitigate this for most default mouse cursors.

sparrowt commented 1 year ago

In the mean time this user style (e.g. used with 'Stylus' browser extension) helps my eyes immensely:

@-moz-document domain("speedscope.app") {
    ._kr13t6 {
        padding-left: 10px;
        font-size: 15px !important;
    }
}

(padding alone avoids the hidden-by-mouse problem, but bonus size increase of just the tooltip text helps me!) Result: image

Note: I fully realise the class name "_kr13t6" may well be randomly re-generated on rebuild so this may need periodic adjustment...

jlfwong commented 1 year ago

Hi @sparrowt! Thanks for the specific report w/ screenshot!

I think the relevant code to change is here: https://github.com/jlfwong/speedscope/blob/main/src/views/hovertip.tsx, and in particular OFFSET_FROM_MOUSE

If the font size in general is a problem, you can use browser zoom (focus the URL bar, and hit ctrl/cmd-+)

You can find information on contributing a fix here: https://github.com/jlfwong/speedscope/blob/main/CONTRIBUTING.md