Skip to content

fix(terminal): keep side panels bound after splitting into an empty group - #381

Merged
GOODBOY008 merged 3 commits into
GOODBOY008:mainfrom
sunxiaobin89:fix/split-empty-group-panels
Dec 2, 2026
Merged

GOODBOY008 merged 3 commits into
GOODBOY008:mainfrom
sunxiaobin89:fix/split-empty-group-panels

Conversation

@sunxiaobin89

Copy link
Copy Markdown
Contributor

Summary

Fixes #375. Splitting the terminal activates a brand-new group with no tabs (SPLIT_GROUP), which made activeConnection null and left the file browser / monitor panels blank until the user opened a tab in the new pane.

TerminalGroupProvider now keeps the id of the last tab that owned a real connection and uses it as the activeConnection fallback when the active group is empty. The fallback is resolved against live state, so its status/host/name stay current. Dashboard and local-shell tabs are not tracked, and an actually closed tab yields no fallback.

Test plan

  • npx tsc --noEmit — passes.
  • npx eslint src/lib/terminal-group-context.tsx — 0 errors (only pre-existing type/fast-refresh warnings).
  • npx vitest run src/__tests__/terminal-group-context.property.test.ts src/__tests__/terminal-group-reducer.test.ts — 70 passed.
  • Manually: connect a session, open the right sidebar, split the terminal without opening a tab; the panels keep showing the session. Not run in this environment.

…roup

SPLIT_GROUP activates a new group with no tabs, which made activeConnection null and blanked the file browser and monitor panels. Fall back to the last tab that owned a real connection, resolved against live state so its status stays current. Dashboard and local-shell tabs are not tracked.

Fixes GOODBOY008#375
@GOODBOY008
GOODBOY008 merged commit 8bebef9 into GOODBOY008:main Dec 2, 2026
7 of 8 checks passed
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.

Splitting the terminal leaves the file browser and monitor panels blank

2 participants