-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Background
PR #8 attempted this refactor but went stale (242 commits behind main). Closing it and reimplementing from scratch.
Problem
The Tab type currently carries terminal lifecycle fields (terminalId, status, mode, shell, resumeSessionId, codingCliSessionId, lastInputAt, etc.) that conceptually belong to the pane system. This creates a dual-update problem where both tab and pane state must be kept in sync, leading to bugs and complexity.
Proposed Changes
Slim the Tab interface down to {id, title, createdAt, titleSetByUser?} and move all terminal/session state into pane content nodes. Key pieces:
- Slim
Tabtype: Remove ~12 fields from theTabinterface - Atomic tab+pane creation:
createTabWithPanethunk to prevent orphaned state - Centralized cleanup:
closeTabWithCleanupthunk for detach/kill on tab close - Pane title tracking:
paneTitles+paneTitleSetByUsermaps in panes slice, so user renames aren't clobbered by auto-titles SessionPaneContenttype: First-class pane content for coding CLI sessions (currently handled via tab fields)buildDefaultPaneContent()helper: Extract default pane logic fromTabContentinto a shared utility- Pane activity cleanup middleware: Clean up terminal activity tracking when panes are removed/swapped
- Update all consumers: Sidebar, TabBar, ContextMenuProvider, OverviewView, BackgroundSessions, etc. to read from pane layouts instead of tab fields
- Persistence migration: Bump schema version, migrate cleanly
Reference
The closed PR #8 contains a complete (if stale) implementation that can serve as a reference for the reimplementation.
Notes
- Break into smaller, reviewable PRs if possible
- Ensure pane-based title derivation preserves exit code display (was lost in Refactor pane-based tabs and stabilize tests #8)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels