Conversation
…ade/fix-work-tab-c51558ad
ℹ️ Recent review infoConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Free ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThis pull request introduces comprehensive terminal session management enhancements. It adds auto-close functionality for tool-type PTYs with timestamp tracking in ptyService.ts, extracts terminal settings UI into a dedicated component, introduces multiple new UI components for session display and management (SessionCard, SessionContextMenu, SessionInfoPopover, SessionListPane, WorkViewArea, LaunchPanel, ToolLogos), refactors TerminalsPage with new work-session-centric state management via useWorkSessions hook, and adds useSessionDelta for session delta data fetching. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant UI as Terminal UI
participant PTY as PTY Service
participant Timer as Auto-Close Timer
User->>UI: Launch terminal with tool profile
UI->>PTY: create(laneId, toolType, command)
PTY->>PTY: Record createdAt timestamp
PTY->>UI: Return PTY instance
loop While PTY Running
User->>PTY: Interact with terminal
PTY->>UI: Emit data/status events
UI->>UI: Update session state
end
User->>PTY: Exit or stop command
PTY->>PTY: Check: waiting-input state + tool type + age > 5s?
alt Tool Auto-Close Conditions Met
PTY->>Timer: Schedule 1.5s auto-close
PTY->>UI: Log info event
Timer->>Timer: Wait 1.5s
Timer->>PTY: Kill PTY
PTY->>UI: Session ended
else Manual Close Path
PTY->>UI: Session ended (manual/resumed)
end
PTY->>Timer: Clear timer on dispose
sequenceDiagram
participant User as User
participant Page as TerminalsPage
participant Hook as useWorkSessions
participant API as IPC/Backend API
participant Store as App Store
User->>Page: View terminals page
Page->>Hook: useWorkSessions()
Hook->>API: Fetch terminal sessions
API->>Hook: Return TerminalSessionSummary[]
Hook->>Store: Get lanes, selectedLaneId
Hook->>Hook: Apply filters (lane/status/search)
Hook->>Page: Return sessions, filters, actions
Page->>Page: Render SessionListPane + WorkViewArea
Page->>Page: Render SessionContextMenu overlay
Page->>Page: Render SessionInfoPopover overlay
User->>Page: Click launch PTY
Page->>Hook: onLaunchPty(laneId, profile)
Hook->>API: pty.create(laneId, toolType, command, tracked)
API->>API: Create PTY (with auto-close)
Hook->>Hook: Update session list, refresh
User->>Page: Select session context menu action
Page->>Hook: onCloseSession/onResume/onEndChat
Hook->>API: Execute action (closePty/resume/endChat)
Hook->>Hook: Refresh sessions
Page->>Page: Re-render with updated state
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Part A — fix 22 branch-introduced test failures: - TerminalView: add DEFAULT_TERMINAL_FONT_FAMILY to appStore mock + fontFamily to terminalPreferences (8 tests) - AgentChatMessageList: update bubble max-w assertion to match widened responsive class (1 test) - appStore: include fontFamily in terminalPreferences expectations; switch persistence assertions to unified store (2 tests) - CtoSettingsPanel: navigate to correct sub-tab in 4 tests, drop 3 tests for removed UI (Configured/Needs work badges, CTO runtime header), update tag/button assertions (11 tests) Part B — apply 5 low-risk optimizations from docs/OPTIMIZATION_OPPORTUNITIES.md: - #2 Pause renderer watchdog when tab hidden (main.tsx): start/stop the 1s event-loop-stall interval based on document.visibilityState. - #10 Combine warmup timers (appStore.ts): merge warmLaneStatusTimer + warmProviderModeTimer into a single warmupTimer firing both refreshes after max(1200, 1800) ms. - #13 Hoist inline config objects (IntegrationTab.tsx): OutcomeDot config moved to module-scope OUTCOME_DOT_CONFIG. AppShell was already module-scoped. - #19 Atomic UserPreferences store (appStore.ts): theme / terminalPreferences / smartTooltipsEnabled now persist as one ade.userPreferences.v1 JSON; legacy per-key reads kept as one-time migration. - #20 Compact JSON for machine files: preload.ts audited — no pretty-printed JSON.stringify remained, no-op for this pass. Doc: append "## Applied" section to docs/OPTIMIZATION_OPPORTUNITIES.md describing the five changes. Verified: typecheck clean; all 8 vitest shards pass; npm run build succeeded. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Improve Tasks and Subagents panel typography and sizing Bump text sizes across BottomDrawerSection, ChatTasksPanel, ChatSubagentsPanel, and ChatSubagentStrip to be more readable (e.g. 9px→11px, 10px→12px, 11px→13px). Switch labels, descriptions, and buttons from font-mono to the system sans font, keeping monospace only where it belongs (timestamps, task IDs, tool names, status badges). Slightly increase icon sizes and padding for better visual weight. * Widen assistant message cards on large screens Change max-width from 78ch to min(96ch, 75%) so messages use more horizontal space on wide displays while still staying readable and not stretching edge-to-edge. * Fix drifted tests and apply safe renderer optimizations Part A — fix 22 branch-introduced test failures: - TerminalView: add DEFAULT_TERMINAL_FONT_FAMILY to appStore mock + fontFamily to terminalPreferences (8 tests) - AgentChatMessageList: update bubble max-w assertion to match widened responsive class (1 test) - appStore: include fontFamily in terminalPreferences expectations; switch persistence assertions to unified store (2 tests) - CtoSettingsPanel: navigate to correct sub-tab in 4 tests, drop 3 tests for removed UI (Configured/Needs work badges, CTO runtime header), update tag/button assertions (11 tests) Part B — apply 5 low-risk optimizations from docs/OPTIMIZATION_OPPORTUNITIES.md: - #2 Pause renderer watchdog when tab hidden (main.tsx): start/stop the 1s event-loop-stall interval based on document.visibilityState. - #10 Combine warmup timers (appStore.ts): merge warmLaneStatusTimer + warmProviderModeTimer into a single warmupTimer firing both refreshes after max(1200, 1800) ms. - #13 Hoist inline config objects (IntegrationTab.tsx): OutcomeDot config moved to module-scope OUTCOME_DOT_CONFIG. AppShell was already module-scoped. - #19 Atomic UserPreferences store (appStore.ts): theme / terminalPreferences / smartTooltipsEnabled now persist as one ade.userPreferences.v1 JSON; legacy per-key reads kept as one-time migration. - #20 Compact JSON for machine files: preload.ts audited — no pretty-printed JSON.stringify remained, no-op for this pass. Doc: append "## Applied" section to docs/OPTIMIZATION_OPPORTUNITIES.md describing the five changes. Verified: typecheck clean; all 8 vitest shards pass; npm run build succeeded. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary by CodeRabbit
New Features
UI/UX Improvements