Skip to content

ADFA-3641: Wire per-task tooltips for Gradle tasks#1519

Open
hal-eisen-adfa wants to merge 1 commit into
stagefrom
ADFA-3641-add-tooltips-to-gradle-tasks
Open

ADFA-3641: Wire per-task tooltips for Gradle tasks#1519
hal-eisen-adfa wants to merge 1 commit into
stagefrom
ADFA-3641-add-tooltips-to-gradle-tasks

Conversation

@hal-eisen-adfa

@hal-eisen-adfa hal-eisen-adfa commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Wires per-task tooltips into the Run-Tasks dialog (ADFA-3641). Each Gradle task row now shows its own authored tooltip (Tier-1/2) with a Tier-3 help page, instead of one generic tooltip for every task.

Changes

  • TooltipTag.gradleTaskTooltipTag(path) — pure mapping: ":app:assembleDebug" → "gradle.app:assembleDebug", ":clean" → "gradle.clean". Unit-tested.
  • RunTasksListAdapter — long-press uses the per-task tag instead of PROJECT_GRADLE_TASKS.
  • ToolTipManager.getTooltip — now honors its IDETooltipItem? contract: returns null on a missing tag (its only caller, showTooltip, already null-checks), so tasks without authored content show no popup instead of an "n/a" tooltip. No fallback.
  • idetooltips/build.gradle.kts — adds testImplementation(libs.tests.junit) for the new test.

Content

Tooltip content lives in the source-of-truth documentation.db (loaded separately, not in this repo). 280 Gradle-task tooltips authored + wired.

Verification

  • Unit test GradleTaskTooltipTagTest passes (:idetooltips:testV8DebugUnitTest).
  • End-to-end on emulator (arm64): long-press :buildEnvironment → task-specific tooltip → See more (Tier-2 bullet detail) → Learn more (Tier-3 help page served from the Content table). Uncovered task :artifactTransformsno popup; logcat confirms getTooltip … → No tooltip found → null, no "n/a".

Coverage

Live diff (261 UI tasks vs 282 loaded tags): the 280 covered tasks work; 41 UI tasks are uncovered (the idea Gradle plugin family, plus Gradle/AGP version drift) — all degrade gracefully to no-popup. None are CoGo-specific. Full breakdown posted to ADFA-3641 for the content team.

Notes

  • Spotless can't run inside a git worktree (jgit can't resolve the .git pointer file); pre-commit / CI will apply formatting.

Each task row in the Run-Tasks dialog now shows its own tooltip instead of a
single generic one. The tag is derived from the task path
("gradle." + path.removePrefix(":")), matching the authored content keys
(":app:assembleDebug" -> "gradle.app:assembleDebug", ":clean" -> "gradle.clean").

- TooltipTag.gradleTaskTooltipTag(): pure path->tag mapping (unit-tested).
- RunTasksListAdapter: use the per-task tag instead of PROJECT_GRADLE_TASKS.
- ToolTipManager.getTooltip: honor its nullable contract - return null on a
  missing tag so uncovered tasks show no popup instead of an "n/a" tooltip.
  No fallback.

Tooltip content lives in the SoT documentation.db (loaded separately).
Verified end-to-end on the emulator: per-task Tier-1/2 tooltip + Tier-3 help
page, and graceful no-popup for tasks without authored content.

@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 Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough
  • Added per-task Gradle tooltip mapping and integrated it into the Run-Tasks dialog.
  • Included 280 authored Gradle task tooltips from documentation.db.
  • Updated tooltip lookup to return no popup when no authored tooltip exists.
  • Added JUnit test coverage for Gradle task tag conversion and the required test dependency.
  • Verification covers task-specific tooltips, Tier-3 help pages, and uncovered-task handling.
  • Risk: tooltip tag formatting depends on exact Gradle task-path conventions; unmapped or malformed paths will intentionally show no tooltip.

Walkthrough

Gradle task tooltips now use tags derived from task paths. Tooltip lookup handling constructs results only for successful database queries and returns null for missing or failed lookups. JUnit coverage validates the new tag mappings.

Changes

Tooltip behavior updates

Layer / File(s) Summary
Gradle tooltip tag contract
idetooltips/src/main/java/.../TooltipTag.kt, idetooltips/src/test/.../GradleTaskTooltipTagTest.kt, idetooltips/build.gradle.kts
Adds Gradle task tag generation, JUnit test coverage, and the test dependency required by the module.
Tooltip database lookup
idetooltips/src/main/java/.../ToolTipManager.kt
Refactors database and cursor handling, constructs tooltip items only for single-row results, and returns null for missing or failed lookups.
Task-list tooltip integration
app/src/main/java/.../RunTasksListAdapter.kt
Passes a task-path-derived tooltip tag instead of the static project Gradle tag.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RunTasksListAdapter
  participant TooltipTag
  participant ToolTipManager
  participant SQLiteDatabase
  RunTasksListAdapter->>TooltipTag: gradleTaskTooltipTag(task.path)
  TooltipTag-->>RunTasksListAdapter: path-specific tag
  RunTasksListAdapter->>ToolTipManager: request tooltip with tag
  ToolTipManager->>SQLiteDatabase: query tooltip and buttons
  SQLiteDatabase-->>ToolTipManager: result row or failure
  ToolTipManager-->>RunTasksListAdapter: IDETooltipItem or null
Loading

Possibly related PRs

Suggested reviewers: daniel-adfa, jatezzz, jomen-adfa

Poem

I’m a bunny with tags in my tray,
Guiding each Gradle task on its way.
Lookups now know when to return,
With tidy tests for paths to learn.
Hop, hop—tooltips bloom today!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: wiring per-task tooltips for Gradle tasks.
Description check ✅ Passed The description directly matches the changeset and explains the tooltip mapping, adapter update, null handling, and test dependency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-3641-add-tooltips-to-gradle-tasks

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt (2)

90-93: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use narrow exception handling instead of a generic catch-all.

Based on learnings, in Kotlin files across the AndroidIDE project, prefer narrow exception handling that catches only the specific exception type reported in crashes instead of a broad catch-all, aligning with fail-fast behavior during development.

  • idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt#L90-L93: Replace catch (e: Exception) with a specific exception such as catch (e: SQLiteException).
  • idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt#L134-L140: Replace catch (e: Exception) with a specific exception such as catch (e: SQLiteException).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt`
around lines 90 - 93, Replace the broad catch-all handlers in ToolTipManager’s
version-resolution blocks with narrow SQLiteException handling, preserving the
existing logging and "n/a" fallback. Apply this change at ToolTipManager.kt
lines 90-93 and 134-140; ensure the required SQLiteException import is
available.

Source: Learnings


131-133: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Silence the swallowed exception warning.

The static analysis tool warns about a swallowed exception here. Since this is an expected control-flow path, you can rename the exception parameter to _ to suppress the warning and clarify your intent to ignore it.

♻️ Proposed refactor
-            } catch (e: NoTooltipFoundException) {
+            } catch (_: NoTooltipFoundException) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt`
around lines 131 - 133, Rename the unused exception parameter in the
NoTooltipFoundException catch clause within the tooltip lookup flow to “_”,
preserving the existing logging and null return behavior.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt`:
- Around line 90-93: Replace the broad catch-all handlers in ToolTipManager’s
version-resolution blocks with narrow SQLiteException handling, preserving the
existing logging and "n/a" fallback. Apply this change at ToolTipManager.kt
lines 90-93 and 134-140; ensure the required SQLiteException import is
available.
- Around line 131-133: Rename the unused exception parameter in the
NoTooltipFoundException catch clause within the tooltip lookup flow to “_”,
preserving the existing logging and null return behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be0e7ba3-0119-413b-8720-a86c3d9d107d

📥 Commits

Reviewing files that changed from the base of the PR and between 8e33ec6 and 422ed9f.

📒 Files selected for processing (5)
  • app/src/main/java/com/itsaky/androidide/adapters/RunTasksListAdapter.kt
  • idetooltips/build.gradle.kts
  • idetooltips/src/main/java/com/itsaky/androidide/idetooltips/ToolTipManager.kt
  • idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt
  • idetooltips/src/test/java/com/itsaky/androidide/idetooltips/GradleTaskTooltipTagTest.kt

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