ADFA-2723: Fix the debugger tooltip behaviour#953
Conversation
dara-abijo-adfa
commented
Feb 9, 2026
- Display the tooltip below the debugger toolbar so the toolbar is always visible
- Don't show tooltip when toolbar is being dragged
📝 WalkthroughWalkthroughThis PR enhances tooltip rendering for debug overlay windows and refines touch event handling in the debug overlay. It adds overlay window detection to tooltips with centered on-screen display and dynamic icon tinting, while improving drag vs. click distinction in the overlay manager through refined touch threshold logic. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt`:
- Around line 488-509: showOverlayTooltip measures popupView before the WebView
content is rendered, so measuredWidth/measuredHeight are from the empty state
and center (x,y) is wrong; fix by deferring the centering until content/layout
is stable: register a WebViewClient.onPageFinished (for
WebView.loadDataWithBaseURL) or a ViewTreeObserver.OnGlobalLayoutListener on
popupView (or the WebView inside it), then recompute popupView.measure(),
popupView.measuredWidth/height and call popupWindow.update(...) or reposition
via popupWindow.showAtLocation(parentView, Gravity.NO_GRAVITY, x, y) again to
recenter once the WebView has finished loading/rendering.
🧹 Nitpick comments (1)
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt (1)
482-486:isInOverlayWindow()only works reliably on the root view added toWindowManager.
view.layoutParamsreturns the params assigned by the view's immediate parent. For any child view in the hierarchy, this would be aViewGroup.LayoutParamssubclass (e.g.,LinearLayout.LayoutParams), notWindowManager.LayoutParams— so the check would silently returnfalse. It works today because callers passrootView, but a future caller passing a non-root view would get incorrect results.Consider either:
- Renaming to make the contract explicit (e.g.,
isOverlayRootView()), or- Walking up to the actual root:
rootView.layoutParams.Suggested hardening
- private fun View.isInOverlayWindow(): Boolean { - val params = layoutParams + private fun View.isInOverlayWindow(): Boolean { + val params = rootView.layoutParams return params is WindowManager.LayoutParams && params.type == WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY }