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 partially hidden under mouse #444

Open
sparrowt opened this issue Oct 19, 2023 · 2 comments · May be fixed by #447
Open

Tooltip partially hidden under mouse #444

sparrowt opened this issue Oct 19, 2023 · 2 comments · May be fixed by #447

Comments

@sparrowt
Copy link

sparrowt commented Oct 19, 2023

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
Copy link
Author

sparrowt commented Oct 20, 2023

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
Copy link
Owner

jlfwong commented Oct 20, 2023

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

sparrowt added a commit to sparrowt/speedscope that referenced this issue Nov 14, 2023
Fixes jlfwong#444

For context: the default cursor on Windows 10 is 16px wide. Most OSes allow you to make it much bigger so there's not necessarily a 'right' value here, but it feels sensible to at least avoid obscuring it when using defaults.

Given most cursors display _below_ the pixel at which the cursor is pointing, a solution which works in more cases would probably need to make a change from the current decision to `// Place the tooltip below the cursor` but for now I have avoided doing this (I'm not sure of the historical reasons) and instead done the minimal improvement.
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 a pull request may close this issue.

2 participants