Skip to content

Commit 9622a1e

Browse files
committed
fix(app): align create boolean labels
1 parent 99f1ec3 commit 9622a1e

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

packages/app/src/docker-git/menu-create-shared.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ const joinPath = (...parts: ReadonlyArray<string>): string => {
157157
return cleaned.join("/")
158158
}
159159

160+
const renderExplicitBooleanChoice = (value: boolean): string => value ? "Y" : "N"
161+
160162
export const renderCreateStepLabel = (step: CreateStep, defaults: CreateInputs): string =>
161163
Match.value(step).pipe(
162164
Match.when("repoUrl", () => "Repo URL (optional for empty workspace)"),
@@ -165,20 +167,21 @@ export const renderCreateStepLabel = (step: CreateStep, defaults: CreateInputs):
165167
Match.when("cpuLimit", () => `CPU limit [${defaults.cpuLimit || "30%"}]`),
166168
Match.when("ramLimit", () => `RAM limit [${defaults.ramLimit || "30%"}]`),
167169
Match.when("gpu", () => `GPU access [${defaults.gpu}]`),
168-
Match.when("runUp", () => `Run docker compose up now? [${defaults.runUp ? "Y" : "n"}]`),
170+
Match.when("runUp", () => `Run docker compose up now? [${renderExplicitBooleanChoice(defaults.runUp)}]`),
169171
Match.when(
170172
"mcpPlaywright",
171-
() => `Enable Playwright MCP (nested Chromium browser)? [${defaults.enableMcpPlaywright ? "y" : "N"}]`
173+
() =>
174+
`Enable Playwright MCP (nested Chromium browser)? [${
175+
renderExplicitBooleanChoice(defaults.enableMcpPlaywright)
176+
}]`
172177
),
173178
Match.when(
174179
"force",
175-
() => `Force recreate (overwrite files + wipe volumes)? [${defaults.force ? "y" : "N"}]`
180+
() => `Force recreate (overwrite files + wipe volumes)? [${renderExplicitBooleanChoice(defaults.force)}]`
176181
),
177182
Match.exhaustive
178183
)
179184

180-
const renderExplicitBooleanChoice = (value: boolean): string => value ? "Y" : "N"
181-
182185
const parseBooleanChoice = (input: string): boolean | null => {
183186
const normalized = input.trim().toLowerCase()
184187
if (normalized === "y" || normalized === "yes") {

packages/app/tests/docker-git/create-flow-render.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ describe("Create flow rendering", () => {
156156
}
157157
const html = renderCreatePanel(createView, { compact: true })
158158

159-
expect(html).toContain("Enable Playwright MCP (nested Chromium browser)? [y]")
160-
expect(html).toContain("Force recreate (overwrite files + wipe volumes)? [y]")
159+
expect(html).toContain("Enable Playwright MCP (nested Chromium browser)? [Y]")
160+
expect(html).toContain("Force recreate (overwrite files + wipe volumes)? [Y]")
161161
expect(html).toContain("CPU limit [30%]")
162162
expect(html).toContain("RAM limit [30%]")
163163
expect(html).toContain("GPU access [none]")

0 commit comments

Comments
 (0)