fix: buffer split mouse sequences, widen grid buttons, fix [object Object] in tab bar

- Buffer partial escape sequences in stdin handler so split SGR mouse
  events don't leak garbage characters into PTY panes
- Widen pane button hit areas from 1 char to 2-4 chars each; add title
  row click-to-expand; widen tab close/add buttons and pane list targets
- Fix [object Object] rendering in picker tab bar and pane list caused
  by OpenTUI's t`` tag not handling StyledText interpolation; add st()
  helper that concatenates StyledText by merging chunk arrays

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-28 15:29:44 +00:00
parent c722112a7f
commit 1e105cd950
9 changed files with 591 additions and 92 deletions

View File

@@ -19,6 +19,7 @@ import { app } from "./lib/state"
import { updateAll, rebuildDisplayRows, updateUsagePanel, updateColumnHeaders } from "./ui/panels"
import { stdinHandler } from "./input/handlers"
import { resizeGridPanes } from "./grid/view-switch"
import { loadSavedSession, extractSessionState, saveSessionSync } from "./data/session-store"
function refreshMockSessions(projects: Project[]) {
generateMockActiveSessions(projects)
@@ -55,6 +56,9 @@ async function main() {
app.sortedIndices = app.projects.map((_, i) => i)
rebuildDisplayRows()
// Load saved session for restore hint
app.savedSession = await loadSavedSession()
// Save raw stdout.write BEFORE OpenTUI intercepts it
app.rawStdoutWrite = process.stdout.write.bind(process.stdout) as (s: string) => boolean
@@ -64,6 +68,11 @@ async function main() {
useMouse: false,
onDestroy: () => {
app.destroyed = true
// Save session state before cleanup
try {
const state = extractSessionState()
if (state) saveSessionSync(state)
} catch {}
if (app.monitorInterval) { clearInterval(app.monitorInterval); app.monitorInterval = null }
if (app.directGrid) app.directGrid.destroyAll()
stopAllCaptures()