From 6b331b61f65280949fbe2cec67b28722db81f272 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 9 May 2026 06:39:58 +0000 Subject: [PATCH 1/3] Initial commit with task details Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: https://github.com/ProverCoderAI/docker-git/issues/255 --- .gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitkeep diff --git a/.gitkeep b/.gitkeep new file mode 100644 index 00000000..6cb72c0c --- /dev/null +++ b/.gitkeep @@ -0,0 +1 @@ +# .gitkeep file auto-generated at 2026-05-09T06:39:58.456Z for PR creation at branch issue-255-0f74bc3da840 for issue https://github.com/ProverCoderAI/docker-git/issues/255 \ No newline at end of file From 7cdf979943e8a1f479e1b2c0ee563ebcc8434724 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 9 May 2026 07:00:22 +0000 Subject: [PATCH 2/3] fix(app): confirm before applying project from terminal Apply restarts the container, which kills active SSH sessions and any in-container browser (e.g. MCP Playwright). The Apply button on the terminal screen used to trigger this restart with no warning, leaving users surprised when their browser connection dropped. Match the confirmation pattern already used by Down, Delete, Down All, and Apply All: prompt the user with a message that names the project and explicitly calls out that SSH sessions and in-container browsers will end. If the user declines, no state is changed. Fixes #255 --- packages/app/src/web/actions-projects.ts | 9 ++++++ .../tests/docker-git/actions-projects.test.ts | 31 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/packages/app/src/web/actions-projects.ts b/packages/app/src/web/actions-projects.ts index 276c3b02..fe7232fc 100644 --- a/packages/app/src/web/actions-projects.ts +++ b/packages/app/src/web/actions-projects.ts @@ -264,10 +264,19 @@ export const connectProjectById = ( }) } +const applyProjectConfirmMessage = (label: string): string => + `Apply docker-git config to ${label}? This restarts the container and ends active SSH sessions and in-container browsers.` + export const applyProjectById = ( projectId: string, context: BrowserActionContext ) => { + const label = context.selectedProjectId === projectId + ? projectActionLabel(context) + : projectId + if (!confirmAction(applyProjectConfirmMessage(label))) { + return + } context.setSelectedProjectId(projectId) withBusy({ context, diff --git a/packages/app/tests/docker-git/actions-projects.test.ts b/packages/app/tests/docker-git/actions-projects.test.ts index f7c2483d..77057311 100644 --- a/packages/app/tests/docker-git/actions-projects.test.ts +++ b/packages/app/tests/docker-git/actions-projects.test.ts @@ -224,8 +224,13 @@ describe("web project actions", () => { it.effect("applies a selected project through the project apply endpoint", () => Effect.gen(function*(_) { + const confirmMock = vi.fn(() => true) + vi.stubGlobal("confirm", confirmMock) applyProjectMock.mockImplementation(() => Effect.succeed(project)) - const { context, reloadDashboard, setMessage } = makeBrowserActionContext() + const { context, reloadDashboard, setMessage } = makeBrowserActionContext({ + selectedProjectId: "project-1", + selectedProjectName: "octocat/hello-world" + }) applyProjectById("project-1", context) @@ -233,12 +238,36 @@ describe("web project actions", () => { expect(applyProjectMock).toHaveBeenCalledWith("project-1") })) + expect(confirmMock).toHaveBeenCalledWith( + "Apply docker-git config to octocat/hello-world? " + + "This restarts the container and ends active SSH sessions and in-container browsers." + ) expect(context.setSelectedProjectId).toHaveBeenCalledWith("project-1") expect(context.setSelectedProject).toHaveBeenCalledWith(project) expect(reloadDashboard).toHaveBeenCalledTimes(1) expect(setMessage).toHaveBeenLastCalledWith("Applied octocat/hello-world.") })) + it("does not apply a project when the user declines confirmation", () => { + const confirmMock = vi.fn(() => false) + vi.stubGlobal("confirm", confirmMock) + applyProjectMock.mockImplementation(() => Effect.succeed(project)) + const { context, reloadDashboard } = makeBrowserActionContext({ + selectedProjectId: "project-1", + selectedProjectName: "octocat/hello-world" + }) + + applyProjectById("project-1", context) + + expect(confirmMock).toHaveBeenCalledWith( + "Apply docker-git config to octocat/hello-world? " + + "This restarts the container and ends active SSH sessions and in-container browsers." + ) + expect(applyProjectMock).not.toHaveBeenCalled() + expect(context.setSelectedProjectId).not.toHaveBeenCalled() + expect(reloadDashboard).not.toHaveBeenCalled() + }) + it.effect("confirms and applies all projects", () => Effect.gen(function*(_) { const confirmMock = vi.fn(() => true) From 0ce4010f7e374a69f77cbb118fd219c0f8aea0f2 Mon Sep 17 00:00:00 2001 From: konard Date: Sat, 9 May 2026 07:25:57 +0000 Subject: [PATCH 3/3] Revert "Initial commit with task details" This reverts commit 6b331b61f65280949fbe2cec67b28722db81f272. --- .gitkeep | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .gitkeep diff --git a/.gitkeep b/.gitkeep deleted file mode 100644 index 6cb72c0c..00000000 --- a/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# .gitkeep file auto-generated at 2026-05-09T06:39:58.456Z for PR creation at branch issue-255-0f74bc3da840 for issue https://github.com/ProverCoderAI/docker-git/issues/255 \ No newline at end of file