Repository navigation
feat(activity): reveal threads in floating terminal workspace - #23239
Conversation
When selecting an activity thread from the floating terminal workspace, automatically open the floating panel if closed. Improves split pane focus handling to preserve active panes during thread reveals.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughFloating-terminal activity threads now bypass workspace activation and reveal the floating panel when it is hidden before tab activation and pane focus. The panel toggle listener binds during the layout-effect phase. Tab-wide terminal focus requests without a leaf identifier now prefer an already-focused matching helper. Tests cover floating-panel visibility, threads without a tab, and deferred focus for null and explicit leaf requests. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Floating-terminal thread activation and split-pane focus behavior are covered by the supplied change context, with no specific regression identified that needs correction before merging. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, solution, implementation areas, and reported verification, but it omits several required template sections and information, including an issue link, visual proof or an explicit N/A reason, testing details and platforms, review notes, the agent-skill boundary declaration, and checklist confirmations. Resolution Complete the required template sections. Add the linked issue, attach before-and-after visual proof or state N/A with a reason, document the test commands and platforms, complete the Review, Agent skill upstream boundary, Notes, and Checklist sections, and include the ELI5 and Why sections.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
ℹ️ No critical issues — one edge-case question inline.
Reviewed changes
- Floating thread routing —
activateThreadTargetnow detectsthread.worktree.id === FLOATING_TERMINAL_WORKTREE_ID, skipsactivateAndRevealWorkspace(no catalog workspace exists for the sentinel), opens the panel viaTOGGLE_FLOATING_TERMINAL_EVENTwhen it is closed, then activates and focuses the thread's tab. - Focus preservation — tab-wide
focusTerminalTabSurface(leafId == null) now prefers an already-focused matching helper before falling back to the first uncovered pane, preventing the panel's deferred tab-wide focus from stealing the pane-specific reveal. - Tests — floating routing (open/closed panel, closed-tab case) plus a happy-dom split-focus test that reproduces the focus race.
I verified the store chain end to end: setActiveTab resolves the owner to the floating workspace and activateTab writes groupsByWorktree[FLOATING][*].activeTabId / activeGroupIdByWorktree[FLOATING], which is exactly what the panel derives its visible tab from. The :focus selector also matches the real renderer's focus recipient (.xterm-helper-textarea), per the repo's e2e focus probes. Tests pass (25/25) and oxlint is clean.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Floating tabs persist even after disabling the feature, but the panel ignores toggle events while disabled. Enable the setting first so that subsequent toggle commands take effect.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Enable-first floating reveal —
revealFloatingWorkspacePanelnow setsfloatingTerminalEnabled: trueand awaitsupdateSettingsbefore deferring the panel toggle by a frame, so a floating activity row is no longer a silent no-op when the feature was disabled. The already-enabled path (toggleFloatingWorkspacePanelIfHidden) is unchanged, and the shape mirrors the existingos-markdown-file-open-bridge.tsenable-then-reveal. - Test coverage — added the disabled-feature case asserting the settings write precedes the deferred
requestAnimationFrametoggle; it would fail against the previous unconditional-dispatch code.
The prior review's concern (the disable path left the click inert) is addressed, and the 2 affected test files pass (13/13).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: d85f1a27-e08b-41d8-a642-477f0c387058
📒 Files selected for processing (2)
src/renderer/src/components/activity/activity-thread-actions.test.tssrc/renderer/src/components/activity/activity-thread-actions.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Enable-then-toggle callers dispatch events immediately, which passive useEffect rebind can miss. useLayoutEffect ensures the handler is bound synchronously before the next paint.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Delta since the prior pullfrog review (a75a0af3 → b6bd6138) — one production file, a binding-timing fix:
- Listener rebind timing —
use-floating-workspace-panel.tsnow binds theTOGGLE_FLOATING_TERMINAL_EVENTlistener inuseLayoutEffectinstead ofuseEffect, so the rebind that capturesenabled === truecompletes at commit rather than after paint. The handler closure capturesenabled, so a passive binding could still hold the stalefalseclosure when the enable-first path's deferredrequestAnimationFrametoggle fires, silently dropping the click. This matches the fix an independent reviewer proposed for the same race.
The two affected test files pass (13/13) at head b6bd6138. Prior feedback (the disabled-feature silent no-op) remains addressed.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Problem
Clicking on activity threads from floating terminal agents didn't work—the panel wasn't revealed and the pane wasn't activated, unlike threads from regular workspaces.
Solution
Added special routing for floating terminal threads in activity actions:
Changes
activity-thread-actions.ts: Routes floating threads to floating-specific activation path using
TOGGLE_FLOATING_TERMINAL_EVENTactivity-thread-actions.test.ts: Added tests for floating thread selection with and without an open panel, and for retained threads whose tabs were closed
focus-terminal-tab-surface.ts: When focusing a tab (not a specific pane), preserves the currently-focused pane instead of resetting focus
focus-terminal-tab-surface.split-focus.test.ts: New test covering deferred focus behavior in split terminals
Verification