Skip to content

feat: client-side triage queue and PTY resize#1

Open
dpmishler wants to merge 1 commit intomasterfrom
feat/queue-and-resize
Open

feat: client-side triage queue and PTY resize#1
dpmishler wants to merge 1 commit intomasterfrom
feat/queue-and-resize

Conversation

@dpmishler
Copy link
Contributor

Summary

  • Add #/queue view with client-side session triage — detects prompts, errors, and idle-after-activity-burst (for TUIs like Claude Code)
  • Add resize JSON-RPC method so web terminal auto-sizes the PTY to match browser viewport
  • Fix session_created race condition where new sessions appeared without terminal content

New files

  • web/src/queue/detector.ts — QueueDetector with three detection strategies
  • web/src/components/QueueCard.tsx — card with live terminal + action bar
  • web/src/components/CardStack.tsx — stacked card layout
  • web/src/components/QueueView.tsx — top-level queue page

Test plan

  • Open web UI, create multiple sessions, verify terminals resize to fill viewport
  • Navigate to #/queue, verify empty state "All clear"
  • Run read -p "Continue? [y/n] " answer in a session — verify prompt card appears
  • Run a failing command — verify error card appears
  • Let a shell sit idle 5s — verify idle card appears
  • Dismiss cards and verify they can re-trigger on next change
  • Verify TUIs (vim, top) don't create false idle cards

🤖 Generated with Claude Code

Add a queue view (#/queue) that watches wsh sessions and surfaces ones
needing human attention as a card stack. Detection is entirely
client-side via three heuristics: prompt patterns, error/red text, and
idle-after-activity-burst (for TUIs like Claude Code).

Also add a `resize` JSON-RPC method so the web terminal can resize the
PTY to match the browser viewport, fixing the issue where terminal
output only filled half the screen.

New files:
- web/src/queue/detector.ts (QueueDetector class)
- web/src/components/QueueCard.tsx
- web/src/components/CardStack.tsx
- web/src/components/QueueView.tsx

Key changes:
- Hash-based routing in main.tsx (#/queue vs default)
- Queue link icon in StatusBar
- ResizeObserver in Terminal sends resize to server
- resize method added to WshClient and ws_methods.rs
- Fix session_created race condition in app.tsx

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