Skip to content

fix(jetbrains): open the worktree row popup only for pull requests - #13676

Merged
kirillk merged 1 commit into
mainfrom
plucky-grove
Sep 1, 2026
Merged

fix(jetbrains): open the worktree row popup only for pull requests#13676
kirillk merged 1 commit into
mainfrom
plucky-grove

Conversation

@kirillk

@kirillk kirillk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Issue

Fixes #

Context

Hovering any worktree row in the JetBrains Agent Manager opened the detail balloon. For a row with no
pull request there is no PR chrome to show — the title line is hidden, the state pill is gone, the
review and CI lines are hidden — so the popup degraded to a bare restatement of the N files +A -D
summary already painted on the row, plus an ahead/behind count against the base branch that is noise
for a local scratch worktree. Passing the pointer down a list of local worktrees trailed one of those
for every row.

The popup is the pull request view, so a pull request is now the bar for opening it.

Implementation

AgentManagerPanel.request() previously opened on any signal — a PR, uncommitted files, or committed
files/ahead/behind — and its KDoc argued explicitly that a PR was not the bar. That decision is
reversed: the gate is now val pull = row.pr ?: return null, and the comment states the new rule.

WorktreeRowPopupBody.update takes a non-null WorktreePrDto rather than falling back to
GhReview.NONE / GhChecksDto(), so the compiler is what rules out a popup without a PR instead of a
runtime branch that could drift back. stats and dirty stay nullable — a PR whose stats have not
polled yet still opens.

Nothing else moves: the row's #number pill, review/CI glyphs and changes summary are untouched, as
is the dwell. A PR-less row still starts the dwell and simply resolves to no request when it elapses.

One consequence worth a reviewer's attention: prs is empty whenever gh is missing,
unauthenticated, or rate-limited, so in those states no row gets a popup even when it does have a PR
upstream. That follows from making PR presence the gate.

Screenshots / Video

Before

Screen Shot 2026-09-01 at 9 48 44 AM

After

GIF Recording 2026-09-01 at 9 51 32 AM

How to Test

Manual/local verification

  • ./gradlew typecheck from packages/kilo-jetbrains/ — passes, and proves no other caller passes a null pull to the popup body (agent-executed)
  • ./gradlew test from packages/kilo-jetbrains/ — full frontend + backend suite passes (agent-executed)
  • ./gradlew :frontend:test --tests '*WorktreeRowPopupBodyTest*' — 9 cases pass, including the replaced one (agent-executed)

Reviewer test steps

  1. Run the plugin against a repo with several worktrees, at least one with an open PR and one without
  2. Hover a worktree row that shows a #number pill — the detail popup still opens beside it with title, state, verdicts and both change counts
  3. Hover a worktree row with no #number pill but with local changes — no popup appears, and the row's own N files +A -D summary and its changes-cell tooltip still work
  4. Drag the pointer down the list across PR-less rows — no balloon flashes for them

Blocked checks and substitute verification

  • Panel-level assertion of the gate is not reachable in this test harness: AgentManagerPanel.place needs a root pane and a laid-out list, and under BasePlatformTestCase the panel is never in a window, so place returns null and no balloon opens for any row — which is why the original feature commit (aebd040a80) shipped with no panel test either. Substitute verification is the compile-time non-null contract plus WorktreeRowPopupBodyTest, where the case asserting the old PR-less behaviour was replaced with a PR row carrying ahead/behind and uncommitted counts so the changes-breakout coverage it provided survives.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

The Agent Manager row popup is the pull request view, so a row without one
opened a balloon with no title, no state pill and no verdict lines: just a
restatement of the counts already painted on the row, plus a base-branch
behind-count that means nothing for a local scratch worktree. The pointer
crossing the list trailed one of those for every row it passed.

request() now returns null unless the row has a PR, and
WorktreeRowPopupBody.update takes a non-null one so the compiler, not a
runtime branch, is what rules the empty popup out.
@kilo-code-bot

kilo-code-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/jetbrains-worktree-popup-pr-only.md
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/AgentManagerPanel.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeRowPopupBody.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeRowPopupBodyTest.kt

Reviewed by grok-4.6 · Input: 209.9K · Output: 6.4K · Cached: 343.7K

Review guidance: REVIEW.md from base branch main

@kirillk
kirillk enabled auto-merge September 1, 2026 13:52
@kirillk
kirillk merged commit a79fea7 into main Sep 1, 2026
24 checks passed
@kirillk
kirillk deleted the plucky-grove branch September 1, 2026 14:00
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