Skip to content

fix(jetbrains): replace internal badge-icon APIs in worktree row icons - #13831

Merged
1 commit merged into
mainfrom
fix/jetbrains-internal-badge-icon
Sep 6, 2026
Merged

1 commit merged into
mainfrom
fix/jetbrains-internal-badge-icon

Conversation

@kirillk

@kirillk kirillk commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

verifyPlugin failed the 7.1.6-rc.1 publish run (run) with:

Verification failed with [INTERNAL_API_USAGES] problems.

All 5 usages came from WorktreeIcons.live() (introduced in #13712): com.intellij.ui.BadgeIcon, BadgeDotProvider, and BadgeShapeProvider are @ApiStatus.Internal on the platform version this plugin targets (IU-261) — they were only promoted to stable in a later platform release (confirmed against $INTELLIJ_REPO, commit 99a9aeacba02 "Promote BadgeIcon to stable").

Nothing was published; the run failed before the Marketplace/GitHub Release steps.

Why not just use the public withIconBadge/withLiveIndicator?

Both delegate to the same internal BadgeIcon(icon, color) with the platform's default dot geometry, which is tuned for a 20px stripe icon. On a 16px base the hole overhangs the edge, and HoledIcon reports the icon's size as the union of glyph + hole — so a 16px base would report ~18px and widen the worktree row's icon column for running rows only. That's exactly what the existing custom geometry (x=0.75, y=0.25, radius=0.175, border=0.075) was written to avoid, and what two existing tests assert against.

Fix

Added LiveBadgeIcon (ui/LiveBadgeIcon.kt) — a Kilo-owned Icon following the same house pattern as DotIcon/ActivityIcon/FilledBadgeIcon: plain javax.swing.Icon, antialiased Graphics2D painting, geometry as fractions of the base icon's own size. Reproduces the previous pixels exactly (same fractions, same clip-then-fill approach used by the platform's HoledIcon/BadgeIcon), with zero internal API usage.

WorktreeIcons.live() now returns LiveBadgeIcon instead of the platform's BadgeIcon. Tests updated to target the new type, plus one new paint test verifying the badge actually renders the base glyph and a success-colored, opaque dot (using a synthetic base icon, since real platform icons resolve to a no-op DummyIconImpl under BasePlatformTestCase).

Verification

From packages/kilo-jetbrains/:

  • ./gradlew typecheck — pass
  • ./gradlew test — pass (all suites, including 21/21 in WorktreeIconsTest)
  • ./gradlew verifyPluginthe check that failed publish: INTERNAL_API_USAGES dropped from 5 to 0; result is now Compatible.

verifyPlugin failed the 7.1.6-rc.1 publish with 5 INTERNAL_API_USAGES
violations, all from WorktreeIcons.live(): com.intellij.ui.BadgeIcon,
BadgeDotProvider, and BadgeShapeProvider are @ApiStatus.Internal on the
platform version this plugin targets (IU-261) and were only promoted to
stable in a later platform release.

The public alternatives (IconManager.withIconBadge,
ExecutionUtil.withLiveIndicator) hardcode dot geometry tuned for a 20px
stripe icon, which overhangs a 16px base and would widen the worktree
row's icon column for running rows only -- exactly what the existing
custom geometry was written to avoid.

Add LiveBadgeIcon, a Kilo-owned Icon following the same pattern as
DotIcon/ActivityIcon/FilledBadgeIcon: plain javax.swing.Icon, antialiased
Graphics2D painting, geometry as fractions of the base icon's own size.
Reproduces the exact pixels of the previous implementation with zero
internal API usage. Confirmed via `./gradlew verifyPlugin`: 5 internal
API usages -> 0.
@kilo-code-bot

kilo-code-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeIcons.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/ui/LiveBadgeIcon.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/WorktreeIconsTest.kt

Reviewed by grok-4.6 · Input: 90.1K · Output: 12.6K · Cached: 186K

Review guidance: REVIEW.md from base branch main

@kirillk kirillk closed this pull request by merging all changes into main in 7de8f5b Sep 6, 2026
@kirillk
kirillk deleted the fix/jetbrains-internal-badge-icon branch September 6, 2026 18:21
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