Skip to content

fix work tab#13

Merged
arul28 merged 3 commits intomainfrom
ade/fix-work-tab-c51558ad
Feb 24, 2026
Merged

fix work tab#13
arul28 merged 3 commits intomainfrom
ade/fix-work-tab-c51558ad

Conversation

@arul28
Copy link
Copy Markdown
Owner

@arul28 arul28 commented Feb 24, 2026

Summary by CodeRabbit

  • New Features

    • Auto-closing CLI tool terminals when idle
    • Launch panel with quick-access buttons for terminals and chats
    • Session context menus with close, end, resume, and navigation actions
    • Detailed session information popovers displaying metadata and output
    • Session filtering by lane, status, and keywords
    • Tab/grid view toggle for managing sessions
    • Tool-type badges and logos for session identification
  • UI/UX Improvements

    • Reorganized terminal interface with streamlined 2-pane layout
    • Enhanced session cards displaying status, runtime, and exit codes

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 24, 2026

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 8bcc746 and dee88eb.

⛔ Files ignored due to path filters (3)
  • assets/claude.svg is excluded by !**/*.svg
  • assets/codex.svg is excluded by !**/*.svg
  • assets/terminal.svg is excluded by !**/*.svg
📒 Files selected for processing (13)
  • apps/desktop/src/main/services/pty/ptyService.ts
  • apps/desktop/src/renderer/components/lanes/LaneTerminalsPanel.tsx
  • apps/desktop/src/renderer/components/terminals/LaunchPanel.tsx
  • apps/desktop/src/renderer/components/terminals/SessionCard.tsx
  • apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx
  • apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx
  • apps/desktop/src/renderer/components/terminals/SessionListPane.tsx
  • apps/desktop/src/renderer/components/terminals/TerminalSettingsDialog.tsx
  • apps/desktop/src/renderer/components/terminals/TerminalsPage.tsx
  • apps/desktop/src/renderer/components/terminals/ToolLogos.tsx
  • apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx
  • apps/desktop/src/renderer/components/terminals/useSessionDelta.ts
  • apps/desktop/src/renderer/components/terminals/useWorkSessions.ts

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
PTY Service Enhancement
apps/desktop/src/main/services/pty/ptyService.ts
Added per-PTY creation timestamp (createdAt), implemented auto-close mechanism for tool-type PTYs with scheduled 1.5s delayed close on waiting-input state, timer management (clearToolAutoCloseTimer), and cleanup on PTY disposal/close.
Terminal Settings UI Refactoring
apps/desktop/src/renderer/components/lanes/LaneTerminalsPanel.tsx, apps/desktop/src/renderer/components/terminals/TerminalSettingsDialog.tsx
Extracted terminal settings UI from LaneTerminalsPanel (removed 243 lines) into dedicated TerminalSettingsDialog component with profile management, color-coding, persistence, and launch-tracked state handling. Added readLaunchTracked/persistLaunchTracked helpers for localStorage integration.
New Terminal Session UI Components
apps/desktop/src/renderer/components/terminals/SessionCard.tsx, apps/desktop/src/renderer/components/terminals/SessionContextMenu.tsx, apps/desktop/src/renderer/components/terminals/SessionInfoPopover.tsx, apps/desktop/src/renderer/components/terminals/ToolLogos.tsx
Introduced four new components for terminal session display and management: SessionCard renders individual session entries with status and actions; SessionContextMenu provides context-sensitive actions (close/end/resume); SessionInfoPopover displays detailed session metadata and stats; ToolLogos provides tool-specific SVG logo components and selection logic.
Terminal Launch & Session List Management
apps/desktop/src/renderer/components/terminals/LaunchPanel.tsx, apps/desktop/src/renderer/components/terminals/SessionListPane.tsx
Added LaunchPanel for managing terminal lane selection and launching PTYs with profile-specific startup commands. Added SessionListPane to display filtered sessions in running/ended categories with lane/status filtering, search, and integration with LaunchPanel.
Terminal View & Session State Management
apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx, apps/desktop/src/renderer/components/terminals/useWorkSessions.ts, apps/desktop/src/renderer/components/terminals/useSessionDelta.ts
Introduced WorkViewArea component supporting both tab and grid view modes for session display. Added useWorkSessions hook managing session data, filtering (lane/status/search), tabs, selection, and lifecycle actions (launch/resume/close). Added useSessionDelta hook for fetching and caching session delta summary data.
Terminal Page Restructuring
apps/desktop/src/renderer/components/terminals/TerminalsPage.tsx
Refactored page layout from multi-pane legacy structure to simplified 2-pane design using new work-sessions context. Replaced inline session management with SessionListPane and WorkViewArea components. Integrated floating overlays (SessionContextMenu, SessionInfoPopover) and reworked header actions to use work context (closeAllRunning, refresh). Updated tiling layout ID from v2 to v3.

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
Loading
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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes


Note

🎁 Summarized by CodeRabbit Free

Your 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 @coderabbitai help to get the list of available commands and usage tips.

@arul28 arul28 merged commit 7436fd9 into main Feb 24, 2026
1 check passed
@arul28 arul28 deleted the ade/fix-work-tab-c51558ad branch February 24, 2026 08:07
arul28 added a commit that referenced this pull request Apr 14, 2026
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>
arul28 added a commit that referenced this pull request Apr 14, 2026
* 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>
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.

1 participant