Skip to content

ADFA-2774: Add tooltip to plugin fragment template#923

Merged
hal-eisen-adfa merged 2 commits intostagefrom
ADFA-2774
Feb 5, 2026
Merged

ADFA-2774: Add tooltip to plugin fragment template#923
hal-eisen-adfa merged 2 commits intostagefrom
ADFA-2774

Conversation

@Daniel-ADFA
Copy link
Contributor

Screen.Recording.2026-02-04.at.16.28.17.mov

@Daniel-ADFA Daniel-ADFA requested a review from a team February 4, 2026 15:28
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Release Notes - ADFA-2774: Add tooltip to plugin fragment template

New Features

  • Tooltip support in plugin fragments: Added IdeTooltipService integration to enable tooltips on long-press interactions in generated plugin fragment templates
  • Long-click gesture handling: Implemented long-click listener on action button to display contextual tooltips
  • Service initialization: Added automatic tooltip service discovery and initialization from the plugin's service registry

What's Included

  • New template file: pluginFragment.kt with tooltip support pre-configured for new plugin projects
  • setupServices() method to initialize tooltip service from plugin registry during fragment creation
  • Long-click handler that displays tooltips with plugin-specific category and tag identifiers
  • Fallback UI feedback (Toast message) when tooltip service is unavailable

Changes Made

  • Added tooltipService nullable field for caching IdeTooltipService instance
  • Added setupServices() method invoked in onCreateView() to initialize tooltip service
  • Added long-click listener with tooltip display logic and error handling
  • Added required imports: IdeTooltipService and Toast
  • Generated tooltip category and tag from plugin ID (with dot-to-underscore conversion)

Risks & Best Practices Violations

  • ⚠️ Silent exception handling: setupServices() uses runCatching {} without logging or error reporting. Service initialization failures will be silently ignored, making debugging difficult.
  • ⚠️ Nullable service without null safety: Tooltip service relies on optional chaining (?.) and elvis operator fallback, but no logging indicates when service is unavailable versus when it's intentionally null.
  • ⚠️ Activity reference dependency: Long-click handler requires activity reference to show Toast. Could fail silently if fragment is detached or activity is null.
  • ⚠️ Resource cleanup incomplete: While onDestroyView() nulls out view references, tooltipService reference is not explicitly cleared, potentially holding service reference longer than needed.
  • ⚠️ Template generated code quality: Since this generates plugin code, developers may replicate these patterns. Consider adding inline documentation about proper error handling for production use.

Recommendations

  • Add debug logging in setupServices() to aid troubleshooting
  • Document the tooltip service contract and availability requirements
  • Consider a Result/sealed class pattern instead of nullable service
  • Add explicit tooltipService = null in onDestroyView() for consistency

Walkthrough

Added tooltip support to the plugin fragment by integrating IdeTooltipService, initializing the service during view creation, and implementing a long-click listener on the action button to display tooltips or fallback to toast messages.

Changes

Cohort / File(s) Summary
Tooltip Service Integration
templates-impl/src/main/java/com/itsaky/androidide/templates/impl/pluginProject/pluginFragment.kt
Added tooltipService field and setupServices() method for IdeTooltipService initialization. Implemented long-click listener on actionButton to trigger tooltip display with fallback to Toast when service unavailable. Added necessary imports for IdeTooltipService and Toast.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • itsaky-adfa
  • jomen-adfa
  • jatezzz

Poem

🐰 A tooltip springs to life with a long-press delight,
Service wired tight, from morning to night,
When tips won't show, a Toast saves the day,
Hopping forward with AndroidIDE's way! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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
Title check ✅ Passed The title clearly and specifically describes the main change: adding tooltip functionality to the plugin fragment template.
Description check ✅ Passed The description references an attached asset demonstrating the tooltip feature and relates to the changeset of adding tooltip support.

✏️ 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-2774

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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.

@hal-eisen-adfa hal-eisen-adfa merged commit 5d0bf8a into stage Feb 5, 2026
2 checks passed
@hal-eisen-adfa hal-eisen-adfa deleted the ADFA-2774 branch February 5, 2026 01:15
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.

3 participants