Skip to content

ADFA-2723: Fix the debugger tooltip behaviour#953

Merged
dara-abijo-adfa merged 5 commits intostagefrom
ADFA-2723-fix-debugger-tooltip-drag
Feb 12, 2026
Merged

ADFA-2723: Fix the debugger tooltip behaviour#953
dara-abijo-adfa merged 5 commits intostagefrom
ADFA-2723-fix-debugger-tooltip-drag

Conversation

@dara-abijo-adfa
Copy link
Contributor

  • Display the tooltip below the debugger toolbar so the toolbar is always visible
  • Don't show tooltip when toolbar is being dragged

@dara-abijo-adfa dara-abijo-adfa requested a review from a team February 9, 2026 21:15
@dara-abijo-adfa dara-abijo-adfa self-assigned this Feb 9, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Debug Overlay Touch Handling
app/src/main/java/com/itsaky/androidide/services/debug/DebugOverlayManager.kt
Improved touch event handling with refined dragging threshold using absolute delta values, explicit drag state initialization on ACTION_DOWN, split behavior for ACTION_UP distinguishing drag vs. click, and new ACTION_CANCEL case to reset state. Moved long-click tooltip anchor from current view to rootView.
Debug Actions Overlay Tooltip Anchor
app/src/main/java/com/itsaky/androidide/services/debug/DebuggerActionsOverlayAdapter.kt
Changed tooltip anchor target from current view to rootView in long-click handler.
Tooltip Overlay Window Support
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt
Added overlay window detection and conditional tooltip display path; tooltips in overlay windows are now centered on-screen. Introduced dynamic icon tinting (white in overlays, theme-based otherwise) and refactored button click handlers to use apply blocks. Added helper methods: View.isInOverlayWindow() and showOverlayTooltip().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • itsaky-adfa
  • Daniel-ADFA
  • jomen-adfa

Poem

🐰 Tooltips floating in the overlay sky,
Anchored roots keep them way up high,
White-tinted icons catch the light,
Touch thresholds dance through wrong and right,
Drag or click—now the overlays know! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, clearly stating the two key objectives: displaying tooltips below the toolbar and preventing display during dragging.
Title check ✅ Passed The title 'Fix the debugger tooltip behaviour' accurately reflects the main changes: adjusting tooltip positioning, preventing tooltip display during dragging, and icon tinting.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ADFA-2723-fix-debugger-tooltip-drag

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to WindowManager.

view.layoutParams returns the params assigned by the view's immediate parent. For any child view in the hierarchy, this would be a ViewGroup.LayoutParams subclass (e.g., LinearLayout.LayoutParams), not WindowManager.LayoutParams — so the check would silently return false. It works today because callers pass rootView, 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
     }

@dara-abijo-adfa dara-abijo-adfa changed the title ADFA-272: Fix the debugger tooltip behaviour ADFA-2723: Fix the debugger tooltip behaviour Feb 10, 2026
@dara-abijo-adfa dara-abijo-adfa merged commit 37c7dbf into stage Feb 12, 2026
2 checks passed
@dara-abijo-adfa dara-abijo-adfa deleted the ADFA-2723-fix-debugger-tooltip-drag branch February 12, 2026 12:11
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 this pull request may close these issues.

2 participants