feat(ADFA-2351): Add tooltips to code text actions#971
feat(ADFA-2351): Add tooltips to code text actions#971dara-abijo-adfa merged 2 commits intostagefrom
Conversation
📝 WalkthroughRelease NotesFeatures
Technical 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
- ADFA-1383 - debugger toolbar tooltips #854: Adds tooltip-tag metadata and new TooltipTag constants for debugger/editor actions (similar pattern).
- ADFA-2838: Add jetpack compose preview documentation tooltip #960: Introduces tooltip-retrieval behavior for another editor action and expands TooltipTag usage.
- ADFA-2505: Computer vision tooltip #839: Implements per-action tooltip tagging and adds corresponding TooltipTag constants for toolbar actions.
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 | 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
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 beforeeditor.- this.list.adapter = ActionsListAdapter(getMenu(), editor = editor, location = onGetActionLocation()) + this.list.adapter = ActionsListAdapter(getMenu(), editor = editor, location = onGetActionLocation())
Add tooltips to code text actions - Copy, Paste, Select all etc.