Skip to content

Tooltip which shows variable value during debugging no longer hides automatically after variable loses focus#8961

Closed
s4gh wants to merge 3 commits intoapache:masterfrom
s4gh:feature/debug-variable-tooltip-nohide
Closed

Tooltip which shows variable value during debugging no longer hides automatically after variable loses focus#8961
s4gh wants to merge 3 commits intoapache:masterfrom
s4gh:feature/debug-variable-tooltip-nohide

Conversation

@s4gh
Copy link

@s4gh s4gh commented Oct 27, 2025

Tooltip which shows variable value during debugging no longer hides automatically after variable loses focus

When you are in debug mode and want to see value for some variable you can find this in "variables" view. Alternatively you can hover over a variable and tooltip is displayed. Which is more convenient for some quick checks. However, if the variable is not of primitive type you need to click "expand" icon in tooltip to see any data. For example, if you variable is instance of a class - you will see has code in popup and to see any property defined for this class instance you need to click that expand icon.

Unfortunately in NetBeans sometimes it is quite tricky to put your mouse into popup before it is automatically closed. This popup is automatically closed when variable for which it is display looses focus. See attached video.
https://github.com/user-attachments/assets/ef11db79-794b-4788-bc75-7c9cb03cfa3f
Sometimes this behavior is really annoying because you can't catch popup before it is closed.
This change makes popup "heavy" or "sticky" so it does not close automatically depending on focus or mouse movement. There are two ways to close it:

  • press "esc" on keyboard
  • click somewhere outside of popup in code editor window.

As for me this behavior is much more convenient. I've checked idea ide - and they have very similar behavior.
Also this behavior is aligned with other "mode" of this popup - when you expend popup to see details - there is popup window which also does not close depending on focus or mouse movement - but closes if you "click outside" or press "esc".

Video with behavior after the change:
https://github.com/user-attachments/assets/185b0ca7-9356-4a9e-baee-377883d82844

So as for me this is a good change - imho it makes this functionality more convenient to use and it makes it consistent with other "mode" for same popup.

Sergiy Veryovka added 2 commits October 27, 2025 18:20
@s4gh
Copy link
Author

s4gh commented Nov 19, 2025

@mbien can I please ask for review of this PR?
I've recorder videos "before" and "after" to demonstrate how such change makes debugging more convenient.

Thanks

@matthiasblaesing
Copy link
Contributor

matthiasblaesing commented Nov 19, 2025

I agree, that the tooltip is figgly and has a tendency to close to fast, but his change has a drawback: Inspecting multiple "trivial" variables is now harder. (I tested with the inline suggested fix)

Before this change you could move the mouse to all variables hover and see the value, that does not work anymore, the first value stays visible and that is it.

I would suggest to see if the transition from "mouse cursor" to "mouse cursor in tooltip" can be stabilized.

@mbien
Copy link
Member

mbien commented Nov 19, 2025

Unfortunately in NetBeans sometimes it is quite tricky to put your mouse into popup before it is automatically closed.

i haven't looked at this closer yet but my suspicion is that the (not always reproducible) bug is caused due to incorrect positioning of the popup location.

Tooltips disappear immediately if the mouse leaves the component bounds it was spawned on. That is likely why it disappears as soon you try to move the mouse onto the component (e.g to reach the pin icon). Other times it works fine.

This PR seems to workaround it by not making the tooltip close at all, which likely is not the right approach, since it would make the whole pining functionality (which is buggy) non-functional if I understand this correctly.

example this is when it worked:
image

IMO: we should try the tackle the underlying issue, so that the mouse can always reach the pin without it despawning.

@mbien
Copy link
Member

mbien commented Nov 19, 2025

try the following:

when trying to reach the pin, move the mouse straight up first then go right. Don't take the diagonal/shortest shortuct.

This seems to always work for me. This could be a good indication that this is indeed a bounding box/positioning issue.

@mbien mbien added Editor UI User Interface labels Nov 19, 2025
….java

Co-authored-by: Matthias Bläsing <mblaesing@doppel-helix.eu>
@s4gh
Copy link
Author

s4gh commented Nov 20, 2025

@mbien moving mouse straight up works most of the time. If popup is large and spans both to the right and to the left of your variable in the editor sometimes it does not work for me as well. And I need to repeat. And you can really view only primitive property values in popup. If it is an issuance of the class - most of the time you need click "expand" icon to see individual properties. And this is tricky with current behavior.

Different IDEs handle this differently:

  • Eclipse has popup which hides automatically when you remove mouse focus from variable and popup opens "expanded" by default
  • For vscode there is inline value and popup is also expanded by default and hides automaticallyvscode-debug
  • For idea popup is not expanded by default and it does not hide automatically - you need to click "outside" to hide popup.

So depending on what behavior your prefer you may call it "workaround" or not. As for me - behavior identical to idea is absolutely fine and I do not consider this as a workaround. But how we call it - this is not that important as for me. There are screen recording and you can see that current behavior is not ideal. And even recommendation to move mouse straight up is also not ideal as for me - sometimes popup is positioned to the right of the cursor and moving it straight up is really not obvious.

I'd really like to have some improvement here and any approach which will improve this is very welcomed as for me.

@mbien
Copy link
Member

mbien commented Nov 21, 2025

The bug does annoy me too but we shouldn't fix it by simply switching all editor tooltips heavyweight. I will look into this later, the code already computes mouse motion ignore areas.

@mbien
Copy link
Member

mbien commented Nov 21, 2025

please take a look at #9028 (PR produces a dev-build for testing purposes)

@s4gh
Copy link
Author

s4gh commented Nov 21, 2025

please take a look at #9028 (PR produces a dev-build for testing purposes)

Any improvement of debug tool tip behavior is very welcomed. If you feel more comfortable increasing area size instead of making tool tip "sticky" - great, any improvement will be good.
I wanted to try "dev-build" but I have not found how to download it. I assumed you mean that it produces binary which you can download and run. Or do you mean to pull code from your branch and build myself?

@neilcsmith-net
Copy link
Member

@s4gh You can find by clicking through to the checks tab on the pull request, under artefacts at the top. It's also under artefacts on the workflow overview for that PR run eg. https://github.com/apache/netbeans/actions/runs/19560221408

@s4gh
Copy link
Author

s4gh commented Nov 24, 2025

@mbien I have tried dev build. It works much better compared to current implementation.
If you are going to merge #9028 this PR may be closed I think

@mbien
Copy link
Member

mbien commented Nov 24, 2025

@s4gh thanks for testing!

@mbien mbien closed this in #9028 Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Editor UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants