Skip to content

fix work tab - #13

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

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

Conversation

@arul28

@arul28arul28 commented Feb 24, 2026

Copy link
Copy Markdown
Owner

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

coderabbitaiBot commented Feb 24, 2026

Copy link
Copy Markdown
ℹ️ 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 this pull request into mainFeb 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>
arul28 added a commit that referenced this pull request Jul 3, 2026
Fixes remote/sync audit findings #1-#4, #6-#20, plus perf M6, bug-sweep #13, and perf L9.
Skips #5 per disposition because TUI app/component files are owned by concurrent perf work. Implements #6 as the requested partial version/capability validation only.
arul28 added a commit that referenced this pull request Jul 3, 2026
…ss (#696)
* ade code: per-provider Chat/CLI interface choice
Add an Interface: Chat | CLI row to the ADE Code (Ink TUI) new-chat and
/model setup panes, matching the desktop/iOS switcher. Chat creates an
SDK chat via chat.createSession (all providers, including Claude — a new
path); CLI starts a tracked provider CLI terminal via start_cli_session
(claude/codex/cursor/droid/opencode). Defaults to Chat; editable on a
draft, read-only once a session exists.
- Generalize the Claude-only terminal paths: startClaudeTerminalSession
-> provider-generic startCliTerminalSession; listTerminalSessions and
remoteLauncher.isTerminalSessionLaunchable now surface every tracked
CLI provider (not just Claude); terminalSessionToChatSummary, the
Ctrl+T control gates, TerminalPane status ("<PROVIDER> CONTROL"),
FooterControls label, and grid control hint are provider-neutral.
- Submit-path branching: focused terminal -> pty send/resume (Claude
keeps its double-enter, other providers use pty.sendToSession); draft
Interface=CLI -> tracked CLI terminal; otherwise chat.createSession.
- Interface-aware Cursor model gating in the model picker (Chat disables
CLI-only Cursor models and vice versa).
- Keep Claude-only chrome: closed-transcript stripping, naming hint, and
/model + /effort writing into a running Claude terminal.
- Tests: provider-generic start payloads (5 providers), trackedCli
provider resolution, listTerminalSessions/isTerminalSessionLaunchable
inclusivity, interface-row state machine + defaulting, Cursor gating.
- Docs: ADE Code README chat-setup + terminal-control sections.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* ade cli: remote/sync reliability hardening (audit batch)
Fixes remote/sync audit findings #1-#4, #6-#20, plus perf M6, bug-sweep #13, and perf L9.
Skips #5 per disposition because TUI app/component files are owned by concurrent perf work. Implements #6 as the requested partial version/capability validation only.
* ade code: perf — single-pass rows, memoized children, debounced background refresh
Findings:
- H1: derive selectable transcript rows once per render and build copy text lazily.
- H2: reuse pending steers, gate full Chat Info scans, and collapse cheap latest scans.
- H3/M8: memoize hot TUI children and stabilize high-churn props without adding hover throttles.
- H4: debounce/coalesce background session refreshes with an in-flight guard.
- M5: LRU-cache assistant markdown parses by message text.
- M7: tighten terminal grid reads and avoid trailing blank cell/row rendering.
- L10: reconcile local Ink install to locked 7.1.0 and validate ADE CLI.
* ade code: fix tui bug and parity batch
* ade code + sync: review-wave fixups (R1-R5, T1-T2)
* Persist Work Chat/CLI interface choice on iOS (+ desktop verify)
The in-project New Chat screen and the all-projects hub composer both
defaulted the Chat/CLI switcher to .chat on every open, so the choice was
forgotten across app restarts and project switches. Add a shared per-project
store (WorkNewSessionModePreferences, keyed by project id in the app-group
UserDefaults) that mirrors desktop's per-project WorkProjectViewState.draftKind.
- Seed sessionMode from the store in each composer's init (not onAppear) so the
sessionMode onChange never fires to reset runtimeMode to the provider default.
- Persist only on an explicit Chat/CLI switcher tap via a new onUserSelect
callback; programmatic model-availability fallbacks never write the store.
- A stored CLI choice is honored only when the restored model can run in CLI;
otherwise the session opens on chat without discarding the preference.
Desktop already persists this per project (WorkProjectViewState.draftKind in
localStorage ade.workViewState.v1, preserved across new-draft/close-tab/lane-
refresh/project-switch); no desktop change needed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* ade code: interface persistence, closed-session browsing, /secrets, picker digit fix
* Hub composer: reload per-project Chat/CLI mode on project switch
The hub composer seeded sessionMode once in init and never reloaded it when
the destination project changed, so switching from a project saved as Chat to
one saved as CLI (or vice versa) left submit branching on the stale mode.
Centralize the availability-aware fallback in a pure
WorkNewSessionModePreferences.resolvedMode(stored:modelId:provider:) (reused by
both composers' init) and add HubComposerDrawer.reloadSessionMode(forProjectId:)
called wherever pickedProjectId changes — the projectRow tap and the
reconcileDestination fallback. Reload is read-only; explicit switcher taps
remain the only writes, and a stored CLI choice still drops to chat for the
session when the current model can't run in CLI without discarding the pref.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* ade code: quality synthesis — digit-picker fixes, app.tsx extractions, UI polish
* ade code: closed-session glyph — user-initiated closes are not failures
Re-review finding: exit 130/143 and runtimeState 'killed' are the daemon's
user-initiated close classification (ptyService.statusFromExit), so the
closed-session drawer was marking most intentionally closed CLI sessions
with the failed glyph. Only terminalStatus === 'failed' or a genuine
non-{0,130,143} exit code renders failed now.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ade cli: parity with hardening branch
* docs: sync internal docs with ade-code hardening branch
* test: steward pass — prune, consolidate ade-code suite
* ship: iteration 1 — address 10 review comments (greptile P1, codex P1, coderabbit x8)
- remoteBridge + cli.ts transports: normalize JSON-RPC response ids (class sweep)
- connection.ts: unlink stale socket before daemon spawn retry; owner-aware spawn-lock cleanup
- eventBuffer: oversized skipped events mark replay gaps
- syncHostService: queued-message watchdog timeout + warning metadata
- TerminalPane: full-column wide-glyph scan
- displayWidth: splitByDisplayCells single-pass grapheme partition (+ new test file)
- modelState: ollama/lmstudio use OpenCode permission behavior (not Cursor)
- state.ts: final state write flushed + awaited on signal exit
- preload: gap polling no longer fires same-binding project refresh
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ship: iteration 2 — address 2 codex P3s (grid claudeChrome, CJK truncate overflow)
- MultiChatGrid passes claudeChrome by derived terminal provider so non-Claude
grid tiles keep neutral closed-transcript cleanup
- truncateDisplayEnd uses a cluster-boundary-safe prefix so a leading wide
grapheme can no longer overflow the allocated cell width (+ regression tests)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ship: iteration 3 — quote-aware VISUAL/EDITOR parsing (codex P3)
splitEditorCommand now tokenizes with quote/escape support so editors like
'emacsclient -a ""' or app paths with spaces keep working after the
shell:false hardening; quoted empty strings survive as argv entries.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ship: iteration 4 — provider-aware terminal hydrate + local-provider permission cycle (codex P1/P2)
- selecting a non-Claude tracked CLI session now hydrates model state from
terminalSessionProvider instead of forcing claude (footer/model targets the
right provider for subsequent changes and launches)
- cyclePermission + updateChatModel payload route ollama/lmstudio through the
OpenCode permission branch via runtimeProviderForUiProvider (class sweep)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for freeto 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

@arul28