Skip to content

feat(desktop/terminal): connect-phase UX and SSH split-duplicate (#319)#341

Merged
physercoe merged 1 commit into
physercoe:mainfrom
agentfleets:desktop/319-terminal-tail
Jul 20, 2026
Merged

feat(desktop/terminal): connect-phase UX and SSH split-duplicate (#319)#341
physercoe merged 1 commit into
physercoe:mainfrom
agentfleets:desktop/319-terminal-tail

Conversation

@agentfleets

Copy link
Copy Markdown
Collaborator

Closes #319

The remaining tail of the terminal-lifecycle issue: connecting-phase indication with cancel/timeout, and split-duplicate for SSH sessions.

What

  • Connecting phases + cancel + timeout (desktop/src/terminal/ConnectForm.tsx, desktop/src-tauri/src/ssh.rs): ssh_connect now emits ssh-connect-progress ticks at each handshake stage (tcp → auth → channel), tagged with a frontend-minted connect_id (same pattern as the SFTP transfer_id). The connect button label follows the live phase; a Cancel button abandons the attempt; a 20 s ceiling (CONNECT_TIMEOUT_MS) abandons stuck handshakes with a timeout error. An abandoned attempt that connects late has its orphaned session closed (sshClose) instead of leaking a shell nobody renders. The form's close-Cancel is replaced by the attempt-Cancel while busy, so there is always exactly one Cancel button.
  • Split-duplicate an SSH session (desktop/src/terminal/TerminalPanel.tsx, ssh.rs): new ssh_duplicate command opens a second interactive shell channel on the existing connection's shared russh Handle — no re-authentication, works for ad-hoc and key-auth tabs alike. Splitting with an SSH tab active duplicates it into the new tile; local tabs keep spawning a fresh local shell. The actor-spawn tail of ssh_connect was extracted into spawn_shell_session, shared verbatim by both commands. The shared-orientation split model is kept — no nested split tree.

Why

  • A hanging handshake looked frozen: no phase, no cancel, no timeout (issue item 2).
  • Split always spawned a new local shell even from SSH tabs (issue item 8).

How verified

  • cd desktop && npm run build (sync:tokens + tsc --noEmit + vite build) — green.
  • bash scripts/lint-desktop-tokens.sh — clean (86 off-token, all ≤ baseline, no phantom tokens; no CSS touched).
  • git diff origin/main --stat — only the 6 intended files.
  • Rust changes are CI-verified only (no local toolchain). Kept minimal: the extracted actor loop is byte-identical to the previously-compiling ssh_connect tail, and the one newly-named type (russh::Channel<client::Msg>) was checked against the russh 0.62.0 crate sources (Handle::channel_open_session returns exactly that).

i18n: term.phaseTcp / term.phaseAuth / term.phaseChannel / term.connectTimeout added in both en and zh; no other user-visible strings.

@physercoe physercoe left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE. Connect-phase UX + SSH split-duplicate implemented cleanly. ssh_duplicate reuses the shared connection Arc<Handle> (no re-auth), per-attempt filtering guards stale phase ticks, all new strings have en+zh. Verified no conflict with the ConPTY windowsPty fix on main. Nit (non-blocking): the phase listener is not unlisten()ed on the cancel/timeout paths, so a truly-hung sshConnect invoke would leak a listener — harmless given per-attempt filtering.

@physercoe
physercoe merged commit 6ac04cd into physercoe:main Jul 20, 2026
6 checks passed
physercoe pushed a commit that referenced this pull request Jul 20, 2026
…ic-tail merges

Since v0.3.79:
- fix(terminal): tell xterm the pty is ConPTY on Windows so a repainting TUI's
  intermediate frames no longer pile up in the scrollback (2b26a16).
- 8 epic-tail PRs merged: #341 terminal connect-phase + SSH split-duplicate,
  #342 PDF struct-tree a11y + annotation shortcuts, #343 token burn-down /
  plural / responsive, #344 PDF fit-page / rotation / hand-pan / ink,
  #345 perf (page memo, debounce, chart cap, sync dirty-tracking),
  #346 modal migration + dirty-close guards, #347 vault TOTP / ed25519 /
  coded errors, #348 read reconcile / AuthorNav / table nav / frame check.

Co-Authored-By: Claude Opus 4.8 <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.

feat(desktop): terminal lifecycle & power features — reconnect UX, scrollback, context menu, web links, find bar

2 participants