Skip to content

fix(dialogs): keep the create dialogs open until creation succeeds - #314

Open
maxthomas95 wants to merge 2 commits into
mainfrom
fix/create-dialogs-20261109
Open

maxthomas95 wants to merge 2 commits into
mainfrom
fix/create-dialogs-20261109

Conversation

@maxthomas95

Copy link
Copy Markdown
Owner

Summary

July finding C-3, still open in docs/REVIEW_2026-11-09.md.

The New Session and New Environment dialogs called onCreate and closed immediately. A failed SSH launch, a declined Vault login or a persistence error was reported only by a toast, and everything typed was gone. A worktree created just before a failed launch was left behind.

  • Handlers report the outcome. handleCreateSession, handleCreateEnvironment and handleUpdateEnvironment resolve to true or false. Their existing error toasts are unchanged.
  • Dialogs wait. Both dialogs await the result and close only on success. On failure every field stays as it was. The create buttons are disabled while a submit is pending and a second submit is ignored. Cancel and close stay available.
  • Worktree cleanup. A worktree created for an attempt that then fails is removed, so a retry does not fail on the existing path. If the removal itself fails, the dialog says where the worktree was left.
  • Docs. sessions.md and environments.md describe the behaviour.

The four paths in the session dialog that launch a session are covered: plain create, new folder, and the two clone paths.

Test plan

  • npx tsc --noEmit
  • npx eslint on touched files
  • npx vitest run — 2404 passed; 2 failed, both the known Windows-host real-shell/PTY tests
  • Manual: New Session against an unreachable SSH host — error toast, dialog still open with directory, label, flags and env intact; fix the environment and Create works
  • Manual: New Session with "create worktree" against a failing launch — the worktree is gone afterwards and a retry succeeds
  • Manual: decline a Vault login from New Session — the dialog stays open
  • Manual: New Environment with a duplicate or invalid config — the dialog stays open

Out of scope

  • A mount test for NewSessionDialog (it needs a large electronAPI harness; the close-on-success step is covered through the shared helper).
  • Showing the failure inline in the dialog instead of a toast.

🤖 Generated with Claude Code

maxthomas95 and others added 2 commits November 9, 2026 21:32
The New Session and New Environment dialogs called onCreate and closed
at once. A failed SSH launch, a declined Vault login or a persistence
error was reported only by a toast, and everything typed was gone. A
worktree created just before a failed launch was left behind.

- The App handlers for creating a session and for creating or updating
  an environment now resolve to true or false.
- Both dialogs await that result and close only on success. On failure
  every field stays as it was. The create buttons are disabled while a
  submit is pending and a second submit is ignored.
- A worktree created for an attempt that then fails is removed, so a
  retry does not trip over the existing path. If the removal fails the
  dialog says where the worktree was left.

Tests: the shared submit helper; the environment dialog staying open
with the typed name on failure and closing on success. Full suite: 2404
passed; the two failures are the known Windows-host real-shell and PTY
tests.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
18.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

This branch has not been deployed

No deployments
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