Skip to content

feat(web): show docker container for active SSH session#49

Merged
skulidropek merged 2 commits intoProverCoderAI:mainfrom
skulidropek:issue-47
Feb 16, 2026
Merged

feat(web): show docker container for active SSH session#49
skulidropek merged 2 commits intoProverCoderAI:mainfrom
skulidropek:issue-47

Conversation

@skulidropek
Copy link
Copy Markdown
Contributor

@skulidropek skulidropek commented Feb 16, 2026

Summary

  • add containerName to live terminal session registry payload
  • keep API schema/types backward-compatible with optional containerName
  • show connected container in web UI header/topbar and terminal sessions list

Fixes #47

Proof (logic works)

Repro steps used locally:

cat > /tmp/docker-git-terminal-sessions.json <<'JSON'
{
  "updatedAt": "2026-02-16T15:00:00.000Z",
  "sessions": [
    {
      "id": "proof-session-1",
      "projectId": "/home/dev/.docker-git/org/repo/issue-47",
      "displayName": "org/repo",
      "containerName": "dg-repo-issue-47",
      "mode": "default",
      "source": "web",
      "status": "connected",
      "connectedAt": "2026-02-16T15:00:00.000Z",
      "updatedAt": "2026-02-16T15:00:01.000Z"
    }
  ]
}
JSON

pnpm --filter ./packages/web exec next dev
curl -sS http://localhost:3000/api/terminal-sessions

Observed response fragment:

{
  "sessions": [
    {
      "id": "proof-session-1",
      "containerName": "dg-repo-issue-47",
      "status": "connected"
    }
  ]
}

This is the same field that is rendered in UI:

  • status chip: Connected SSH · dg-repo-issue-47
  • session row tail: web · default · dg-repo-issue-47

Validation

  • pnpm --filter ./packages/web lint

Automated tests

  • tests/api/terminal-sessions-route.test.ts
    • checks /api/terminal-sessions returns containerName
    • checks fallback { "sessions": [] } when file is missing
  • tests/lib/api-schema-terminal-sessions.test.ts
    • checks schema decode with containerName
    • checks backward compatibility when containerName is absent

Run:

pnpm --filter ./packages/web test

Stop/Delete safety (SSH active usage)

  • Stop container list now shows: running/stopped and ssh=<count> per project
  • Delete project details now show current SSH session count and warning when count > 0
  • Stop container now requires extra confirmation if SSH sessions are active (count > 0)

Example fragment in selector:

> 1. org/repo (PR#47) [running, ssh=2]

@skulidropek skulidropek merged commit 4fa96bb into ProverCoderAI:main Feb 16, 2026
10 checks passed
@skulidropek
Copy link
Copy Markdown
Contributor Author

Update for issues #33 and #3 (same PR branch issue-47), commit abde103.

What is implemented

#33 — Choose MCP Playwright on Select -> Connect

  • In Select project (Connect) mode, added toggle by key P.
  • Hint now explicitly shows current mode:
    • Enter = select + SSH, P = toggle Playwright MCP (on/off), Esc = back
  • Connect details panel now shows what will happen before SSH:
    • Playwright MCP: will be enabled before SSH (P to disable).
    • or Playwright MCP: keep current project setting (P to enable before SSH).
  • If toggle is ON, flow is now:
    1. enable Playwright MCP for selected project
    2. then connect via SSH

#3 — Cursor visible in SSH terminal

  • Before any interactive SSH handoff, cursor visibility is restored via terminal escape (\u001B[?25h).
  • Applied to both paths:
    • menu Select -> Connect
    • auto-open SSH after create/clone

Proof fragments (visible behavior)

  • Connect hint fragment in TUI:
    Enter = select + SSH, P = toggle Playwright MCP (on), Esc = back
    
  • Connect details fragment in TUI:
    Playwright MCP: will be enabled before SSH (P to disable).
    

Automated tests

Added:

  • packages/app/tests/docker-git/menu-select-connect.test.ts
    • verifies ON mode runs enable before connect
    • verifies OFF mode skips enable
    • verifies toggle input parsing (P)
    • verifies hint shows ON/OFF state
  • packages/lib/tests/usecases/terminal-cursor.test.ts
    • verifies show-cursor escape is emitted in interactive TTY
    • verifies no write in non-interactive mode

Run output fragments:

✓ tests/docker-git/menu-select-connect.test.ts (4 tests)
✓ tests/usecases/terminal-cursor.test.ts (2 tests)

Validation commands run locally:

pnpm --filter ./packages/app lint
pnpm --filter ./packages/lib lint
pnpm --filter ./packages/app test
pnpm --filter ./packages/lib test
pnpm --filter ./packages/app build:docker-git

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.

Добавить отображение к какому докер контейнеру сейчас есть SSH подключение

1 participant