Skip to content

ADFA-7134: Let plugins show the IDE's own documentation - #2292

Open
Daniel-ADFA wants to merge 2 commits into
stagefrom
bugfix/ADFA-7134-host-doc-tooltips
Open

Daniel-ADFA wants to merge 2 commits into
stagefrom
bugfix/ADFA-7134-host-doc-tooltips

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-7134

IdeTooltipService.showTooltip(anchor, category, tag) ignored category, so a plugin could not show the IDE's own documentation. The Layout Editor plugin needs java / android.widget.TextView. The method now reads ide, java, kotlin and xml. Any other category still maps to the plugin's own, because Keystore-Generator passes plugin_keystore_generator, which is not its plugin ID.

The plugin half is a separate addons PR. The changelog entry sits under 26.48, assuming this ships in the next release.

The first commit is a Spotless reformat of the three touched files only. It also drops an orphaned KDoc that ktlint rejects.


Code Reviewer: Code Reviewer couldn't review this pull request
The pull request author does not have access to AI for the associated Atlassian organization.

Drops the orphaned KDoc at the end of IdeTooltipService, which ktlint rejects.
IdeTooltipService.showTooltip(anchor, category, tag) ignored the category and always read the plugin's own entries, so the Layout Editor plugin could not show java/android.widget.TextView. It now reads the IDE's ide, java, kotlin and xml categories; any other category still maps to the plugin's own, which keeps plugins that pass their category under another spelling working.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Release notes

  • IdeTooltipService.showTooltip(anchorView, category, tag) now reads IDE documentation for the categories ide, java, kotlin, and xml.
  • Any other category reads the calling plugin's own documentation entries.
  • The uncategorized showTooltip(anchorView, tag) overload is unchanged. Its documentation now states that it reads the plugin's own entries.
  • The changelog entry is in 26.48 (unreleased). It sets plugin.min_ide_version to 26.48.
  • The Layout Editor plugin needs the java category for android.widget.TextView. Its plugin-side change is in a separate addons PR.

Risks and best-practice notes

  • Behavior change: plugins that already call showTooltip with ide, java, kotlin, or xml now get IDE documentation. Before this change, they got their own entries. Plugin authors must check these calls.
  • Hardcoded allowlist: the four category names are fixed in PluginTooltipNaming.kt. Adding a category requires an IDE code change.
  • Passing another plugin's ID as a category: the objectives say Keystore-Generator passes plugin_keystore_generator. That value is not its plugin ID. Under the new rule, it falls through to the plugin's own category. Confirm that this is the intended result.
  • Correction to the earlier AI summary: it reported that hasTooltip was removed. The diff does not support this. The original file contained only a KDoc block for hasTooltip with no declaration. The commit removed that orphaned comment. No public method was removed.
  • Not verified: this review did not confirm test or CI results. The new PluginReadableCategoryTest cases were not run.

The categorized tooltip API now uses IDE documentation for ide, java, kotlin, and xml, and plugin documentation for other categories. The API documentation removes hasTooltip. The changelog sets the minimum IDE version for this behavior to 26.48.

Changes: Tooltip category routing

Layer / File(s) Summary
Tooltip API and release contract
plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt, docs/PLUGIN_API_CHANGELOG.md
The API documentation distinguishes categorized and uncategorized tooltip lookups. The hasTooltip declaration is removed. The changelog records the built-in categories and minimum IDE version 26.48.
Category resolution and tooltip display
plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/PluginTooltipNaming.kt, plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt, plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/PluginReadableCategoryTest.kt
The manager preserves the four built-in categories and maps other categories to the plugin category. The category-taking overload uses the resolved category for tooltip display and error logging. Tests cover both mappings.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Plugin as Plugin caller
  participant TooltipService as IdeTooltipServiceImpl
  participant CategoryResolver as pluginReadableCategory
  participant TooltipManager
  Plugin->>TooltipService: showTooltip(anchorView, category, tag)
  TooltipService->>CategoryResolver: Resolve category for pluginId
  CategoryResolver-->>TooltipService: Built-in category or plugin category
  TooltipService->>TooltipManager: Show tooltip with resolved category
Loading

Possibly related PRs

  • appdevforall/CodeOnTheGo#2163: Changes the tooltip reader and writer database schema used by the tooltip lookups routed through TooltipManager.

Suggested reviewers: dara-abijo-adfa, hal-eisen-adfa, davidschachteradfa

Merge Risk: Minimal · up to ffb56

Plugins can now show the IDE's own documentation for the ide, java, kotlin and xml categories. Other categories still read the plugin's own entries. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: plugins can now show the IDE's own documentation through IdeTooltipService.showTooltip. The changeset adds category resolution (ide, java, kotlin, xml read IDE docs) i…
Description check Passed The description explains the problem, the fix, and the scope. It states that showTooltip ignored category, that the method now reads ide, java, kotlin and xml, and that other categories still map to t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: plugins can now show the IDE's own documentation through IdeTooltipService.showTooltip. The changeset adds category resolution (ide, java, kotlin, xml read IDE docs) in PluginTooltipNaming.kt and IdeTooltipServiceImpl.kt, which matches the title. The ADFA-7134 ticket prefix is acceptable and the title is a single sentence of 8 words.

Full details: Description check

Explanation

The description explains the problem, the fix, and the scope. It states that showTooltip ignored category, that the method now reads ide, java, kotlin and xml, and that other categories still map to the plugin's own. It also notes the separate addons PR, the 26.48 changelog placement, and the Spotless reformat commit. This matches the changeset, which includes PluginTooltipNaming.kt, IdeTooltipServiceImpl.kt, the new test class, and the changelog entry.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit taps a tooltip tag,
Four paths keep their names intact.
Other tags find plugin pages,
Tests check both routes on the way.
The changelog marks the version,
And carrots celebrate the change.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 75a998af-52eb-489a-b555-f7cfce5e33ea
Commits

Reviewing files that changed from the base of the PR and between ea79020 and ffb5637.

Files selected for processing: 5

  • docs/PLUGIN_API_CHANGELOG.md
  • plugin-api/src/main/kotlin/com/itsaky/androidide/plugins/services/IdeTooltipService.kt
  • plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/PluginTooltipNaming.kt
  • plugin-manager/src/main/kotlin/com/itsaky/androidide/plugins/manager/services/IdeTooltipServiceImpl.kt
  • plugin-manager/src/test/kotlin/com/itsaky/androidide/plugins/manager/PluginReadableCategoryTest.kt

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

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.

1 participant