Skip to content

fix(web): restore SSH session toolbar after page reload#270

Merged
skulidropek merged 5 commits into
ProverCoderAI:mainfrom
konard:issue-269-2e25dfa54dec
May 12, 2026
Merged

fix(web): restore SSH session toolbar after page reload#270
skulidropek merged 5 commits into
ProverCoderAI:mainfrom
konard:issue-269-2e25dfa54dec

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented May 11, 2026

Summary

Fixes the regression where reloading the page on /ssh/session/:id left only Detach and Kill in the terminal toolbar. The standalone SSH session view now wires the same project-action handlers as the dashboard-launched terminal, restoring Open browser, Apply, Task manager, and New terminal alongside Detach/Kill.

Closes #269

Root cause

TerminalOnlyReady in packages/app/src/web/app-terminal-session.tsx rendered TerminalPanel with only onDetach, onKill, and onMessage. The toolbar's OptionalTerminalActionButton hides any button whose onClick is undefined, so the four project-scoped actions never appeared after a reload — even though the underlying session lookup already exposed the project context (browserProjectId, browserProjectKey, browserProjectName).

Fix

  • Wire the four missing handlers (onOpenBrowser, onApplyProject, onOpenTaskManager, onOpenTerminal) using the existing API helpers (loadProjectBrowser, applyProject, loadProjectTasks, createProjectTerminalSession).
  • Render the Task manager body inside the standalone view when opened.
  • Hide individual handlers gracefully when the session lookup lacks the required project context (e.g. only Open terminal disappears when projectKey is missing).
  • Split the grown module into three files to satisfy max-lines (300) and max-lines-per-function (50):
    • app-terminal-session.tsx — state machine + composition
    • app-terminal-session-handlers.ts — Effect-based runners and useProjectActionHandlers / useTaskManagerHandlers hooks
    • app-terminal-session-ui.tsx — styles and presentational components

Test plan

  • Added packages/app/tests/docker-git/app-terminal-session-handlers.test.ts covering:
    • All four project-action handlers are functions when project context is present.
    • All handlers hide when projectId is missing.
    • Only onOpenTerminal hides when projectKey is missing.
    • onOpenTaskManager invokes the supplied open-request callback.
  • bun run typecheck — passes.
  • bun run lint — 0 errors, 0 warnings.
  • bun run test — 283 tests across 52 files pass.
  • Manual verification: reload /ssh/session/:id shows the full toolbar.

Visual evidence

Before (only Detach and Kill after reload):

before

Expected / after fix (full toolbar restored):

after

Release notes

Added a changeset (.changeset/restore-ssh-session-toolbar.md) at patch level for @prover-coder-ai/docker-git.

konard added 2 commits May 11, 2026 14:19
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: ProverCoderAI#269
Wire Open browser, Apply, Task manager, and New terminal handlers in
the standalone /ssh/session/:id view so the full toolbar appears after
reload, matching the dashboard-launched terminal.

Closes ProverCoderAI#269
@konard konard changed the title [WIP] Почему после перезагрузки страницы все верхние кнопки пропадают? Хотя они раньше были fix(web): restore SSH session toolbar after page reload May 11, 2026
@konard konard marked this pull request as ready for review May 11, 2026 14:49
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

Working session summary

PR #270 is updated and ready for review: #270


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $11.145712

📊 Context and tokens usage:

Claude Opus 4.7: (4 sub-sessions)

  1. 117.1K / 1M (12%) input tokens, 12.1K / 128K (9%) output tokens
  2. 117.3K / 1M (12%) input tokens, 24.1K / 128K (19%) output tokens
  3. 117.0K / 1M (12%) input tokens, 27.2K / 128K (21%) output tokens
  4. 42.0K / 1M (4%) input tokens, 2.1K / 128K (2%) output tokens

Total: (9.1K new + 346.0K cache writes + 13.8M cache reads) input tokens, 81.8K output tokens, $11.145712 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (4712KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🔄 Auto-restart triggered (iteration 1)

Reason: CI failures detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

Replaces six tap+catchAll pairs in app-terminal-session-handlers.ts with
Effect.match({ onFailure, onSuccess }) to satisfy the Effect-TS lint
rule that flags catchAll for discarding typed errors. Behavior is
unchanged — same success and failure side-effects, no Effect.asVoid
needed since match already returns Effect<void, never>.
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

Working session summary

All 15 CI checks now pass on commit 7b46abc, including the previously failing Lint Effect-TS.

Summary

The Effect-TS lint job failed with 6 no-restricted-syntax errors on packages/app/src/web/app-terminal-session-handlers.ts flagging Effect.catchAll for discarding typed errors. The rule is enforced at packages/app/eslint.effect-ts-check.config.mjs:100-102.

Fix (commit 7b46abc): Replaced all six Effect.tap(onSuccess) → Effect.catchAll(onError) → Effect.asVoid chains with the idiomatic Effect.match({ onFailure, onSuccess }), matching the pattern already used in panel-project-details.tsx:299 and actions-shared.ts:106. Behavior is unchanged — the same setMessage/setState side effects run on each branch.

Verified locally: bun run lint:effect (0 errors), bun run lint (0 errors), bun run typecheck (clean), bun run test (283/283 pass).

CI status on PR #270: all 15 checks green (Lint Effect-TS, Build, Lint, Types, Test, Snapshot, all E2E variants, dist-deps-prune).


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🔄 Auto-restart-until-mergeable Log (iteration 1)

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $1.723786

📊 Context and tokens usage:

  • 63.4K / 1M (6%) input tokens, 10.6K / 128K (8%) output tokens

Total: (54 new + 56.9K cache writes + 2.2M cache reads) input tokens, 10.6K output tokens, $1.723787 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (5796KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🔄 Auto-restart triggered (iteration 2)

Reason: Uncommitted changes detected

Starting new session to address the issues.


Auto-restart-until-mergeable mode is active. This run will stop after 5 restart iterations.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

Working session summary

Everything is in order:

Nothing further to do — PR #270 (#270) is ready for human review.


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🔄 Auto-restart-until-mergeable Log (iteration 2)

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $0.834357

📊 Context and tokens usage:

  • 43.6K / 1M (4%) input tokens, 3.8K / 128K (3%) output tokens

Total: (38 new + 43.1K cache writes + 938.0K cache reads) input tokens, 3.8K output tokens, $0.834357 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (6446KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@skulidropek
Copy link
Copy Markdown
Member

CI/CD лежит. Исправь

@skulidropek
Copy link
Copy Markdown
Member

Смержи main Ветку к нам

@konard konard marked this pull request as draft May 11, 2026 18:55
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-05-11T18:55:42.280Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

@konard konard marked this pull request as ready for review May 11, 2026 19:01
@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

@skulidropek спасибо за фидбек.

Что сделано:

  • Смержил upstream/main в ветку PR (коммит 3583293) — теперь PR включает PR fix(web): suppress xterm.js terminal query auto-responses #272 и остальные свежие изменения из main, конфликтов не было.
  • Локально перепроверил: bun run typecheck ✅, bun run lint ✅, bun run test ✅ (299/299 тестов проходят, +16 новых тестов из upstream).

По красному чеку E2E (Clone cache):
Этот джоб упал не из-за изменений PR — в логах виден таймаут docker-операции:

e2e/clone-cache: clone command timed out after 1800s for case: second

Тест 30 минут ждал завершения docker clone и был убит. Логика тулбара (то, что чинит PR) в этом сценарии не задействована. Сейчас CI перезапустился на свежем коммите 3583293 — если флак, должен пройти зелёным.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.080339

📊 Context and tokens usage:

  • 69.3K / 1M (7%) input tokens, 5.7K / 128K (4%) output tokens

Total: (29 new + 62.7K cache writes + 1.1M cache reads) input tokens, 5.7K output tokens, $1.080339 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (764KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🔄 Auto-restart 1/5

Detected uncommitted changes from previous run. Starting new session to review and commit or discard them.

Uncommitted files:

M packages/app/src/web/terminal-image-paths.ts
?? ci-logs/

Auto-restart will stop after changes are committed or discarded, or after 4 more iterations. Please wait until working session will end and give your feedback.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

Working session summary

Done. Reverted the unrelated formatting change to terminal-image-paths.ts and removed the leftover ci-logs/ directory — neither was part of the issue #269 fix. Working tree is clean.

PR #270 status:

  • State: OPEN, not draft, MERGEABLE, CLEAN
  • All 15 CI checks passing (Build, Lint, Lint Effect-TS, Types, Test, Snapshot, all 7 E2E variants, Dist deps prune, dist-deps-prune)
  • upstream/main already merged in (commit 3583293)
  • Ready for human review: fix(web): restore SSH session toolbar after page reload #270

This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

🔄 Auto-restart 1/5 Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $0.870544

📊 Context and tokens usage:

  • 46.0K / 1M (5%) input tokens, 4.5K / 128K (4%) output tokens

Total: (38 new + 39.5K cache writes + 1.0M cache reads) input tokens, 4.5K output tokens, $0.870544 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.7 (claude-opus-4-7)

📎 Log file uploaded as Gist (1623KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Contributor Author

konard commented May 11, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@skulidropek skulidropek merged commit a28bdac into ProverCoderAI:main May 12, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants