Conversation
Implement public APIs on TabbedTerminalState for programmatic split pane management (splitVertical, splitHorizontal, closeFocusedPane, navigation) and reactive state observation (tabsFlow, activeTabIndexFlow, TerminalTabInfo). Update tabbed-example with interactive API Demo panel showcasing all new APIs: split controls, live pane state display, directional navigation, and a reactive status bar that updates in real-time. Generated with [Claude Code](https://claude.com/claude-code)
Code Review: T6 Split Pane & T7 Reactive State Plugin APIsOverall this is a well-structured addition with good documentation. The reactive state bridging pattern (snapshot state → StateFlow) is the right approach for exposing Compose state to non-Compose consumers. A few issues worth addressing before merge: Issues1.
|
- Replace fragile newSessionRef circular capture in performSplit() with post-creation onProcessExit assignment that captures newSession directly - Decouple ViewSwitcherBar by passing StateFlow params instead of whole TabbedTerminalState for better testability and reuse - Add @immutable annotation to TerminalTabInfo for Compose recomposition optimization Generated with [Claude Code](https://claude.com/claude-code)
PR Review: T6 Split Pane & T7 Reactive State plugin APIsOverall this is a solid addition — the API surface is clean, documentation is thorough, and the demo panel does a good job exercising the new APIs. A few issues worth addressing before merging. Bug (High): Coroutine scope leak in
|
| Severity | Issue |
|---|---|
| High | Coroutine scope leak when initialize() called multiple times |
| Medium | closeFocusedPane() does nothing on never-split tabs |
| Medium | Silent onProcessExit skip if session isn't a TerminalTab |
| Low | settingsFlow couples directly to singleton internals |
| Low | resolveTabId() is an unnecessary helper |
| Minor | paneCount = 0 vs ≥ 1 semantic inconsistency |
The coroutine leak and closeFocusedPane() behavior are the ones most likely to surface as runtime bugs. The rest are polish/robustness items.
🤖 Generated with Claude Code
…rmSplit - closeFocusedPane() now correctly closes the tab when no split state exists (tab was never split), matching its documented contract - performSplit() uses a checked cast with error() instead of silent safe-cast, surfacing unexpected TerminalSession implementations at development time rather than producing zombie panes Generated with [Claude Code](https://claude.com/claude-code)
PR Review: T6 Split Pane & T7 Reactive State Plugin APIsOverall this is a solid addition — the public API surface is clean, KDoc is thorough, and the demo panel gives a good visual walkthrough. A few issues worth addressing before merge. Bugs1.
|
Update docs/tabbed-terminal.md, wiki API Reference, Tabbed Terminal Guide, and Features page with: - Split Pane API (T6): splitVertical, splitHorizontal, closeFocusedPane, navigatePaneFocus, getPaneCount, writeToFocusedPane, etc. - Reactive State API (T7): tabsFlow, activeTabIndexFlow, settingsFlow, TerminalTabInfo data class, NavigationDirection enum - Code examples for reactive status bars and programmatic split control - Updated tabbed-example description with API Demo view Generated with [Claude Code](https://claude.com/claude-code)
PR Review: T6 Split Pane & T7 Reactive State Plugin APIsOverall this is a well-structured addition — the API surface is clean, the KDoc is thorough, and the demo panel does a good job exercising the new functionality. A few issues worth addressing before merge: Critical: Coroutine scope leak in
|
| Severity | Issue |
|---|---|
| Critical | flowScope not cancelled before re-initialisation |
| Bug | error() crash in performSplit() — should return null |
| Bug | Non-reactive pane state reads in PluginApiDemoPanel |
| Design | getOrCreateSplitState duplicates composable logic |
| Design | settingsFlow exposes internal singleton |
| API | getSplitSessionIds / hasSplitPanes inconsistency |
| Docs | getFocusedSplitSession undocumented; nav methods missing from guide table |
The critical and bug items should be fixed before merge. The rest are good-to-address but lower priority.
- Add missing getFocusedSplitSession, navigateToNextPane, navigateToPreviousPane, hasSplitPanes, getSplitSessionIds to wiki Tabbed-Terminal-Guide method table - Add getFocusedSplitSession to wiki API-Reference and tabbed-terminal.md - Fix CWD text overflow in ReactiveStatusBar with maxLines/ellipsis Generated with [Claude Code](https://claude.com/claude-code)
PR Review: T6 Split Pane & T7 Reactive State Plugin APIsOverall this is a solid, well-documented addition. The API surface is clean, the Bugs / Correctness1. In // Current code - old scope is leaked if initialize() is called twice
flowScope = CoroutineScope(SupervisorJob() + Dispatchers.Main).also { scope -> ... }If flowScope?.cancel()
flowScope = CoroutineScope(SupervisorJob() + Dispatchers.Main).also { scope -> ... }2. val newTab = newSession as? TerminalTab
?: error("createSessionForSplit returned <type>, expected TerminalTab")
3. Pane state reads in val paneCount = terminalState.getPaneCount()
val hasSplits = terminalState.hasSplitPanes()
val sessionIds = terminalState.getSplitSessionIds()These read val activeTab = tabs.getOrNull(activeTabIndex)
val paneCount = activeTab?.paneCount ?: 0Design / Maintenance4. Duplicated
5. val settingsFlow: StateFlow<TerminalSettings> get() = SettingsManager.instance.settingsThis directly forwards an internal singleton through the public API. Consumers cannot substitute a different Thread Safety6. Split API methods have no thread-safety documentation
Minor
Summary
The T6/T7 feature set is well-thought-out and the bridging of Compose snapshot state to Generated with Claude Code |
Summary
TabbedTerminalStatefor programmatic split pane management —splitVertical(),splitHorizontal(),closeFocusedPane(),navigatePaneFocus(direction),navigateToNextPane(),navigateToPreviousPane(),getPaneCount(),hasSplitPanes(),getSplitSessionIds(),writeToFocusedPane()tabsFlowandactiveTabIndexFlowStateFlows onTabbedTerminalState, plusTerminalTabInfodata class with tab id, title, connection state, working directory, and pane countTest plan
./gradlew :tabbed-example:runand switch to "API Demo" view🤖 Generated with Claude Code