diff --git a/src/renderer/src/components/worktree-creation/VmBuildStepRow.test.tsx b/src/renderer/src/components/worktree-creation/VmBuildStepRow.test.tsx
new file mode 100644
index 00000000000..8efc99361cb
--- /dev/null
+++ b/src/renderer/src/components/worktree-creation/VmBuildStepRow.test.tsx
@@ -0,0 +1,45 @@
+// @vitest-environment happy-dom
+
+import { act, cleanup, render } from '@testing-library/react'
+import { afterEach, expect, it, vi } from 'vitest'
+import type { Translate } from '@/i18n/use-translate'
+import { VmBuildStepRow } from './VmBuildStepRow'
+import type { VmBuildStep } from './vm-build-steps'
+
+afterEach(() => {
+ cleanup()
+ vi.useRealTimers()
+})
+
+const t: Translate = (_key, fallback) => fallback
+const pendingClone = (cloneMode?: 'clone' | 'update'): VmBuildStep => ({
+ id: 'clone',
+ state: 'pending',
+ skipped: false,
+ elapsedMs: null,
+ percent: null,
+ startedAt: null,
+ ...(cloneMode ? { cloneMode } : {})
+})
+
+it('names the repository row once: no label guessed, a placeholder only after 150 ms (PC-4)', () => {
+ vi.useFakeTimers()
+ const row = (step: VmBuildStep) => (
+
+
+
+ )
+ const { container, rerender } = render(row(pendingClone()))
+ // Accessible name only; no visible label, no placeholder yet (the plan usually answers by now).
+ expect(container.textContent).toContain('Repository')
+ expect(container.textContent).not.toContain('Clone repository')
+ expect(container.querySelector('[data-slot="skeleton"]')).toBeNull()
+ act(() => {
+ vi.advanceTimersByTime(160)
+ })
+ expect(container.querySelector('[data-slot="skeleton"]')).not.toBeNull()
+ // The plan answers: the one label, never changed afterwards.
+ rerender(row(pendingClone('update')))
+ expect(container.querySelector('[data-slot="skeleton"]')).toBeNull()
+ expect(container.textContent).toContain('Update repository')
+})
diff --git a/src/renderer/src/components/worktree-creation/VmBuildStepRow.tsx b/src/renderer/src/components/worktree-creation/VmBuildStepRow.tsx
index 59f1220ccc3..c0803e10056 100644
--- a/src/renderer/src/components/worktree-creation/VmBuildStepRow.tsx
+++ b/src/renderer/src/components/worktree-creation/VmBuildStepRow.tsx
@@ -10,6 +10,22 @@ import { typicalStepSeconds, type VmBuildStepTiming } from './vm-build-timing'
import { formatElapsedTime } from './worktree-creation-clock'
import { stepLabel, stepStateLabel } from './vm-build-sheet-copy'
+/** The boot plan usually answers within this; only a slower answer shows the placeholder. */
+const PLACEHOLDER_DELAY_MS = 150
+
+/** True once `active` has held for `delayMs` (the row's mode is unknown only once per create). */
+function useDelayedFlag(active: boolean, delayMs: number): boolean {
+ const [due, setDue] = React.useState(false)
+ React.useEffect(() => {
+ if (!active) {
+ return
+ }
+ const timer = window.setTimeout(() => setDue(true), delayMs)
+ return () => window.clearTimeout(timer)
+ }, [active, delayMs])
+ return active && due
+}
+
/** One timed row of the build checklist; the failure card, not the row, carries the red. */
export function VmBuildStepRow({
step,
@@ -30,6 +46,8 @@ export function VmBuildStepRow({
// A live percent already says how far along the step is.
const hint = step.state === 'running' && step.percent === null ? timing : null
const slow = hint !== null && step.elapsedMs !== null && step.elapsedMs > hint.p95Ms
+ const modeUnknown = cloud && step.id === 'clone' && step.state === 'pending' && !step.cloneMode
+ const placeholderDue = useDelayedFlag(modeUnknown, PLACEHOLDER_DELAY_MS)
return (
- {cloud && step.id === 'clone' && step.state === 'pending' && !step.cloneMode ? (
- // Clone or update is decided in a moment (boot plan); a placeholder never relabels.
+ {modeUnknown ? (
+ // Clone or update is decided in a moment (boot plan): a placeholder, never a guessed label.
+ // Usually decided within ~150 ms, so the placeholder shows only after that (no blink).
<>
-
- {stepLabel(step, cloud, t)}
+
+ {t(
+ 'auto.components.worktree.creation.VmBuildSheet.repositoryPending',
+ 'Repository'
+ )}
+
+ {placeholderDue ? (
+
+ ) : (
+
+ {'\u00a0'}
+
+ )}
>
) : (
stepLabel(step, cloud, t)
diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json
index 2785e394006..870333d3f7a 100644
--- a/src/renderer/src/i18n/locales/en.json
+++ b/src/renderer/src/i18n/locales/en.json
@@ -4240,7 +4240,8 @@
"cloneDownload": "Downloading history…",
"cloneCounting": "Counting objects…",
"updateCloud": "Update repository",
- "updateFetching": "Fetching changes…"
+ "updateFetching": "Fetching changes…",
+ "repositoryPending": "Repository"
},
"VmBuildFailureCard": {
"createFailedTitle": "Couldn’t create workspace",