Skip to content

Add tooltip documentation to plugin contributed editor tabs#1017

Merged
Daniel-ADFA merged 5 commits intostagefrom
ADFA-1716
Mar 5, 2026
Merged

Add tooltip documentation to plugin contributed editor tabs#1017
Daniel-ADFA merged 5 commits intostagefrom
ADFA-1716

Conversation

@Daniel-ADFA
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f18cdb8e-af39-464e-9212-68a5af82e281

📥 Commits

Reviewing files that changed from the base of the PR and between 1a0d678 and 8c3cf30.

📒 Files selected for processing (1)
  • app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt

📝 Walkthrough
  • Added long-press tooltip documentation for plugin-contributed editor tabs to improve discoverability of plugin tabs.
  • Introduced new tooltip tag constant PROJECT_PLUGIN_TAB ("project.plugin.tab") for standardized tooltip labeling.

Changes

  • EditorHandlerActivity.kt
    • Removed verbose debug logging from selectPluginTabById().
    • After creating plugin tabs, added logic that binds a long-press tooltip listener to plugin tab views (shows a "project-plugin-tab" tooltip anchored to the tab view).
  • TooltipTag.kt
    • Added public constant PROJECT_PLUGIN_TAB = "project.plugin.tab".
  • EditorBottomSheetTabAdapter.kt
    • Plugin tab construction now assigns TooltipTag.PROJECT_PLUGIN_TAB to plugin-contributed tabs.

⚠️ Risks & Best Practices

  • Duplicate listener attachments: The implementation iterates over all plugin tabs and binds long-click listeners each time createPluginTab() runs, which can attach duplicate listeners and cause redundant callbacks.
    • Recommendation: Bind the tooltip only to the newly created tab or make binding idempotent (check existing tag/listener) to avoid duplicates.
  • Potential memory leaks: Repeatedly creating listeners that capture the activity context can impede garbage collection of views.
    • Recommendation: Use weak references, remove listeners when tabs are removed, or centralize lifecycle-aware binding.
  • Efficiency concerns: Re-binding across all tabs on every creation is unnecessarily costly.
    • Recommendation: Move tooltip binding to single-tab initialization or centralize binding so each tab is bound once.

Testing Recommendations

  • Verify tooltip appears on long-press for plugin-contributed tabs and is correctly anchored.
  • Create and remove many plugin tabs to check for duplicate callbacks and memory growth (leak detection).
  • Test tab lifecycle (creation, removal, switching) to ensure listeners are not duplicated and are cleaned up appropriately.

Walkthrough

Added a tooltip constant and wired long-press tooltip listeners to plugin tab views; removed verbose debug logs from plugin-tab selection logic. (20 words)

Changes

Cohort / File(s) Summary
Editor: plugin tab behavior
app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
Removed verbose debug logs in selectPluginTabById. In createPluginTab, replaced final creation log with a loop that binds long-press listeners to plugin tab views to show the PROJECT_PLUGIN_TAB tooltip.
Tooltip constants
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt
Added public constant PROJECT_PLUGIN_TAB = "project.plugin.tab".
Tab adapter metadata
app/src/main/java/com/itsaky/androidide/adapters/EditorBottomSheetTabAdapter.kt
Set TooltipTag.PROJECT_PLUGIN_TAB on plugin-derived tabs (was previously null), enabling tooltip association for those tabs.

Sequence Diagram(s)

(Skipped — change is a localized UI enhancement and does not introduce complex multi-component control flow.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • itsaky-adfa
  • dara-abijo-adfa
  • hal-eisen-adfa

Poem

🐇 I nibble keys and press a tab so light,
A secret tag blooms when held just right.
Little listeners stitched in soft UI fur,
Tooltips whisper secrets — hop, peek, and purr. ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess if the description is related to the changeset. Add a pull request description explaining the purpose of adding tooltips to plugin tabs, the benefits, and any relevant context.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add tooltip documentation to plugin contributed editor tabs' clearly and specifically describes the main change: adding tooltip documentation to plugin tabs.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ADFA-1716

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

🧹 Nitpick comments (1)
app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt (1)

1113-1123: Bind the tooltip listener only to the newly created tab.

At Line 1113, rebinding all plugin-tab listeners on each creation adds avoidable churn. Bind the listener once on tab.view for this new tab.

Refactor diff
-                pluginTabIndices.forEach {
-                    val tab = content.tabs.getTabAt(it.value) ?: return@forEach
-                    tab.view.setOnLongClickListener {
-                        TooltipManager.showIdeCategoryTooltip(
-                            context = this@EditorHandlerActivity,
-                            anchorView = tab.view,
-                            tag = TooltipTag.PROJECT_PLUGIN_TAB,
-                        )
-                        true
-                    }
-                }
+                tab.view.setOnLongClickListener {
+                    TooltipManager.showIdeCategoryTooltip(
+                        context = this@EditorHandlerActivity,
+                        anchorView = tab.view,
+                        tag = TooltipTag.PROJECT_PLUGIN_TAB,
+                    )
+                    true
+                }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt`
around lines 1113 - 1123, The current code iterates pluginTabIndices.forEach and
rebinds the long-click tooltip listener for all plugin tabs each time a tab is
created; instead, after creating the new tab in EditorHandlerActivity, get only
that tab via content.tabs.getTabAt(newIndex) (using the index/value you just
inserted into pluginTabIndices) and call setOnLongClickListener on its view to
invoke TooltipManager.showIdeCategoryTooltip with TooltipTag.PROJECT_PLUGIN_TAB;
remove the pluginTabIndices.forEach block and ensure you null-check the tab (?:
return) and return true from the listener.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt`:
- Around line 1113-1123: The current code iterates pluginTabIndices.forEach and
rebinds the long-click tooltip listener for all plugin tabs each time a tab is
created; instead, after creating the new tab in EditorHandlerActivity, get only
that tab via content.tabs.getTabAt(newIndex) (using the index/value you just
inserted into pluginTabIndices) and call setOnLongClickListener on its view to
invoke TooltipManager.showIdeCategoryTooltip with TooltipTag.PROJECT_PLUGIN_TAB;
remove the pluginTabIndices.forEach block and ensure you null-check the tab (?:
return) and return true from the listener.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34dc0fb and f5da289.

📒 Files selected for processing (2)
  • app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
  • idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt

@Daniel-ADFA Daniel-ADFA merged commit b30f087 into stage Mar 5, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-1716 branch March 5, 2026 15:34
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