Skip to content

feat(ADFA-2351): Add tooltips to code text actions#971

Merged
dara-abijo-adfa merged 2 commits intostagefrom
ADFA-2351-code-actions-tooltips
Feb 13, 2026
Merged

feat(ADFA-2351): Add tooltips to code text actions#971
dara-abijo-adfa merged 2 commits intostagefrom
ADFA-2351-code-actions-tooltips

Conversation

@dara-abijo-adfa
Copy link
Contributor

Add tooltips to code text actions - Copy, Paste, Select all etc.

@dara-abijo-adfa dara-abijo-adfa requested a review from a team February 12, 2026 11:55
@dara-abijo-adfa dara-abijo-adfa self-assigned this Feb 12, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Release Notes

Features

  • Added tooltip support to editor code text actions (long-press tooltips for Copy, Paste, Select All, Format Code, etc.)
    • Tooltips now resolve per-action using action-defined tooltip tags when available; falls back to contentDescription.
    • New tooltip tag constant added: EDITOR_TOOLBAR_FORMAT_CODE
    • FormatCodeAction now implements tooltip-tag retrieval via override fun retrieveTooltipTag(isReadOnlyContext: Boolean)

Technical Changes

  • EditorActionsMenu.ActionsListAdapter constructor extended with an location: ActionItem.Location parameter and threaded through adapter creation to resolve actions with location-aware context.
  • Tooltip/tag handling unified in the adapter: per-item action context is resolved to compute a final tooltip tag used for long-press tooltips.
  • TooltipTag constants updated:
    • Renamed value for EDITOR_TOOLBAR_EXPAND_SELECTION from "editor.toolbar.expandselection""editor.toolbar.expandselect"
    • Added EDITOR_TOOLBAR_FORMAT_CODE = "editor.toolbar.formatcode"

⚠️ Risks & Best Practices

  • Breaking change: EDITOR_TOOLBAR_EXPAND_SELECTION constant value changed.
    • Any external tooltip definitions, configuration files, or persisted references using the old string will stop matching; update references accordingly.
    • Recommend adding migration notes and searching repository/configs for the old value to update or provide compatibility mappings.
  • Public API change: ActionsListAdapter constructor signature changed (additional parameter). If instantiated externally, update call sites.
  • Suggested follow-ups:
    • Verify all tooltip configuration and localization files use the new constant values.
    • Add automated tests or validations to detect mismatches between tooltip tags and configuration entries.

Walkthrough

Adds tooltip-tag support for the format-code action, updates tooltip constants, and threads action location through editor action adapters to compute and display per-action tooltip tags.

Changes

Cohort / File(s) Summary
Format Code Action
app/src/main/java/com/itsaky/androidide/actions/file/FormatCodeAction.kt
Added override fun retrieveTooltipTag(isReadOnlyContext: Boolean) returning TooltipTag.EDITOR_TOOLBAR_FORMAT_CODE.
Editor Actions Menu / Adapter
editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt
ActionsListAdapter constructor gained location: ActionItem.Location; adapter instantiations threaded with onGetActionLocation(); per-item action resolution in onBindViewHolder derives tooltipTag (falls back to contentDescription) and uses it for long-press tooltip display.
Tooltip Tag Constants
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt
Corrected EDITOR_TOOLBAR_EXPAND_SELECTION value and added EDITOR_TOOLBAR_FORMAT_CODE = "editor.toolbar.formatcode".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • itsaky-adfa
  • Daniel-ADFA

Poem

🐰 A tiny tag hops into view, so spry,
Format code now whispers its reason why,
Menus pass locations, tags find their place,
Tooltips appear with a gentle grace,
Hooray — the editor wears a smiley face! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 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 (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main objective of the changeset: adding tooltip infrastructure and support for code text actions.
Description check ✅ Passed The description is directly related to the changeset, describing the addition of tooltips to code text actions which aligns with the changes made.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into stage

✏️ 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-2351-code-actions-tooltips

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! 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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt`:
- Around line 394-397: The tooltip retrieval currently calls
action?.retrieveTooltipTag(false) with a hardcoded read-only flag; change this
to pass the real editor state by using !editor.isEditable so tooltips reflect
editability—locate the call in EditorActionsMenu.kt (the block using
getInstance().findAction(location, item.itemId) and the tooltipTag variable) and
replace the false literal with the negation of the editor's isEditable property.
🧹 Nitpick comments (2)
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt (1)

19-19: Inconsistent indentation: spaces used instead of tabs.

Line 19 uses spaces for indentation while the surrounding block (lines 10–18) uses tabs. The file already has mixed indentation elsewhere, but new code should ideally match the dominant style in this section (tabs).

Proposed fix
-  const val EDITOR_TOOLBAR_FORMAT_CODE = "editor.toolbar.formatcode"
+	const val EDITOR_TOOLBAR_FORMAT_CODE = "editor.toolbar.formatcode"
editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt (1)

290-290: Minor: extra whitespace before editor.

-        this.list.adapter = ActionsListAdapter(getMenu(),  editor = editor, location = onGetActionLocation())
+        this.list.adapter = ActionsListAdapter(getMenu(), editor = editor, location = onGetActionLocation())

@dara-abijo-adfa dara-abijo-adfa merged commit 90dea94 into stage Feb 13, 2026
2 checks passed
@dara-abijo-adfa dara-abijo-adfa deleted the ADFA-2351-code-actions-tooltips branch February 13, 2026 18:32
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

Comments