Skip to content

feat(jetbrains): improve worktree session UX - #13521

Merged
kirillk merged 4 commits into
mainfrom
sturdy-reef
Aug 27, 2026
Merged

feat(jetbrains): improve worktree session UX#13521
kirillk merged 4 commits into
mainfrom
sturdy-reef

Conversation

@kirillk

@kirillk kirillk commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue; requested directly by a maintainer.

Context

This PR improves the JetBrains Agent Manager and session empty states so worktree workflows are easier to discover and use. Users now get clearer create actions, branch/worktree-aware empty-session guidance, and a collapsible worktree session list for focused editing.

Features

  • Label the tool-window create actions as + Session and + Worktree so the toolbar actions are discoverable without relying on icon-only controls.
  • Add compact light/dark JetBrains SVG plus icons for the labeled create actions and keep a separator before History.
  • Show branch-aware empty-session copy that tells users when they are working directly on a branch.
  • Add an inline run it in a worktree link in the branch empty state, wired to the existing New Worktree flow.
  • Show worktree-aware empty-session copy that confirms an isolated worktree keeps the main checkout untouched.
  • Feed branch/worktree status into empty session panels even when a worktree editor tab does not render the branch dock.
  • Add a toggle for the worktree session list so Agent Manager worktree tabs can hide or show the session list.
  • Persist the worktree session list visibility per worktree through the worktree RPC layer.
  • Add localized strings for the new empty-state copy across the existing JetBrains locale bundles.

Fixes

  • Reword the German worktree empty-state hint from Arbeiten Sie frei to a neutral phrasing that avoids harsh historical connotations.
  • Avoid fetching branch details for read-only session surfaces that cannot launch a worktree flow.
  • Keep worktree editor layout stable when the session list is hidden or restored.
  • Cover apostrophe escaping in localized MessageFormat strings so parameterized branch/worktree copy formats correctly.

Tests

  • ./gradlew :frontend:test --tests '*NewSessionActionTest*' --tests '*NewWorktreeActionTest*'
  • ./gradlew :frontend:test --tests '*EmptySessionPanelTest*' --tests '*KiloBundleLocaleTest*'
  • ./gradlew :frontend:test --tests '*WorktreeSessionEditorPanelTest*' --tests '*WorktreeSessionListToggleTest*' --tests '*WorktreeSessionListVisibilityTest*' --tests '*WorktreeActivityTest*'
  • ./gradlew :backend:test --tests '*KiloWorktreeRpcApiImplTest*'
  • ./gradlew typecheck
  • ./gradlew :frontend:test

Reviewer Notes

  • Screenshots/video were not captured in this agent environment; this PR includes visual changes and should get a quick manual UI pass.
  • SessionUi.refreshBranch() now runs on surfaces without a branch dock so worktree editor tabs can show the isolation tip. The backend result is already TTL-cached, and read-only surfaces return before fetching.
  • The inline link uses JBLabel.setCopyable(true) and an overridden hyperlink listener, so wrapping and link styling come from IntelliJ's standard HTML label path.

Reviewer Test Steps

  1. Launch the JetBrains plugin in a sandbox IDE.
  2. Open the Kilo tool window on the Chat tab and confirm the title action reads + Session with a separator before History.
  3. Switch to the Agents tab and confirm the title action reads + Worktree with the same compact plus icon.
  4. Open an empty chat session on a normal branch and confirm the copy says you are working directly on that branch and the phrase run it in a worktree is an inline link.
  5. Click run it in a worktree and confirm the New Worktree flow opens.
  6. Open an empty session inside a worktree and confirm the copy says it is an isolated worktree and does not show a worktree-creation link.
  7. Open an Agent Manager worktree session tab, hide and restore the session list, then reopen the tab and confirm the visibility setting persists.
  8. Switch IDE themes and confirm the compact plus icon, inline link, and session-list toggle remain visible.

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

Maintainer-requested change; no Discord handle provided.

Show a branch-aware tip under the logo on the empty session screen. On a
plain checkout it nudges toward running the task in a worktree, with
"run it in a worktree" as an inline link that opens the New Worktree
flow. In a worktree it confirms the work is isolated instead.

The tip falls back to the generic welcome whenever a claim would be
wrong: before branch status resolves, when git is missing, and on a
detached HEAD. Read-only surfaces show no tip and skip the fetch.

Branch status now feeds the empty panel as well as the branch dock, so
worktree editor tabs get it too even though they render no dock.

Translate the new strings into all 18 locales. The tip keys carry
placeholders and therefore go through MessageFormat, where a lone
apostrophe silently swallows surrounding text, so KiloBundleLocaleTest
formats every locale for real and checks apostrophe escaping.
@kilo-code-bot

kilo-code-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (16 files)
  • .changeset/jetbrains-worktree-session-list-toggle.md
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloWorktreeRpcApiImpl.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/rpc/KiloWorktreeRpcApiImplTest.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/KiloWorktreeService.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeActivity.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeSessionEditorPanel.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeSessionListToggle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeSessionListVisibility.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/plugin/KiloPluginSettings.kt
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_de.properties
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeActivityTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeSessionEditorPanelTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeSessionListToggleTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/worktree/WorktreeSessionListVisibilityTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/testing/FakeWorktreeRpcApi.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloWorktreeRpcApi.kt
Previous Review Summary (commit a453e2d)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit a453e2d)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (36 files)
  • .changeset/jetbrains-empty-session-worktree-tip.md
  • .changeset/jetbrains-toolwindow-create-buttons.md
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/KiloToolWindowFactory.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/actions/KiloActionIcons.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/actions/NewSessionAction.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/actions/NewWorktreeAction.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionHost.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionManager.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/empty/EmptySessionPanel.kt
  • packages/kilo-jetbrains/frontend/src/main/resources/icons/add-small.svg
  • packages/kilo-jetbrains/frontend/src/main/resources/icons/add-small_dark.svg
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ar.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_bs.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_da.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_de.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_es.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_fr.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ja.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ko.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_nl.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_no.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_pl.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_pt_BR.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ru.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_th.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_tr.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_uk.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_zh_CN.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_zh_TW.properties
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/actions/NewSessionActionTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/actions/NewWorktreeActionTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/plugin/KiloBundleLocaleTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/EmptySessionPanelTest.kt

Reviewed by grok-4.6 · Input: 377.1K · Output: 26.3K · Cached: 1.9M

Review guidance: REVIEW.md from base branch main

Add a toggle left of the worktree editor toolbar that shows or hides the
session list. The choice is persisted per worktree through the backend
instead of a single global property, so each worktree reopens the way the
user left it. While the list is hidden the toggle carries the session
count, or the activity icon of a background session that needs the user,
so a pending question stays visible when collapsed.

Give the toolbar strip standard horizontal-toolbar padding on its left,
top and bottom, keeping the right edge flush so the divider still sits
against the header content, and separate the toggle from the toolbar
actions with a vertical separator. The toggle is centred at its own
height rather than tracking the strip, so its hover box matches a regular
toolbar button instead of running edge to edge.
'Arbeiten Sie frei' reads as a harsh historical imperative in German.
Use a neutral phrasing that conveys the actual intent: it is safe to
experiment because the main checkout stays untouched.
@kirillk kirillk changed the title feat(jetbrains): improve worktree empty states feat(jetbrains): improve worktree session UX Aug 27, 2026
@kirillk
kirillk merged commit a1c57ff into main Aug 27, 2026
24 checks passed
@kirillk
kirillk deleted the sturdy-reef branch August 27, 2026 22:03
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.

3 participants