Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
feat(open-knowledge): name-first Create-new-project dialog (PRD-7129) (#1949)
Andrew Mikofalvyc65c09b791f9
diff --git a/.changeset/name-first-create-project.md b/.changeset/name-first-create-project.mdnew file mode 100644index 000000000..b4b1a12ce--- /dev/null+++ b/.changeset/name-first-create-project.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++The Create-new-project dialog in OK Desktop is now name-first. You type the project name in a focused field at the top, then see a read-only Location with a Browse button to change where it lands and a live "Will be created at: …" caption showing the exact folder before you commit. Naming a project no longer means using the OS folder picker's New Folder button or hitting an "already has files" wall first. A name that collides with an existing non-empty folder, or one that can't be turned into a valid folder name, is flagged inline on the name field. The nested-project and parent-git-repo guards are unchanged.diff --git a/docs/content/get-started/quickstart.mdx b/docs/content/get-started/quickstart.mdxindex 8dcce78b5..13a7c3d8e 100644--- a/docs/content/get-started/quickstart.mdx+++ b/docs/content/get-started/quickstart.mdx@@ -24,9 +24,9 @@ Download the latest version of the Open Knowledge desktop app for macOS.### Create a new project-- Open the Open Knowledge app and click **Create New Project**.-- Click **Browse** to select the destination folder for your new project.-- Continue with the default settings and click **Create**.+- Open the Open Knowledge app and click **Create new project**.+- Type a name for your project (for example, *Team Wiki*).+- Optionally click **Browse** to change where the project is saved, then click **Create**.</Step>diff --git a/packages/app/src/components/CreateProjectDialog.cascade-staleness.dom.test.tsx b/packages/app/src/components/CreateProjectDialog.cascade-staleness.dom.test.tsxindex dc173a966..877e33f1c 100644--- a/packages/app/src/components/CreateProjectDialog.cascade-staleness.dom.test.tsx+++ b/packages/app/src/components/CreateProjectDialog.cascade-staleness.dom.test.tsx@@ -35,7 +35,7 @@ if (globalWithDomShims.ResizeObserver === undefined) {const ASYNC_TIMEOUT_MS = 2000;const PARENT = '/Users/test/Projects';-const TARGET = `${PARENT}/Andrew Brain`;+const PROJECT_NAME = 'Andrew Brain';const FIRST_GIT_RESULT: OkFindEnclosingGitRootResult = {gitRoot: '/Users/test',distance: 1,@@ -45,7 +45,7 @@ interface ProgrammableBridgeStub {bridge: OkDesktopBridge;setEnclosingGitResult(result: OkFindEnclosingGitRootResult | null): void;setRemoveGitFolderImpl(impl: (gitRoot: string) => Promise<void>): void;- setPickedPath(picked: string | null): void;+ setPickedParent(picked: string | null): void;setFindEnclosingProjectRootImpl(impl: (path: string) => Promise<OkFindEnclosingProjectRootResult | null>,): void;@@ -60,14 +60,14 @@ interface ProgrammableBridgeStub {function makeStubBridge(initialGit: OkFindEnclosingGitRootResult | null,- initialPicked: string | null,+ initialPickedParent: string | null,): ProgrammableBridgeStub {const findGitCalls: string[] = [];const folderStateCalls: string[] = [];const removeGitCalls: string[] = [];const openFolderCalls: number[] = [];let currentGitResult: OkFindEnclosingGitRootResult | null = initialGit;- let currentPicked: string | null = initialPicked;+ let currentPickedParent: string | null = initialPickedParent;let removeGitImpl: (gitRoot: string) => Promise<void> = async () => undefined;let findEnclosingProjectImpl: (path: string) => Promise<OkFindEnclosingProjectRootResult | null> =async () => null;@@ -95,7 +95,7 @@ function makeStubBridge(dialog: {openFolder: async (): Promise<string | null> => {openFolderCalls.push(openFolderCalls.length + 1);- return currentPicked;+ return currentPickedParent;},},project: {@@ -113,8 +113,8 @@ function makeStubBridge(setRemoveGitFolderImpl: (impl) => {removeGitImpl = impl;},- setPickedPath: (picked) => {- currentPicked = picked;+ setPickedParent: (picked) => {+ currentPickedParent = picked;},setFindEnclosingProjectRootImpl: (impl) => {findEnclosingProjectImpl = impl;@@ -129,6 +129,19 @@ function makeStubBridge(};}+async function typeName(value: string) {+ fireEvent.change(screen.getByTestId('create-name'), { target: { value } });+}++async function waitForLocation(expected = PARENT) {+ await waitFor(+ () => {+ expect(screen.getByTestId('create-location-display').textContent).toContain(expected);+ },+ { timeout: ASYNC_TIMEOUT_MS },+ );+}+describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {let consoleWarnSpy: ReturnType<typeof spyOn>;@@ -141,23 +154,18 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {consoleWarnSpy.mockRestore();});- test('S1: re-engaging Browse with the same target after an FS mutation produces a fresh probe', async () => {- const stub = makeStubBridge(FIRST_GIT_RESULT, TARGET);+ test('S1: re-typing the same name after an FS mutation produces a fresh probe', async () => {+ const stub = makeStubBridge(FIRST_GIT_RESULT, PARENT);render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);- expect(screen.queryByTestId('create-name') !== null).toBe(false);-- const browse = (await screen.findByTestId('create-browse', undefined, {+ const nameInput = await screen.findByTestId('create-name', undefined, {timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );+ });+ expect(nameInput.tagName).toBe('INPUT');++ await waitForLocation();- fireEvent.click(browse);+ await typeName(PROJECT_NAME);await waitFor(() => {expect(screen.queryByTestId('create-banner-git-confirm')).not.toBeNull();@@ -167,12 +175,13 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {stub.setEnclosingGitResult(null);- const probesBeforeReBrowse = stub.findGitCalls.length;- fireEvent.click(browse);+ const probesBeforeRetype = stub.findGitCalls.length;+ await typeName('');+ await typeName(PROJECT_NAME);await waitFor(() => {- const delta = stub.findGitCalls.length - probesBeforeReBrowse;+ const delta = stub.findGitCalls.length - probesBeforeRetype;expect(delta).toBeGreaterThanOrEqual(1);},{ timeout: ASYNC_TIMEOUT_MS },@@ -188,21 +197,12 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});test('S2: window focus event triggers a re-probe — banner clears when FS resolves while dialog stays open', async () => {- const stub = makeStubBridge(FIRST_GIT_RESULT, TARGET);+ const stub = makeStubBridge(FIRST_GIT_RESULT, PARENT);render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();- expect(screen.queryByTestId('create-name') !== null).toBe(false);- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );-- fireEvent.click(browse);+ await typeName(PROJECT_NAME);await waitFor(() => {expect(screen.queryByTestId('create-banner-git-confirm')).not.toBeNull();@@ -232,23 +232,16 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});test('S3: remove-.git button: confirm → IPC called → re-probe → banner clears (terminal case, no higher .git)', async () => {- const stub = makeStubBridge(FIRST_GIT_RESULT, TARGET);+ const stub = makeStubBridge(FIRST_GIT_RESULT, PARENT);stub.setRemoveGitFolderImpl(async () => {stub.setEnclosingGitResult(null);});render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);- expect(screen.queryByTestId('create-name') !== null).toBe(false);- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );- fireEvent.click(browse);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();++ await typeName(PROJECT_NAME);await waitFor(() => {expect(screen.queryByTestId('create-banner-git-confirm')).not.toBeNull();@@ -287,7 +280,7 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {const FIRST = { gitRoot: '/Users/test', distance: 1 } as const;const HIGHER = { gitRoot: '/Users', distance: 2 } as const;- const stub = makeStubBridge(FIRST, TARGET);+ const stub = makeStubBridge(FIRST, PARENT);stub.setRemoveGitFolderImpl(async (gitRoot) => {if (gitRoot === FIRST.gitRoot) {stub.setEnclosingGitResult(HIGHER);@@ -297,17 +290,9 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);- expect(screen.queryByTestId('create-name') !== null).toBe(false);- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );- fireEvent.click(browse);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();+ await typeName(PROJECT_NAME);await waitFor(() => {@@ -369,24 +354,16 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {);});- test('S6: cascade probes folderState against the sanitized creation target, not the raw picked path', async () => {- const PICKED_RAW = '/Users/test/.hidden-notes';- const EXPECTED_SANITIZED_TARGET = '/Users/test/hidden-notes';+ test('S6: cascade probes folderState against the sanitized creation target, not the raw typed name', async () => {+ const RAW_NAME = '.hidden-notes';+ const EXPECTED_SANITIZED_TARGET = `${PARENT}/hidden-notes`;- const stub = makeStubBridge(null, PICKED_RAW);+ const stub = makeStubBridge(null, PARENT);render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );-- fireEvent.click(browse);+ await typeName(RAW_NAME);await waitFor(() => {@@ -396,27 +373,19 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {);expect(stub.folderStateCalls).toContain(EXPECTED_SANITIZED_TARGET);- expect(stub.folderStateCalls).not.toContain(PICKED_RAW);+ expect(stub.folderStateCalls).not.toContain(`${PARENT}/${RAW_NAME}`);});test('S5: remove-.git button: IPC failure surfaces inline error, banner stays, retry path remains', async () => {- const stub = makeStubBridge(FIRST_GIT_RESULT, TARGET);+ const stub = makeStubBridge(FIRST_GIT_RESULT, PARENT);stub.setRemoveGitFolderImpl(async () => {throw new Error('EACCES: permission denied');});render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);- expect(screen.queryByTestId('create-name') !== null).toBe(false);- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );- fireEvent.click(browse);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();+ await typeName(PROJECT_NAME);await waitFor(() => {expect(screen.queryByTestId('create-banner-git-confirm')).not.toBeNull();@@ -437,24 +406,16 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {expect(screen.queryByTestId('create-banner-git-remove')).not.toBeNull();});- test('PRD-6649: banner DOM identity is stable across consecutive Browse re-picks of the same target (verdict unchanged)', async () => {- const stub = makeStubBridge(null, TARGET);+ test('PRD-6649: banner DOM identity is stable across name keystrokes that re-probe to the same verdict', async () => {+ const stub = makeStubBridge(null, PARENT);const nestedRoot = '/Users/test/existing-project';stub.setFindEnclosingProjectRootImpl(async (_path) => ({ rootPath: nestedRoot }));render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );-- fireEvent.click(browse);+ await typeName('Plant');const initialBanner = await screen.findByTestId('create-banner-nested', undefined, {timeout: ASYNC_TIMEOUT_MS,});@@ -474,13 +435,13 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {// biome-ignore lint/style/noNonNullAssertion: asserted aboveobserver.observe(bannerParent!, { childList: true, subtree: true });- const probesBeforeReBrowse = stub.findGitCalls.length;+ const probesBefore = stub.findGitCalls.length;- fireEvent.click(browse);+ await typeName('Plant Care Notes');await waitFor(() => {- const delta = stub.findGitCalls.length - probesBeforeReBrowse;+ const delta = stub.findGitCalls.length - probesBefore;expect(delta).toBeGreaterThanOrEqual(1);},{ timeout: ASYNC_TIMEOUT_MS },@@ -501,20 +462,12 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});test('PRD-6649: canSubmit is gated by probeLifecycle: disabled while a probe is in-flight, re-enabled when settled', async () => {- const stub = makeStubBridge(null, TARGET);+ const stub = makeStubBridge(null, PARENT);render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );-- fireEvent.click(browse);+ await typeName('Plant Care');const submitButton = screen.getByTestId('create-submit') as HTMLButtonElement;await waitFor(() => {@@ -533,7 +486,7 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});const probesBefore = probeCallCount;- fireEvent.click(browse);+ await typeName('Plant Care Notes');await waitFor(() => {@@ -558,24 +511,16 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});test('PRD-6649: 5 s polling skips probeNonce bump while a probe is in-flight (race-prevention gate)', async () => {- const stub = makeStubBridge(FIRST_GIT_RESULT, TARGET);+ const stub = makeStubBridge(FIRST_GIT_RESULT, PARENT);const setIntervalSpy = spyOn(globalThis, 'setInterval');try {render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );-- fireEvent.click(browse);+ await typeName(PROJECT_NAME);await waitFor(() => {expect(screen.queryByTestId('create-banner-git-confirm')).not.toBeNull();@@ -600,7 +545,7 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});});- fireEvent.click(browse);+ await typeName(`${PROJECT_NAME} (v2)`);await waitFor(() => {expect(probeCallCount).toBeGreaterThanOrEqual(1);@@ -641,23 +586,15 @@ describe('CreateProjectDialog cascade staleness (Tier-3 mount)', () => {});test('PRD-6649: probeLifecycle resets to idle on IPC-failure catch arm (canSubmit recovers after transient failure)', async () => {- const stub = makeStubBridge(null, TARGET);+ const stub = makeStubBridge(null, PARENT);stub.setFindEnclosingGitRootImpl(async (_path) => {throw new Error('Simulated IPC failure');});render(<CreateProjectDialog open={true} onOpenChange={() => {}} bridge={stub.bridge} />);+ await screen.findByTestId('create-name', undefined, { timeout: ASYNC_TIMEOUT_MS });+ await waitForLocation();- const browse = (await screen.findByTestId('create-browse', undefined, {- timeout: ASYNC_TIMEOUT_MS,- })) as HTMLButtonElement;- await waitFor(- () => {- expect(browse.disabled).toBe(false);- },- { timeout: ASYNC_TIMEOUT_MS },- );-- fireEvent.click(browse);+ await typeName(PROJECT_NAME);const submitButton = screen.getByTestId('create-submit') as HTMLButtonElement;diff --git a/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsx b/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsxindex c48656282..e051affba 100644--- a/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsx+++ b/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsx@@ -40,12 +40,14 @@ if (globalWithDomShims.ResizeObserver === undefined) {}const PARENT = '/Users/test/Projects';-const TARGET = `${PARENT}/Runtime Project`;-const SECOND_TARGET = `${PARENT}/Second Project`;+const PROJECT_NAME = 'Runtime Project';+const SECOND_PARENT = '/Users/test/OtherProjects';function makeBridge() {- let pickedPath: string | null = TARGET;- let folderStateImpl = async (): Promise<OkFolderState> => 'free';+ let pickedParent: string | null = PARENT;+ let defaultRootImpl = (): Promise<string> => Promise.resolve(PARENT);+ let folderStateImpl = async (_path: string): Promise<OkFolderState> => 'free';+ let createNewImpl = (): Promise<void> => Promise.resolve();const openFolderArgs: unknown[] = [];const folderStateCalls: string[] = [];const bannerCalls: string[] = [];@@ -58,7 +60,7 @@ function makeBridge() {const bridge = {fs: {- defaultProjectsRoot: mock(() => Promise.resolve(PARENT)),+ defaultProjectsRoot: mock(() => defaultRootImpl()),findEnclosingProjectRoot: mock(() => Promise.resolve(null)),findEnclosingGitRoot: mock(() => Promise.resolve(null)),folderState: mock((path: string) => {@@ -70,7 +72,7 @@ function makeBridge() {dialog: {openFolder: mock((options?: unknown) => {openFolderArgs.push(options);- return Promise.resolve(pickedPath);+ return Promise.resolve(pickedParent);}),},project: {@@ -86,7 +88,7 @@ function makeBridge() {sharing: 'shared' | 'local-only';}) => {createNewCalls.push(payload);- return Promise.resolve();+ return createNewImpl();},),open: mock(() => Promise.resolve()),@@ -99,12 +101,18 @@ function makeBridge() {createNewCalls,folderStateCalls,openFolderArgs,- setPickedPath: (next: string | null) => {- pickedPath = next;+ setPickedParent: (next: string | null) => {+ pickedParent = next;+ },+ setDefaultProjectsRootImpl: (next: () => Promise<string>) => {+ defaultRootImpl = next;},setFolderStateImpl: (next: (path: string) => Promise<OkFolderState>) => {folderStateImpl = next;},+ setCreateNewImpl: (next: () => Promise<void>) => {+ createNewImpl = next;+ },};}@@ -115,16 +123,20 @@ async function renderDialog(stub = makeBridge()) {return { ...stub, onOpenChange };}-async function browseAndWaitForTarget(target = TARGET) {- fireEvent.click(screen.getByTestId('create-browse'));+async function waitForLocationHydrate(expected = PARENT) {await waitFor(() => {- expect(screen.getByTestId('create-target-caption').textContent).toBe(target);+ expect(screen.getByTestId('create-location-display').textContent).toContain(expected);},{ timeout: 2000 },);}+async function typeProjectName(value: string) {+ const input = screen.getByTestId('create-name') as HTMLInputElement;+ fireEvent.change(input, { target: { value } });+}+async function waitForSubmitEnabled() {await waitFor(() => {@@ -143,18 +155,30 @@ describe('CreateProjectDialog runtime wiring', () => {cleanup();});- test('cancel, browse, editor labels, and submit are wired through the mounted form', async () => {+ test('name input is first and submit posts {parent, name} derived from the two fields', async () => {const stub = await renderDialog();const form = screen.getByTestId('create-project-form') as HTMLFormElement;const cancel = screen.getByTestId('create-cancel') as HTMLButtonElement;const submit = screen.getByTestId('create-submit') as HTMLButtonElement;const browse = screen.getByTestId('create-browse') as HTMLButtonElement;+ const nameInput = screen.getByTestId('create-name') as HTMLInputElement;expect(cancel.type).toBe('button');expect(submit.type).toBe('submit');expect(submit.getAttribute('form')).toBe(form.id);expect(browse.type).toBe('button');+ expect(nameInput.tagName).toBe('INPUT');++ const formInputs = Array.from(+ form.querySelectorAll('input, button, [role="checkbox"], [role="radio"]'),+ ) as HTMLElement[];+ const nameIndex = formInputs.indexOf(nameInput);+ const browseIndex = formInputs.indexOf(browse);+ expect(nameIndex).toBeGreaterThanOrEqual(0);+ expect(browseIndex).toBeGreaterThan(nameIndex);++ await waitForLocationHydrate();expect(screen.getByTestId('create-sharing')).not.toBeNull();expect(screen.queryByTestId('create-editor-cursor')).toBeNull();@@ -173,8 +197,7 @@ describe('CreateProjectDialog runtime wiring', () => {expect(stub.onOpenChange).toHaveBeenCalledWith(false);expect(stub.createNewCalls).toEqual([]);- await browseAndWaitForTarget();- expect(stub.openFolderArgs.at(-1)).toEqual({ defaultPath: PARENT });+ await typeProjectName(PROJECT_NAME);await waitForSubmitEnabled();fireEvent.click(submit);@@ -183,7 +206,7 @@ describe('CreateProjectDialog runtime wiring', () => {expect(stub.createNewCalls).toEqual([{parent: PARENT,- name: 'Runtime Project',+ name: PROJECT_NAME,editors: ALL_EDITOR_IDS.filter((id) => id !== 'cursor'),sharing: 'shared',},@@ -192,24 +215,73 @@ describe('CreateProjectDialog runtime wiring', () => {expect(stub.onOpenChange).toHaveBeenLastCalledWith(false);});- test('Create stays enabled with no folder picked; click toasts and does not submit', async () => {+ test('Location hydrates from defaultProjectsRoot and Browse picks a fresh parent', async () => {+ const stub = await renderDialog();++ await waitForLocationHydrate();+ const displayInitial = screen.getByTestId('create-location-display').textContent ?? '';+ expect(displayInitial).toContain(PARENT);++ stub.setPickedParent(SECOND_PARENT);+ fireEvent.click(screen.getByTestId('create-browse'));+ await waitFor(+ () => {+ expect(screen.getByTestId('create-location-display').textContent).toContain(SECOND_PARENT);+ },+ { timeout: 2000 },+ );+ expect((screen.getByTestId('create-name') as HTMLInputElement).value).toBe('');++ expect(stub.openFolderArgs.at(-1)).toEqual({ defaultPath: PARENT });+ });++ test('live caption shows "Will be created at: <location>/<sanitized>" while name non-empty', async () => {+ await renderDialog();+ await waitForLocationHydrate();++ const caption = screen.getByTestId('create-target-caption');+ expect(caption.textContent ?? '').toBe('');++ await typeProjectName('Plant Care');+ await waitFor(+ () => {+ expect(screen.getByTestId('create-target-caption').textContent).toContain(+ `${PARENT}/Plant Care`,+ );+ },+ { timeout: 2000 },+ );++ await typeProjectName('');+ await waitFor(+ () => {+ expect(screen.getByTestId('create-target-caption').textContent ?? '').toBe('');+ },+ { timeout: 2000 },+ );+ });++ test('Create stays enabled with an empty name; click toasts hint and does not submit', async () => {toastErrorSpy.mockClear();const stub = await renderDialog();+ await waitForLocationHydrate();const submit = screen.getByTestId('create-submit') as HTMLButtonElement;expect(submit.disabled).toBe(false);fireEvent.click(submit);await new Promise((resolve) => setTimeout(resolve, 0));- expect(toastErrorSpy).toHaveBeenCalledWith('Please select a folder');++ expect(toastErrorSpy).toHaveBeenCalledWith('Enter a project name');expect(stub.createNewCalls).toEqual([]);expect(stub.onOpenChange).not.toHaveBeenCalled();});test('selecting Local only carries through to the createNew payload', async () => {const stub = await renderDialog();+ await waitForLocationHydrate();- await browseAndWaitForTarget();+ await typeProjectName(PROJECT_NAME);await waitForSubmitEnabled();await userEvent.click(screen.getByTestId('create-sharing-local-only'));@@ -222,8 +294,89 @@ describe('CreateProjectDialog runtime wiring', () => {expect(stub.createNewCalls[0]?.sharing).toBe('local-only');});+ test('name resolving to a non-empty folder shows inline name-taken error and disables Create', async () => {+ const stub = makeBridge();+ const TAKEN_NAME = 'Existing Notes';+ stub.setFolderStateImpl(async (path) =>+ path === `${PARENT}/${TAKEN_NAME}` ? 'exists-nonempty' : 'free',+ );+ await renderDialog(stub);+ await waitForLocationHydrate();++ await typeProjectName(TAKEN_NAME);++ await waitFor(+ () => {+ expect(screen.queryByTestId('create-name-error-taken')).not.toBeNull();+ expect((screen.getByTestId('create-submit') as HTMLButtonElement).disabled).toBe(true);+ },+ { timeout: 2000 },+ );+ expect(screen.queryByTestId('create-subfolder-rescue')).toBeNull();+ expect(stub.bannerCalls).toContain('nonempty');++ await typeProjectName('Fresh Name');+ await waitFor(+ () => {+ expect(screen.queryByTestId('create-name-error-taken')).toBeNull();+ },+ { timeout: 2000 },+ );+ });++ test('name that sanitizes to empty shows inline sanitize-erased error and disables Create', async () => {+ await renderDialog();+ await waitForLocationHydrate();++ await typeProjectName('....');+ await waitFor(+ () => {+ expect(screen.queryByTestId('create-name-error-erased')).not.toBeNull();+ expect((screen.getByTestId('create-submit') as HTMLButtonElement).disabled).toBe(true);+ },+ { timeout: 2000 },+ );+ });++ test('name field a11y: aria-invalid and aria-describedby compose the validation announcement', async () => {+ const stub = makeBridge();+ const TAKEN = 'Existing Notes';+ stub.setFolderStateImpl(async (path) =>+ path === `${PARENT}/${TAKEN}` ? 'exists-nonempty' : 'free',+ );+ await renderDialog(stub);+ await waitForLocationHydrate();++ const nameInput = screen.getByTestId('create-name') as HTMLInputElement;++ await typeProjectName('Fresh Name');+ await waitFor(() => {+ expect(nameInput.getAttribute('aria-invalid')).toBe('false');+ });+ const captionId = screen.getByTestId('create-target-caption').id;+ expect(captionId).not.toBe('');+ expect(nameInput.getAttribute('aria-describedby')).toBe(captionId);++ await typeProjectName(TAKEN);+ await waitFor(() => {+ expect(nameInput.getAttribute('aria-invalid')).toBe('true');+ });+ const takenError = screen.getByTestId('create-name-error-taken');+ expect(takenError.getAttribute('role')).toBe('alert');+ const describedBy = (nameInput.getAttribute('aria-describedby') ?? '').split(' ');+ expect(describedBy).toContain(captionId);+ expect(describedBy).toContain(takenError.id);++ await typeProjectName('....');+ await waitFor(() => {+ expect(nameInput.getAttribute('aria-invalid')).toBe('true');+ });+ expect(screen.getByTestId('create-name-error-erased').getAttribute('role')).toBe('alert');+ });+test('clicking the config-sharing info tooltip does not submit the form', async () => {const stub = await renderDialog();+ await waitForLocationHydrate();const info = screen.getByTestId('config-sharing-info') as HTMLButtonElement;expect(info.type).toBe('button');@@ -234,45 +387,121 @@ describe('CreateProjectDialog runtime wiring', () => {expect(stub.onOpenChange).not.toHaveBeenCalled();});- test('subfolder rescue sticks through a free re-probe and resets on a fresh Browse pick', async () => {- const stub = makeBridge();- stub.setFolderStateImpl(async (path) => (path === TARGET ? 'exists-nonempty' : 'free'));- await renderDialog(stub);+ test('a diverging name shows the non-blocking "Will be saved as" hint and keeps Create enabled', async () => {+ await renderDialog();+ await waitForLocationHydrate();- await browseAndWaitForTarget();+ await typeProjectName('Plant/Care');await waitFor(() => {- expect(screen.getByTestId('create-subfolder-rescue')).not.toBeNull();+ const hint = screen.queryByTestId('create-name-hint-diverged');+ expect(hint).not.toBeNull();+ expect(hint?.textContent).toContain('Plant-Care');},{ timeout: 2000 },);- expect(stub.bannerCalls).toContain('nonempty');+ expect(screen.getByTestId('create-target-caption').textContent).toContain(+ `${PARENT}/Plant-Care`,+ );+ await waitForSubmitEnabled();- fireEvent.change(screen.getByTestId('create-subfolder-input'), {- target: { value: 'Nested Notes' },- });+ const divergedHint = screen.getByTestId('create-name-hint-diverged');+ expect(divergedHint.getAttribute('role')).toBe('status');+ const divergedNameInput = screen.getByTestId('create-name') as HTMLInputElement;+ expect(divergedNameInput.getAttribute('aria-invalid')).toBe('false');+ const divergedDescribedBy = (divergedNameInput.getAttribute('aria-describedby') ?? '').split(+ ' ',+ );+ expect(divergedDescribedBy).toContain(divergedHint.id);+ expect(divergedDescribedBy).toContain(screen.getByTestId('create-target-caption').id);+ await typeProjectName('');await waitFor(() => {- expect((screen.getByTestId('create-subfolder-input') as HTMLInputElement).value).toBe(- 'Nested Notes',- );- expect((screen.getByTestId('create-submit') as HTMLButtonElement).disabled).toBe(false);+ expect(screen.queryByTestId('create-name-hint-diverged')).toBeNull();},{ timeout: 2000 },);+ });- stub.setPickedPath(SECOND_TARGET);- stub.setFolderStateImpl(async () => 'free');- fireEvent.click(screen.getByTestId('create-browse'));+ test('Location shows actionable copy (not a stuck spinner) when defaultProjectsRoot rejects; Browse still works', async () => {+ const stub = makeBridge();+ stub.setDefaultProjectsRootImpl(() => Promise.reject(new Error('no default root')));+ await renderDialog(stub);++ await waitFor(+ () => {+ const display = screen.getByTestId('create-location-display').textContent ?? '';+ expect(display).not.toContain('Resolving default location');+ expect(display).toContain('No location selected');+ },+ { timeout: 2000 },+ );+ stub.setPickedParent(SECOND_PARENT);+ fireEvent.click(screen.getByTestId('create-browse'));await waitFor(() => {- expect(screen.getByTestId('create-target-caption').textContent).toBe(SECOND_TARGET);- expect(screen.queryByTestId('create-subfolder-rescue')).toBeNull();+ expect(screen.getByTestId('create-location-display').textContent).toContain(SECOND_PARENT);},{ timeout: 2000 },);});++ test('createNew failure surfaces the inline error strip, keeps the dialog open, and re-enables Create', async () => {+ const stub = makeBridge();+ stub.setCreateNewImpl(() =>+ Promise.reject(+ new Error(`target-not-empty: Target folder is not empty: ${PARENT}/${PROJECT_NAME}`),+ ),+ );+ const { onOpenChange } = await renderDialog(stub);+ await waitForLocationHydrate();++ await typeProjectName(PROJECT_NAME);+ await waitForSubmitEnabled();+ fireEvent.click(screen.getByTestId('create-submit'));++ await waitFor(() => {+ expect(screen.queryByTestId('create-submit-error')).not.toBeNull();+ });+ expect(screen.getByTestId('create-submit-error').getAttribute('role')).toBe('alert');+ expect(stub.createNewCalls).toHaveLength(1);+ expect(onOpenChange).not.toHaveBeenCalledWith(false);++ await waitFor(() => {+ expect((screen.getByTestId('create-submit') as HTMLButtonElement).disabled).toBe(false);+ });+ });++ test('while createNew is in-flight the busy guard blocks dialog dismissal until it settles', async () => {+ const stub = makeBridge();+ let releaseCreate: () => void = () => {};+ stub.setCreateNewImpl(+ () =>+ new Promise<void>((resolve) => {+ releaseCreate = resolve;+ }),+ );+ const { onOpenChange } = await renderDialog(stub);+ await waitForLocationHydrate();++ await typeProjectName(PROJECT_NAME);+ await waitForSubmitEnabled();+ fireEvent.click(screen.getByTestId('create-submit'));++ await waitFor(() => {+ expect((screen.getByTestId('create-submit') as HTMLButtonElement).disabled).toBe(true);+ });++ fireEvent.click(screen.getByRole('button', { name: 'Close' }));+ await new Promise((resolve) => setTimeout(resolve, 0));+ expect(onOpenChange).not.toHaveBeenCalledWith(false);++ releaseCreate();+ await waitFor(() => {+ expect(onOpenChange).toHaveBeenCalledWith(false);+ });+ });});diff --git a/packages/app/src/components/CreateProjectDialog.test.tsx b/packages/app/src/components/CreateProjectDialog.test.tsxindex 5865b1b56..015e24f4c 100644--- a/packages/app/src/components/CreateProjectDialog.test.tsx+++ b/packages/app/src/components/CreateProjectDialog.test.tsx@@ -3,7 +3,6 @@ import {basenamePreview,CreateProjectDialog,computeCascade,- dirnamePreview,joinPathPreview,parseCreateNewError,} from './CreateProjectDialog';@@ -52,49 +51,6 @@ describe('basenamePreview', () => {});});-describe('dirnamePreview', () => {- test('extracts the parent directory from a POSIX path', () => {- expect(dirnamePreview('/Users/me/Projects/Foo')).toBe('/Users/me/Projects');- });-- test('extracts the parent directory from a Windows path', () => {- expect(dirnamePreview('C:\\Users\\me\\Projects\\Foo')).toBe('C:\\Users\\me\\Projects');- });-- test('tolerates trailing separators', () => {- expect(dirnamePreview('/Users/me/Projects/Foo/')).toBe('/Users/me/Projects');- expect(dirnamePreview('C:\\Users\\me\\Foo\\')).toBe('C:\\Users\\me');- });-- test('returns empty string when there is no parent (single segment)', () => {- expect(dirnamePreview('Foo')).toBe('');- });-- test('returns the root separator when path is one segment under root', () => {- expect(dirnamePreview('/foo')).toBe('/');- expect(dirnamePreview('\\foo')).toBe('\\');- });-- test('returns empty string for empty input', () => {- expect(dirnamePreview('')).toBe('');- });-- test('round-trips with basenamePreview at the submit-time decomposition site', () => {- const inputs = [- '/Users/me/Projects/MyNotes',- '/Users/me/Projects/MyNotes/',- 'C:\\Users\\me\\Projects\\MyNotes',- ];- for (const picked of inputs) {- const parent = dirnamePreview(picked);- const basename = basenamePreview(picked);- expect(parent).not.toBe('');- expect(basename).not.toBe('');- expect(joinPathPreview(parent, basename)).toBe(picked.replace(/[/\\]+$/, ''));- }- });-});-describe('computeCascade', () => {const baseInput = {parent: '/Users/me/Projects',@@ -226,6 +182,7 @@ describe('CreateProjectDialog module', () => {expect(typeof mod.CreateProjectDialog).toBe('function');expect(typeof mod.computeCascade).toBe('function');expect(typeof mod.joinPathPreview).toBe('function');+ expect(typeof mod.basenamePreview).toBe('function');expect(typeof mod.parseCreateNewError).toBe('function');});});diff --git a/packages/app/src/components/CreateProjectDialog.tsx b/packages/app/src/components/CreateProjectDialog.tsxindex 076b117fc..aa2f13402 100644--- a/packages/app/src/components/CreateProjectDialog.tsx+++ b/packages/app/src/components/CreateProjectDialog.tsx@@ -64,14 +64,11 @@ type CreateNewError =| { reason: 'discovery-failed'; message: string }| { reason: 'unknown'; message: string };-type _CreateNewReasonDriftPin =- | (CreateNewProjectFailureReason extends Exclude<CreateNewError['reason'], 'unknown'>- ? true- : false)- | (Exclude<CreateNewError['reason'], 'unknown'> extends CreateNewProjectFailureReason- ? true- : false);-const _CREATE_NEW_REASON_DRIFT_PIN: _CreateNewReasonDriftPin = true;+type _Equals<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;+const _CREATE_NEW_REASON_DRIFT_PIN: _Equals<+ CreateNewProjectFailureReason,+ Exclude<CreateNewError['reason'], 'unknown'>+> = true;void _CREATE_NEW_REASON_DRIFT_PIN;interface CreateProjectDialogProps {@@ -93,19 +90,6 @@ export function basenamePreview(path: string): string {return segments.length > 0 ? (segments[segments.length - 1] ?? path) : path;}-export function dirnamePreview(path: string): string {- if (path === '') return '';- const trimmed = path.replace(/[/\\]+$/, '');- if (trimmed === '') return '';- const sepMatch = trimmed.match(/[/\\][^/\\]+$/);- if (sepMatch === null) return '';- const cutAt = trimmed.length - sepMatch[0].length;- if (cutAt === 0) {- return trimmed[0] ?? '';- }- return trimmed.slice(0, cutAt);-}-export function computeCascade(input: {parent: string;sanitizedName: string;@@ -162,8 +146,12 @@ function errorCopy(err: CreateNewError): MessageDescriptor {export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjectDialogProps) {const { t } = useLingui();const formId = useId();- const [picked, setPicked] = useState('');- const [defaultPath, setDefaultPath] = useState('');+ const nameInputId = useId();+ const captionId = useId();+ const nameErrorId = useId();+ const [location, setLocation] = useState('');+ const [locationResolving, setLocationResolving] = useState(false);+ const [name, setName] = useState('');const [editorIds, setEditorIds] = useState<ReadonlySet<OkMcpWiringEditorId>>(() => new Set(ALL_EDITOR_IDS),);@@ -175,13 +163,11 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecconst [submitError, setSubmitError] = useState<CreateNewError | null>(null);const [removeGitState, setRemoveGitState] = useState<RemoveGitState>({ kind: 'idle' });const [probeNonce, setProbeNonce] = useState(0);- const [needsSubfolder, setNeedsSubfolder] = useState(false);- const [subfolderName, setSubfolderName] = useState('');const firedBanners = useRef<Set<CreateNewBannerKind>>(new Set());const abortRef = useRef<AbortController | null>(null);const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);- const browseButtonRef = useRef<HTMLButtonElement | null>(null);+ const nameInputRef = useRef<HTMLInputElement | null>(null);const removeGitCallIdRef = useRef(0);useEffect(() => {@@ -191,28 +177,30 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecsetCascade({ kind: 'idle' });setProbeLifecycle('idle');setBusy(false);- setPicked('');+ setName('');setEditorIds(new Set(ALL_EDITOR_IDS));setSharing('shared');setAdvancedOpen(false);setRemoveGitState({ kind: 'idle' });- setNeedsSubfolder(false);- setSubfolderName('');removeGitCallIdRef.current += 1;let cancelled = false;- setDefaultPath('');+ setLocation('');+ setLocationResolving(true);bridge.fs.defaultProjectsRoot().then((root) => {- if (!cancelled) setDefaultPath(root);+ if (!cancelled) setLocation(root);}).catch((err) => {console.warn('[CreateProjectDialog] defaultProjectsRoot probe failed:', err);+ })+ .finally(() => {+ if (!cancelled) setLocationResolving(false);});const raf = requestAnimationFrame(() => {- browseButtonRef.current?.focus();+ nameInputRef.current?.focus();});return () => {@@ -227,22 +215,13 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecif (debounceRef.current !== null) clearTimeout(debounceRef.current);if (abortRef.current !== null) abortRef.current.abort();- if (picked === '') {- setCascade({ kind: 'idle' });- setProbeLifecycle('idle');- return;- }- const subfolderTrimmed = subfolderName.trim();- const subfolderActive = needsSubfolder && subfolderTrimmed !== '';- const parent = subfolderActive ? picked : dirnamePreview(picked);- const sanitized = subfolderActive- ? sanitizeFolderName(subfolderTrimmed)- : sanitizeFolderName(basenamePreview(picked));- if (parent === '' || sanitized === '') {+ const sanitized = sanitizeFolderName(name);+ if (location === '' || sanitized === '') {setCascade({ kind: 'idle' });setProbeLifecycle('idle');return;}+ const parent = location;const target = joinPathPreview(parent, sanitized);const ctrl = new AbortController();@@ -266,9 +245,6 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjectargetState,});setCascade(nextCascade);- if (nextCascade.kind === 'block-nonempty') {- setNeedsSubfolder(true);- }}).catch((err) => {if (ctrl.signal.aborted) return;@@ -282,7 +258,7 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecif (debounceRef.current !== null) clearTimeout(debounceRef.current);ctrl.abort();};- }, [open, picked, bridge, probeNonce, needsSubfolder, subfolderName]);+ }, [open, location, name, bridge, probeNonce]);useEffect(() => {if (!open) return;@@ -335,20 +311,21 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecbridge.project.recordCreateNewBannerShown(banner).catch(() => {});}, [open, cascade, bridge]);- const subfolderTrimmed = subfolderName.trim();- const subfolderActive = needsSubfolder && subfolderTrimmed !== '';- const rawName = picked === '' ? '' : subfolderActive ? subfolderTrimmed : basenamePreview(picked);- const sanitized = picked === '' ? '' : sanitizeFolderName(rawName);- const sanitizeDiverged = picked !== '' && sanitized !== rawName && sanitized !== '';- const sanitizeErased = picked !== '' && rawName !== '' && sanitized === '';- const previewPath = subfolderActive ? joinPathPreview(picked, sanitized) : picked;+ const rawName = name;+ const sanitized = rawName === '' ? '' : sanitizeFolderName(rawName);+ const sanitizeDiverged = rawName !== '' && sanitized !== rawName && sanitized !== '';+ const sanitizeErased = rawName !== '' && sanitized === '';+ const nameTaken = cascade.kind === 'block-nonempty';+ const targetPreview =+ location !== '' && sanitized !== '' ? joinPathPreview(location, sanitized) : '';const canSubmit =!busy &&- picked !== '' &&+ location !== '' &&+ rawName !== '' &&sanitized !== '' &&probeLifecycle === 'idle' &&(cascade.kind === 'free' || cascade.kind === 'confirm-git');- const submitDisabled = busy || (picked !== '' && !canSubmit);+ const submitDisabled = busy || (rawName !== '' && !canSubmit);function toggleEditor(id: OkMcpWiringEditorId) {setEditorIds((prev) => {@@ -361,15 +338,13 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecasync function onBrowse() {try {- const pickedNew = await bridge.dialog.openFolder(- defaultPath !== '' ? { defaultPath } : undefined,+ const pickedParent = await bridge.dialog.openFolder(+ location !== '' ? { defaultPath: location } : undefined,);- if (pickedNew === null) return;- setPicked(pickedNew);+ if (pickedParent === null) return;+ setLocation(pickedParent);setProbeNonce((n) => n + 1);setSubmitError(null);- setNeedsSubfolder(false);- setSubfolderName('');} catch (err) {console.warn('[CreateProjectDialog] dialog.openFolder failed:', err);}@@ -378,8 +353,9 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecasync function onSubmit(e: React.SyntheticEvent<HTMLFormElement, SubmitEvent>) {e.preventDefault();if (busy) return;- if (picked === '') {- toast.error(t`Please select a folder`);+ if (rawName.trim() === '') {+ toast.error(t`Enter a project name`);+ nameInputRef.current?.focus();return;}if (!canSubmit) return;@@ -387,7 +363,7 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecsetSubmitError(null);try {await bridge.project.createNew({- parent: subfolderActive ? picked : dirnamePreview(picked),+ parent: location,name: sanitized,editors: Array.from(editorIds),sharing,@@ -442,6 +418,9 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjec}}+ const nameDescribedBy =+ sanitizeErased || nameTaken || sanitizeDiverged ? `${captionId} ${nameErrorId}` : captionId;+return (<Dialog open={open} onOpenChange={onOpenChangeInternal}><DialogContent className="sm:max-w-lg" data-testid="create-project-dialog">@@ -461,129 +440,111 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjecdata-testid="create-project-form"className="space-y-6">- <div className="flex items-center justify-between gap-4">- <div className="flex min-w-0 flex-col gap-1">- <Label htmlFor="create-location">- <Trans>Location</Trans>- </Label>+ <div className="flex flex-col gap-2">+ <Label htmlFor={nameInputId}>+ <Trans>Project name</Trans>+ </Label>+ <Input+ id={nameInputId}+ ref={nameInputRef}+ value={name}+ placeholder={t`Team Wiki`}+ onChange={(e) => setName(e.target.value)}+ disabled={busy}+ autoComplete="off"+ aria-invalid={sanitizeErased || nameTaken}+ aria-describedby={nameDescribedBy}+ data-testid="create-name"+ />+ {sanitizeErased ? (+ <p+ id={nameErrorId}+ role="alert"+ className="text-1sm text-destructive"+ data-testid="create-name-error-erased"+ >+ <Trans>Add at least one letter or number.</Trans>+ </p>+ ) : nameTaken ? (<p- id="create-target-caption"- className="text-1sm text-muted-foreground wrap-break-word"+ id={nameErrorId}+ role="alert"+ className="text-1sm text-destructive"+ data-testid="create-name-error-taken"+ >+ <Trans>+ A folder named <code className="font-mono break-all">{sanitized}</code> already+ has files here. Pick a different name.+ </Trans>+ </p>+ ) : sanitizeDiverged ? (+ <p+ id={nameErrorId}+ role="status"aria-live="polite"- data-testid="create-target-caption"+ className="text-1sm text-muted-foreground"+ data-testid="create-name-hint-diverged">- {previewPath === '' ? (- <Trans>Select or create a folder for your new project</Trans>- ) : (- previewPath- )}+ <Trans>+ Will be saved as <code className="font-mono break-all">{sanitized}</code>.+ </Trans></p>- </div>- <Button- id="create-location"- ref={browseButtonRef}- type="button"- variant="outline"- className="shrink-0"- disabled={busy}- onClick={() => void onBrowse()}- aria-describedby="create-target-caption"- data-testid="create-browse"- >- <Trans>Browse</Trans>- </Button>+ ) : null}</div>- {needsSubfolder ? (- <div className="flex flex-col gap-2" data-testid="create-subfolder-rescue">- <Label htmlFor="create-subfolder-name">- <Trans>Subfolder name</Trans>- </Label>- <Input- id="create-subfolder-name"- value={subfolderName}- placeholder="my-project"- onChange={(e) => setSubfolderName(e.target.value)}+ <div className="flex flex-col gap-2">+ {/* "Location" is a visual label for the read-only path display.+ No htmlFor/association: the value sits in a non-labelable+ <div> (a label can only bind to a form control), so a binding+ here would be a dead attribute. AT reads the label then the+ path in document order. The display is a <div>, not a shadcn+ <Input readOnly>, because it renders three mutually exclusive+ inner states (resolved path / "Resolving" / "No location+ selected") that a single `value` string can't express. */}+ <Label>+ <Trans>Location</Trans>+ </Label>+ <div className="flex items-center gap-2">+ <div+ className="min-w-0 flex-1 rounded-md border border-input bg-muted/50 px-2.5 py-1 text-sm text-foreground wrap-break-word"+ data-testid="create-location-display"+ >+ {location !== '' ? (+ location+ ) : locationResolving ? (+ <span className="text-muted-foreground">+ <Trans>Resolving default location</Trans>+ </span>+ ) : (+ <span className="text-muted-foreground">+ <Trans>No location selected. Use Browse to choose a folder.</Trans>+ </span>+ )}+ </div>+ <Button+ type="button"+ variant="outline"+ className="shrink-0"disabled={busy}- autoFocus- aria-invalid={- subfolderActive && (sanitizeErased || cascade.kind === 'block-nonempty')- }- data-testid="create-subfolder-input"- />- {subfolderTrimmed === '' ? (- <p- role="status"- aria-live="polite"- className="text-1sm text-muted-foreground"- data-testid="create-subfolder-empty-error"- >- <Trans>- This folder already has files. Add a name to create a new subfolder inside it.- </Trans>- </p>- ) : sanitizeErased ? (- <p- role="alert"- className="text-1sm text-destructive"- data-testid="create-subfolder-erased-error"- >- <Trans>- This name has no characters that are safe for a folder identifier. Try a name- with at least one letter or number.- </Trans>- </p>- ) : cascade.kind === 'block-nonempty' ? (- <p- role="alert"- className="text-1sm text-destructive"- data-testid="create-subfolder-taken-error"- >- <Trans>- A folder named <code className="font-mono break-all">{sanitized}</code>{' '}- already has files at this location. Pick a different name.- </Trans>- </p>- ) : sanitizeDiverged ? (- <p className="text-1sm text-muted-foreground">- <Trans>- Will be saved as <code className="font-mono break-all">{sanitized}</code>.- </Trans>- </p>- ) : null}- </div>- ) : null}-- {!needsSubfolder && sanitizeDiverged ? (- <div- role="status"- aria-live="polite"- className="rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200"- data-testid="create-banner-sanitize-diverged"- >- <Trans>- <code className="font-mono break-all">{rawName}</code> has characters unsafe for- the on-disk identifier, so the project will be created as{' '}- <code className="font-mono break-all">{sanitized}</code>. Click Browse to pick a- safer name.- </Trans>+ onClick={() => void onBrowse()}+ data-testid="create-browse"+ >+ <Trans>Browse</Trans>+ </Button></div>- ) : null}-- {!needsSubfolder && sanitizeErased ? (- <div- role="status"+ <p+ id={captionId}+ className="text-1sm text-muted-foreground wrap-break-word"aria-live="polite"- className="rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200"- data-testid="create-banner-sanitize-erased"+ data-testid="create-target-caption">- <Trans>- The folder name <code className="font-mono break-all">{rawName}</code> can't be- used as a project identifier — it has no characters left after sanitization. Click- Browse to pick a folder whose name contains at least one alphanumeric character.- </Trans>- </div>- ) : null}+ {targetPreview !== '' ? (+ <Trans>+ Will be created at: <code className="font-mono break-all">{targetPreview}</code>+ </Trans>+ ) : null}+ </p>+ </div><CascadeBannercascade={cascade}@@ -810,5 +771,7 @@ function CascadeBanner({</div>);}+ const _exhaustive: never = cascade;+ void _exhaustive;return null;}diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.jsonindex 3d8d5df79..951c159d1 100644--- a/packages/app/src/locales/en/messages.json+++ b/packages/app/src/locales/en/messages.json@@ -185,6 +185,7 @@["path"],". Agents that reference this template by name will fail until it's recreated or replaced by one in a parent folder."],+ "5OqaJi": ["Enter a project name"],"5QGTaA": ["Could not copy relative path"],"5SwVv1": ["Not installed"],"5Tk8Fb": ["Loading files"],@@ -282,6 +283,11 @@"7PNNNs": ["This sends content off your machine"],"7PzzBU": ["User"],"7_bFEL": ["Drag ", ["patternText"], " to reorder"],+ "7apDiJ": [+ "A folder named <0>",+ ["sanitized"],+ "</0> already has files here. Pick a different name."+ ],"7d1a0d": ["Public"],"7hctf2": ["Describe the project you want to create"],"7kdoVR": ["Open the Open with AI menu for the current editor selection."],@@ -289,7 +295,6 @@"Open Knowledge is using a GitHub account provided by the gh CLI. There's no separate Open Knowledge credential to disconnect."],"7qRHf0": ["Install for Claude Chat & Cowork"],- "7wPFtg": ["Please select a folder"],"80c4-P": ["Code copied to clipboard"],"81H_23": ["Add properties"],"881Uwh": ["Delete selected table"],@@ -328,6 +333,7 @@"8eW0WQ": ["No matching repositories."],"8fRyLo": ["Invalid patch payload"],"8fc_3j": ["Protected branch — cannot push"],+ "8m8diM": ["No location selected. Use Browse to choose a folder."],"8tjQCz": ["Explore"],"8uAWix": ["This template lives in a parent folder — deleting it affects every folder beneath it that doesn't define its own version."@@ -633,9 +639,6 @@"JLUTgi": ["No tags yet — author `#tagname` in any doc to populate the index."],"JLzQi_": ["Close ", ["accessibleLabel"]],"JOcPqH": ["Bring a remote repository onto this machine."],- "JUamR6": [- "This name has no characters that are safe for a folder identifier. Try a name with at least one letter or number."- ],"JWsZlx": ["Open a project to edit."],"JZ8cO6": ["Light, dark, or follow the OS."],"Jejur6": ["Couldn't load document"],@@ -756,7 +759,6 @@"NRSLBe": [["diffMin"], "m ago"],"NSnIUP": ["Two-page (even)"],"NUr4kz": ["A reusable starting point for new documents in this folder."],- "NYUhy5": ["Subfolder name"],"N_7kkF": ["Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."],@@ -808,6 +810,7 @@"OuY8t9": ["Open in current branch"],"OvEjsP": ["Copying..."],"Oxyd5f": ["Pick a name"],+ "OyIC0Q": ["Project name"],"P-ye9o": ["Could not open folder picker"],"P3NS4G": ["Pattern syntax error (line ", ["lineNumber"], "): ", ["message"]],"P3hnm0": ["File too large to open"],@@ -1128,6 +1131,7 @@],"_K2CvV": ["Template"],"_PACVa": ["Release notes"],+ "_PBJRl": ["Add at least one letter or number."],"_QwkMu": ["No matching paths"],"_TDESN": ["Network error - ", ["kind"], " \"", ["createdPath"], "\" still exists on disk"],"_TF8ep": ["Failed to render PDF"],@@ -1195,11 +1199,6 @@"c5rF4v": ["What is this knowledge base for?"],"c863eW": ["Could not switch to ", ["shareBranch"], ". Try switching manually."],"c8iK2Y": ["No templates found."],- "cBbVqQ": [- "The folder name <0>",- ["rawName"],- "</0> can't be used as a project identifier — it has no characters left after sanitization. Click Browse to pick a folder whose name contains at least one alphanumeric character."- ],"cEoyWz": ["Add item to ", ["keyName"]],"cF9DyA": ["Reconnecting after server restart"],"cIptmH": ["In the Claude Desktop App"],@@ -1211,6 +1210,7 @@["conflictCount", "plural", { "one": ["#", " conflict"], "other": ["#", " conflicts"] }]],"cUk6TF": ["Sync failed — check the server logs for details."],+ "cV7LOw": ["Team Wiki"],"cZGNlb": ["Add another pattern"],"cZI5AL": ["OK Desktop"],"cZ_8zB": ["Stays on this computer."],@@ -1327,7 +1327,6 @@"gp3I7-": ["Before syncing, set your identity for git commits:"],"gtEbeW": ["Highlight"],"h06R3C": ["No pages are missing outgoing graph links."],- "h29Sd6": ["Select or create a folder for your new project"],"h6EvY-": ["This will replace the current document content with the version from <0>",["relative"],@@ -1346,7 +1345,6 @@"hDoLrm": ["Remove ", ["projectName"], " from recent projects"],"hGmuTc": ["Docs tagged #", ["tagDocsName"]],"hHMv6l": ["Delete block"],- "hJu2pH": ["This folder already has files. Add a name to create a new subfolder inside it."],"hSBIG-": ["A title, description, tags — anything that describes this folder."],"hSySVc": ["Install handoff failed: ", ["msg"]],"hXUWyd": ["Value is required"],@@ -1375,6 +1373,7 @@"iEYxO4": ["Show thumbnails"],"iGCs04": ["No templates available"],"iH8pgl": ["Back"],+ "iHAJDj": ["Resolving default location"],"iKSP5j": ["Word wrap"],"iMkWoF": ["Turn on"],"iNFKkm": ["No diff."],@@ -1442,6 +1441,7 @@],"kYL1lH": ["Agent activity"],"k_pade": ["Config sharing is now shared. Commit the OK files to share with your team."],+ "k_yIIc": ["Will be created at: <0>", ["targetPreview"], "</0>"],"kdzzOK": ["Off — search ranks by keyword only. No content leaves this computer."],"keNFEd": ["Set identity"],"kj9pAE": ["Creating page"],@@ -1734,11 +1734,6 @@"t18QYR": ["Unpin ", ["accessibleLabel"]],"t2TkQ3": ["Sync paused — resolve conflicts to resume."],"tAPZEx": ["Below"],- "tCelbM": [- "A folder named <0>",- ["sanitized"],- "</0> already has files at this location. Pick a different name."- ],"tP5DDk": ["Apply link"],"tUvUfp": ["Use a folder you already have."],"tW_yvQ": ["Expand ", ["docName"]],@@ -1921,13 +1916,6 @@"yzGPkm": ["Expand graph"],"z0a2EA": ["Diagram from Mermaid source — flowchart, sequence, class, state, ER, gantt, pie."],"z1uNN0": ["No emoji found."],- "z2G3EK": [- "<0>",- ["rawName"],- "</0> has characters unsafe for the on-disk identifier, so the project will be created as <1>",- ["sanitized"],- "</1>. Click Browse to pick a safer name."- ],"z2JdQ-": ["Config sharing unchanged — see details below."],"z5pqI8": ["Cannot upload: no document is open"],"z60Lgn": [diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex 6e020870d..40a70279f 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -387,10 +387,6 @@ msgstr "<{componentName}> isn't a known component. Copy the source to use it elsmsgid "<{descriptorLabel}> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block."msgstr "<{descriptorLabel}> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block."-#: src/components/CreateProjectDialog.tsx-msgid "<0>{rawName}</0> has characters unsafe for the on-disk identifier, so the project will be created as <1>{sanitized}</1>. Click Browse to pick a safer name."-msgstr "<0>{rawName}</0> has characters unsafe for the on-disk identifier, so the project will be created as <1>{sanitized}</1>. Click Browse to pick a safer name."-#: src/editor/components/Mirror.tsxmsgid "<0>Mirror — pick a source.</0> Set <1>src</1> + <2>anchor</2> via the property panel to point at a <3><MirrorSource></3> elsewhere."msgstr "<0>Mirror — pick a source.</0> Set <1>src</1> + <2>anchor</2> via the property panel to point at a <3><MirrorSource></3> elsewhere."@@ -408,8 +404,8 @@ msgid "📝 or assets/icon.png"msgstr "📝 or assets/icon.png"#: src/components/CreateProjectDialog.tsx-msgid "A folder named <0>{sanitized}</0> already has files at this location. Pick a different name."-msgstr "A folder named <0>{sanitized}</0> already has files at this location. Pick a different name."+msgid "A folder named <0>{sanitized}</0> already has files here. Pick a different name."+msgstr "A folder named <0>{sanitized}</0> already has files here. Pick a different name."#: src/components/settings/SearchSection.tsxmsgid "A key is set, but the embeddings provider rejected it or was unreachable — search fell back to keyword matching. Check the key in <0>Settings → Account</0> and your provider settings."@@ -525,6 +521,10 @@ msgstr "Add a starter pack"msgid "Add another pattern"msgstr "Add another pattern"+#: src/components/CreateProjectDialog.tsx+msgid "Add at least one letter or number."+msgstr "Add at least one letter or number."+#: src/lib/keyboard-shortcuts.tsmsgid "Add cursors or select matching occurrences through CodeMirror."msgstr "Add cursors or select matching occurrences through CodeMirror."@@ -2154,6 +2154,10 @@ msgstr "Enter a folder name (e.g. brain)."msgid "Enter a name for this template."msgstr "Enter a name for this template."+#: src/components/CreateProjectDialog.tsx+msgid "Enter a project name"+msgstr "Enter a project name"+#: src/components/CloneDialog.tsxmsgid "Enter a repository URL or owner/repo"msgstr "Enter a repository URL or owner/repo"@@ -3619,6 +3623,10 @@ msgstr "No language match."msgid "No links yet. Add wiki links or markdown links to build a graph."msgstr "No links yet. Add wiki links or markdown links to build a graph."+#: src/components/CreateProjectDialog.tsx+msgid "No location selected. Use Browse to choose a folder."+msgstr "No location selected. Use Browse to choose a folder."+#: src/components/CommandPalette.tsxmsgid "No matching commands."msgstr "No matching commands."@@ -4281,10 +4289,6 @@ msgstr "Pin tab"msgid "Plain"msgstr "Plain"-#: src/components/CreateProjectDialog.tsx-msgid "Please select a folder"-msgstr "Please select a folder"-#: src/components/settings/SettingsDialogBody.tsx#: src/components/settings/SettingsDialogShell.tsxmsgid "Preferences"@@ -4330,6 +4334,10 @@ msgstr "Project"msgid "Project folder created, but git init failed. Try again."msgstr "Project folder created, but git init failed. Try again."+#: src/components/CreateProjectDialog.tsx+msgid "Project name"+msgstr "Project name"+#: src/components/FileTree.tsx#: src/components/SeedDialog.tsxmsgid "Project root"@@ -4657,6 +4665,10 @@ msgstr "Resize {handleKey}"msgid "Resolve conflict in your terminal"msgstr "Resolve conflict in your terminal"+#: src/components/CreateProjectDialog.tsx+msgid "Resolving default location"+msgstr "Resolving default location"+#: src/components/CloneDialog.tsxmsgid "Resolving deltas"msgstr "Resolving deltas"@@ -4926,10 +4938,6 @@ msgstr "Select every visible file-tree row when focus is in the Files sidebar."msgid "Select next occurrence"msgstr "Select next occurrence"-#: src/components/CreateProjectDialog.tsx-msgid "Select or create a folder for your new project"-msgstr "Select or create a folder for your new project"-#: src/lib/keyboard-shortcuts.tsmsgid "Select the full source document."msgstr "Select the full source document."@@ -5318,10 +5326,6 @@ msgstr "Stored on this machine."msgid "Strikethrough"msgstr "Strikethrough"-#: src/components/CreateProjectDialog.tsx-msgid "Subfolder name"-msgstr "Subfolder name"-#: src/lib/keyboard-shortcuts.tsmsgid "Suggestion menu navigation"msgstr "Suggestion menu navigation"@@ -5463,6 +5467,10 @@ msgstr "Task list"msgid "Task List"msgstr "Task List"+#: src/components/CreateProjectDialog.tsx+msgid "Team Wiki"+msgstr "Team Wiki"+#: src/components/TemplateEditDialog.tsxmsgid "Template"msgstr "Template"@@ -5554,10 +5562,6 @@ msgstr "The file is in your Trash; the file-watcher will reconcile."msgid "The file on disk, and the id agents use. It can't be changed later."msgstr "The file on disk, and the id agents use. It can't be changed later."-#: src/components/CreateProjectDialog.tsx-msgid "The folder name <0>{rawName}</0> can't be used as a project identifier — it has no characters left after sanitization. Click Browse to pick a folder whose name contains at least one alphanumeric character."-msgstr "The folder name <0>{rawName}</0> can't be used as a project identifier — it has no characters left after sanitization. Click Browse to pick a folder whose name contains at least one alphanumeric character."-#: src/components/SeedDialog.tsxmsgid "The folders and templates are in place; there's nothing left to scaffold."msgstr "The folders and templates are in place; there's nothing left to scaffold."@@ -5644,10 +5648,6 @@ msgstr "This file could not be found."msgid "This file is too large to open in the built-in text editor (1 MB limit). Use Open file below to open it in another app."msgstr "This file is too large to open in the built-in text editor (1 MB limit). Use Open file below to open it in another app."-#: src/components/CreateProjectDialog.tsx-msgid "This folder already has files. Add a name to create a new subfolder inside it."-msgstr "This folder already has files. Add a name to create a new subfolder inside it."-#: src/components/FolderOverview.tsxmsgid "This folder is empty."msgstr "This folder is empty."@@ -5660,10 +5660,6 @@ msgstr "this item"msgid "This looks like a drive root (e.g., C:\\). Scaffolding here will scan an entire drive."msgstr "This looks like a drive root (e.g., C:\\). Scaffolding here will scan an entire drive."-#: src/components/CreateProjectDialog.tsx-msgid "This name has no characters that are safe for a folder identifier. Try a name with at least one letter or number."-msgstr "This name has no characters that are safe for a folder identifier. Try a name with at least one letter or number."-#: src/components/SeedDialog.tsxmsgid "This pack is already set up here."msgstr "This pack is already set up here."@@ -6150,6 +6146,10 @@ msgstr "Wiki link suggestions"msgid "Will be created as <0>{sanitizedName}</0>"msgstr "Will be created as <0>{sanitizedName}</0>"+#: src/components/CreateProjectDialog.tsx+msgid "Will be created at: <0>{targetPreview}</0>"+msgstr "Will be created at: <0>{targetPreview}</0>"+#: src/components/CreateProjectDialog.tsxmsgid "Will be saved as <0>{sanitized}</0>."msgstr "Will be saved as <0>{sanitized}</0>."diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.jsonindex 8f6069ece..9c91bd4ef 100644--- a/packages/app/src/locales/pseudo/messages.json+++ b/packages/app/src/locales/pseudo/messages.json@@ -185,6 +185,7 @@["path"],". Àĝēńţś ţĥàţ ŕēƒēŕēńćē ţĥĩś ţēḿƥĺàţē ƀŷ ńàḿē ŵĩĺĺ ƒàĩĺ ũńţĩĺ ĩţ'ś ŕēćŕēàţēď ōŕ ŕēƥĺàćēď ƀŷ ōńē ĩń à ƥàŕēńţ ƒōĺďēŕ."],+ "5OqaJi": ["Ēńţēŕ à ƥŕōĴēćţ ńàḿē"],"5QGTaA": ["Ćōũĺď ńōţ ćōƥŷ ŕēĺàţĩvē ƥàţĥ"],"5SwVv1": ["Ńōţ ĩńśţàĺĺēď"],"5Tk8Fb": ["Ĺōàďĩńĝ ƒĩĺēś"],@@ -282,6 +283,11 @@"7PNNNs": ["Ţĥĩś śēńďś ćōńţēńţ ōƒƒ ŷōũŕ ḿàćĥĩńē"],"7PzzBU": ["Ũśēŕ"],"7_bFEL": ["Ďŕàĝ ", ["patternText"], " ţō ŕēōŕďēŕ"],+ "7apDiJ": [+ "À ƒōĺďēŕ ńàḿēď <0>",+ ["sanitized"],+ "</0> àĺŕēàďŷ ĥàś ƒĩĺēś ĥēŕē. Ƥĩćķ à ďĩƒƒēŕēńţ ńàḿē."+ ],"7d1a0d": ["Ƥũƀĺĩć"],"7hctf2": ["Ďēśćŕĩƀē ţĥē ƥŕōĴēćţ ŷōũ ŵàńţ ţō ćŕēàţē"],"7kdoVR": ["Ōƥēń ţĥē Ōƥēń ŵĩţĥ ÀĨ ḿēńũ ƒōŕ ţĥē ćũŕŕēńţ ēďĩţōŕ śēĺēćţĩōń."],@@ -289,7 +295,6 @@"Ōƥēń Ķńōŵĺēďĝē ĩś ũśĩńĝ à ĜĩţĤũƀ àććōũńţ ƥŕōvĩďēď ƀŷ ţĥē ĝĥ ĆĹĨ. Ţĥēŕē'ś ńō śēƥàŕàţē Ōƥēń Ķńōŵĺēďĝē ćŕēďēńţĩàĺ ţō ďĩśćōńńēćţ."],"7qRHf0": ["Ĩńśţàĺĺ ƒōŕ Ćĺàũďē Ćĥàţ & Ćōŵōŕķ"],- "7wPFtg": ["Ƥĺēàśē śēĺēćţ à ƒōĺďēŕ"],"80c4-P": ["Ćōďē ćōƥĩēď ţō ćĺĩƥƀōàŕď"],"81H_23": ["Àďď ƥŕōƥēŕţĩēś"],"881Uwh": ["Ďēĺēţē śēĺēćţēď ţàƀĺē"],@@ -328,6 +333,7 @@"8eW0WQ": ["Ńō ḿàţćĥĩńĝ ŕēƥōśĩţōŕĩēś."],"8fRyLo": ["Ĩńvàĺĩď ƥàţćĥ ƥàŷĺōàď"],"8fc_3j": ["Ƥŕōţēćţēď ƀŕàńćĥ — ćàńńōţ ƥũśĥ"],+ "8m8diM": ["Ńō ĺōćàţĩōń śēĺēćţēď. Ũśē ßŕōŵśē ţō ćĥōōśē à ƒōĺďēŕ."],"8tjQCz": ["Ēxƥĺōŕē"],"8uAWix": ["Ţĥĩś ţēḿƥĺàţē ĺĩvēś ĩń à ƥàŕēńţ ƒōĺďēŕ — ďēĺēţĩńĝ ĩţ àƒƒēćţś ēvēŕŷ ƒōĺďēŕ ƀēńēàţĥ ĩţ ţĥàţ ďōēśń'ţ ďēƒĩńē ĩţś ōŵń vēŕśĩōń."@@ -633,9 +639,6 @@"JLUTgi": ["Ńō ţàĝś ŷēţ — àũţĥōŕ `#ţàĝńàḿē` ĩń àńŷ ďōć ţō ƥōƥũĺàţē ţĥē ĩńďēx."],"JLzQi_": ["Ćĺōśē ", ["accessibleLabel"]],"JOcPqH": ["ßŕĩńĝ à ŕēḿōţē ŕēƥōśĩţōŕŷ ōńţō ţĥĩś ḿàćĥĩńē."],- "JUamR6": [- "Ţĥĩś ńàḿē ĥàś ńō ćĥàŕàćţēŕś ţĥàţ àŕē śàƒē ƒōŕ à ƒōĺďēŕ ĩďēńţĩƒĩēŕ. Ţŕŷ à ńàḿē ŵĩţĥ àţ ĺēàśţ ōńē ĺēţţēŕ ōŕ ńũḿƀēŕ."- ],"JWsZlx": ["Ōƥēń à ƥŕōĴēćţ ţō ēďĩţ."],"JZ8cO6": ["Ĺĩĝĥţ, ďàŕķ, ōŕ ƒōĺĺōŵ ţĥē ŌŚ."],"Jejur6": ["Ćōũĺďń'ţ ĺōàď ďōćũḿēńţ"],@@ -756,7 +759,6 @@"NRSLBe": [["diffMin"], "ḿ àĝō"],"NSnIUP": ["Ţŵō-ƥàĝē (ēvēń)"],"NUr4kz": ["À ŕēũśàƀĺē śţàŕţĩńĝ ƥōĩńţ ƒōŕ ńēŵ ďōćũḿēńţś ĩń ţĥĩś ƒōĺďēŕ."],- "NYUhy5": ["Śũƀƒōĺďēŕ ńàḿē"],"N_7kkF": ["Ŕēàď ţĥŕōũĝĥ ţĥĩś ćōďēƀàśē àńď ďŕàƒţ à ţēćĥńĩćàĺ śƥēć ƒōŕ ţĥē ḿōśţ ćōḿƥĺēx ḿōďũĺē: àń ōvēŕvĩēŵ, ţĥē àŕćĥĩţēćţũŕē, ķēŷ ƒĩĺēś, àńď ōƥēń ǫũēśţĩōńś, àĺĺ ĺĩńķēď ƒŕōḿ à śƥēćś ĩńďēx ƥàĝē."],@@ -808,6 +810,7 @@"OuY8t9": ["Ōƥēń ĩń ćũŕŕēńţ ƀŕàńćĥ"],"OvEjsP": ["Ćōƥŷĩńĝ..."],"Oxyd5f": ["Ƥĩćķ à ńàḿē"],+ "OyIC0Q": ["ƤŕōĴēćţ ńàḿē"],"P-ye9o": ["Ćōũĺď ńōţ ōƥēń ƒōĺďēŕ ƥĩćķēŕ"],"P3NS4G": ["Ƥàţţēŕń śŷńţàx ēŕŕōŕ (ĺĩńē ", ["lineNumber"], "): ", ["message"]],"P3hnm0": ["Ƒĩĺē ţōō ĺàŕĝē ţō ōƥēń"],@@ -1128,6 +1131,7 @@],"_K2CvV": ["Ţēḿƥĺàţē"],"_PACVa": ["Ŕēĺēàśē ńōţēś"],+ "_PBJRl": ["Àďď àţ ĺēàśţ ōńē ĺēţţēŕ ōŕ ńũḿƀēŕ."],"_QwkMu": ["Ńō ḿàţćĥĩńĝ ƥàţĥś"],"_TDESN": ["Ńēţŵōŕķ ēŕŕōŕ - ", ["kind"], " \"", ["createdPath"], "\" śţĩĺĺ ēxĩśţś ōń ďĩśķ"],"_TF8ep": ["Ƒàĩĺēď ţō ŕēńďēŕ ƤĎƑ"],@@ -1195,11 +1199,6 @@"c5rF4v": ["Ŵĥàţ ĩś ţĥĩś ķńōŵĺēďĝē ƀàśē ƒōŕ?"],"c863eW": ["Ćōũĺď ńōţ śŵĩţćĥ ţō ", ["shareBranch"], ". Ţŕŷ śŵĩţćĥĩńĝ ḿàńũàĺĺŷ."],"c8iK2Y": ["Ńō ţēḿƥĺàţēś ƒōũńď."],- "cBbVqQ": [- "Ţĥē ƒōĺďēŕ ńàḿē <0>",- ["rawName"],- "</0> ćàń'ţ ƀē ũśēď àś à ƥŕōĴēćţ ĩďēńţĩƒĩēŕ — ĩţ ĥàś ńō ćĥàŕàćţēŕś ĺēƒţ àƒţēŕ śàńĩţĩźàţĩōń. Ćĺĩćķ ßŕōŵśē ţō ƥĩćķ à ƒōĺďēŕ ŵĥōśē ńàḿē ćōńţàĩńś àţ ĺēàśţ ōńē àĺƥĥàńũḿēŕĩć ćĥàŕàćţēŕ."- ],"cEoyWz": ["Àďď ĩţēḿ ţō ", ["keyName"]],"cF9DyA": ["Ŕēćōńńēćţĩńĝ àƒţēŕ śēŕvēŕ ŕēśţàŕţ"],"cIptmH": ["Ĩń ţĥē Ćĺàũďē Ďēśķţōƥ Àƥƥ"],@@ -1211,6 +1210,7 @@["conflictCount", "plural", { "one": ["#", " ćōńƒĺĩćţ"], "other": ["#", " ćōńƒĺĩćţś"] }]],"cUk6TF": ["Śŷńć ƒàĩĺēď — ćĥēćķ ţĥē śēŕvēŕ ĺōĝś ƒōŕ ďēţàĩĺś."],+ "cV7LOw": ["Ţēàḿ Ŵĩķĩ"],"cZGNlb": ["Àďď àńōţĥēŕ ƥàţţēŕń"],"cZI5AL": ["ŌĶ Ďēśķţōƥ"],"cZ_8zB": ["Śţàŷś ōń ţĥĩś ćōḿƥũţēŕ."],@@ -1327,7 +1327,6 @@"gp3I7-": ["ßēƒōŕē śŷńćĩńĝ, śēţ ŷōũŕ ĩďēńţĩţŷ ƒōŕ ĝĩţ ćōḿḿĩţś:"],"gtEbeW": ["Ĥĩĝĥĺĩĝĥţ"],"h06R3C": ["Ńō ƥàĝēś àŕē ḿĩśśĩńĝ ōũţĝōĩńĝ ĝŕàƥĥ ĺĩńķś."],- "h29Sd6": ["Śēĺēćţ ōŕ ćŕēàţē à ƒōĺďēŕ ƒōŕ ŷōũŕ ńēŵ ƥŕōĴēćţ"],"h6EvY-": ["Ţĥĩś ŵĩĺĺ ŕēƥĺàćē ţĥē ćũŕŕēńţ ďōćũḿēńţ ćōńţēńţ ŵĩţĥ ţĥē vēŕśĩōń ƒŕōḿ <0>",["relative"],@@ -1346,7 +1345,6 @@"hDoLrm": ["Ŕēḿōvē ", ["projectName"], " ƒŕōḿ ŕēćēńţ ƥŕōĴēćţś"],"hGmuTc": ["Ďōćś ţàĝĝēď #", ["tagDocsName"]],"hHMv6l": ["Ďēĺēţē ƀĺōćķ"],- "hJu2pH": ["Ţĥĩś ƒōĺďēŕ àĺŕēàďŷ ĥàś ƒĩĺēś. Àďď à ńàḿē ţō ćŕēàţē à ńēŵ śũƀƒōĺďēŕ ĩńśĩďē ĩţ."],"hSBIG-": ["À ţĩţĺē, ďēśćŕĩƥţĩōń, ţàĝś — àńŷţĥĩńĝ ţĥàţ ďēśćŕĩƀēś ţĥĩś ƒōĺďēŕ."],"hSySVc": ["Ĩńśţàĺĺ ĥàńďōƒƒ ƒàĩĺēď: ", ["msg"]],"hXUWyd": ["Vàĺũē ĩś ŕēǫũĩŕēď"],@@ -1375,6 +1373,7 @@"iEYxO4": ["Śĥōŵ ţĥũḿƀńàĩĺś"],"iGCs04": ["Ńō ţēḿƥĺàţēś àvàĩĺàƀĺē"],"iH8pgl": ["ßàćķ"],+ "iHAJDj": ["Ŕēśōĺvĩńĝ ďēƒàũĺţ ĺōćàţĩōń"],"iKSP5j": ["Ŵōŕď ŵŕàƥ"],"iMkWoF": ["Ţũŕń ōń"],"iNFKkm": ["Ńō ďĩƒƒ."],@@ -1442,6 +1441,7 @@],"kYL1lH": ["Àĝēńţ àćţĩvĩţŷ"],"k_pade": ["Ćōńƒĩĝ śĥàŕĩńĝ ĩś ńōŵ śĥàŕēď. Ćōḿḿĩţ ţĥē ŌĶ ƒĩĺēś ţō śĥàŕē ŵĩţĥ ŷōũŕ ţēàḿ."],+ "k_yIIc": ["Ŵĩĺĺ ƀē ćŕēàţēď àţ: <0>", ["targetPreview"], "</0>"],"kdzzOK": ["Ōƒƒ — śēàŕćĥ ŕàńķś ƀŷ ķēŷŵōŕď ōńĺŷ. Ńō ćōńţēńţ ĺēàvēś ţĥĩś ćōḿƥũţēŕ."],"keNFEd": ["Śēţ ĩďēńţĩţŷ"],"kj9pAE": ["Ćŕēàţĩńĝ ƥàĝē"],@@ -1734,11 +1734,6 @@"t18QYR": ["Ũńƥĩń ", ["accessibleLabel"]],"t2TkQ3": ["Śŷńć ƥàũśēď — ŕēśōĺvē ćōńƒĺĩćţś ţō ŕēśũḿē."],"tAPZEx": ["ßēĺōŵ"],- "tCelbM": [- "À ƒōĺďēŕ ńàḿēď <0>",- ["sanitized"],- "</0> àĺŕēàďŷ ĥàś ƒĩĺēś àţ ţĥĩś ĺōćàţĩōń. Ƥĩćķ à ďĩƒƒēŕēńţ ńàḿē."- ],"tP5DDk": ["Àƥƥĺŷ ĺĩńķ"],"tUvUfp": ["Ũśē à ƒōĺďēŕ ŷōũ àĺŕēàďŷ ĥàvē."],"tW_yvQ": ["Ēxƥàńď ", ["docName"]],@@ -1921,13 +1916,6 @@"yzGPkm": ["Ēxƥàńď ĝŕàƥĥ"],"z0a2EA": ["Ďĩàĝŕàḿ ƒŕōḿ Ḿēŕḿàĩď śōũŕćē — ƒĺōŵćĥàŕţ, śēǫũēńćē, ćĺàśś, śţàţē, ĒŔ, ĝàńţţ, ƥĩē."],"z1uNN0": ["Ńō ēḿōĴĩ ƒōũńď."],- "z2G3EK": [- "<0>",- ["rawName"],- "</0> ĥàś ćĥàŕàćţēŕś ũńśàƒē ƒōŕ ţĥē ōń-ďĩśķ ĩďēńţĩƒĩēŕ, śō ţĥē ƥŕōĴēćţ ŵĩĺĺ ƀē ćŕēàţēď àś <1>",- ["sanitized"],- "</1>. Ćĺĩćķ ßŕōŵśē ţō ƥĩćķ à śàƒēŕ ńàḿē."- ],"z2JdQ-": ["Ćōńƒĩĝ śĥàŕĩńĝ ũńćĥàńĝēď — śēē ďēţàĩĺś ƀēĺōŵ."],"z5pqI8": ["Ćàńńōţ ũƥĺōàď: ńō ďōćũḿēńţ ĩś ōƥēń"],"z60Lgn": [diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.poindex 77c4eb45b..65a3f79ec 100644--- a/packages/app/src/locales/pseudo/messages.po+++ b/packages/app/src/locales/pseudo/messages.po@@ -382,10 +382,6 @@ msgstr ""msgid "<{descriptorLabel}> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block."msgstr ""-#: src/components/CreateProjectDialog.tsx-msgid "<0>{rawName}</0> has characters unsafe for the on-disk identifier, so the project will be created as <1>{sanitized}</1>. Click Browse to pick a safer name."-msgstr ""-#: src/editor/components/Mirror.tsxmsgid "<0>Mirror — pick a source.</0> Set <1>src</1> + <2>anchor</2> via the property panel to point at a <3><MirrorSource></3> elsewhere."msgstr ""@@ -403,7 +399,7 @@ msgid "📝 or assets/icon.png"msgstr ""#: src/components/CreateProjectDialog.tsx-msgid "A folder named <0>{sanitized}</0> already has files at this location. Pick a different name."+msgid "A folder named <0>{sanitized}</0> already has files here. Pick a different name."msgstr ""#: src/components/settings/SearchSection.tsx@@ -520,6 +516,10 @@ msgstr ""msgid "Add another pattern"msgstr ""+#: src/components/CreateProjectDialog.tsx+msgid "Add at least one letter or number."+msgstr ""+#: src/lib/keyboard-shortcuts.tsmsgid "Add cursors or select matching occurrences through CodeMirror."msgstr ""@@ -2149,6 +2149,10 @@ msgstr ""msgid "Enter a name for this template."msgstr ""+#: src/components/CreateProjectDialog.tsx+msgid "Enter a project name"+msgstr ""+#: src/components/CloneDialog.tsxmsgid "Enter a repository URL or owner/repo"msgstr ""@@ -3614,6 +3618,10 @@ msgstr ""msgid "No links yet. Add wiki links or markdown links to build a graph."msgstr ""+#: src/components/CreateProjectDialog.tsx+msgid "No location selected. Use Browse to choose a folder."+msgstr ""+#: src/components/CommandPalette.tsxmsgid "No matching commands."msgstr ""@@ -4276,10 +4284,6 @@ msgstr ""msgid "Plain"msgstr ""-#: src/components/CreateProjectDialog.tsx-msgid "Please select a folder"-msgstr ""-#: src/components/settings/SettingsDialogBody.tsx#: src/components/settings/SettingsDialogShell.tsxmsgid "Preferences"@@ -4325,6 +4329,10 @@ msgstr ""msgid "Project folder created, but git init failed. Try again."msgstr ""+#: src/components/CreateProjectDialog.tsx+msgid "Project name"+msgstr ""+#: src/components/FileTree.tsx#: src/components/SeedDialog.tsxmsgid "Project root"@@ -4652,6 +4660,10 @@ msgstr ""msgid "Resolve conflict in your terminal"msgstr ""+#: src/components/CreateProjectDialog.tsx+msgid "Resolving default location"+msgstr ""+#: src/components/CloneDialog.tsxmsgid "Resolving deltas"msgstr ""@@ -4921,10 +4933,6 @@ msgstr ""msgid "Select next occurrence"msgstr ""-#: src/components/CreateProjectDialog.tsx-msgid "Select or create a folder for your new project"-msgstr ""-#: src/lib/keyboard-shortcuts.tsmsgid "Select the full source document."msgstr ""@@ -5313,10 +5321,6 @@ msgstr ""msgid "Strikethrough"msgstr ""-#: src/components/CreateProjectDialog.tsx-msgid "Subfolder name"-msgstr ""-#: src/lib/keyboard-shortcuts.tsmsgid "Suggestion menu navigation"msgstr ""@@ -5458,6 +5462,10 @@ msgstr ""msgid "Task List"msgstr ""+#: src/components/CreateProjectDialog.tsx+msgid "Team Wiki"+msgstr ""+#: src/components/TemplateEditDialog.tsxmsgid "Template"msgstr ""@@ -5549,10 +5557,6 @@ msgstr ""msgid "The file on disk, and the id agents use. It can't be changed later."msgstr ""-#: src/components/CreateProjectDialog.tsx-msgid "The folder name <0>{rawName}</0> can't be used as a project identifier — it has no characters left after sanitization. Click Browse to pick a folder whose name contains at least one alphanumeric character."-msgstr ""-#: src/components/SeedDialog.tsxmsgid "The folders and templates are in place; there's nothing left to scaffold."msgstr ""@@ -5639,10 +5643,6 @@ msgstr ""msgid "This file is too large to open in the built-in text editor (1 MB limit). Use Open file below to open it in another app."msgstr ""-#: src/components/CreateProjectDialog.tsx-msgid "This folder already has files. Add a name to create a new subfolder inside it."-msgstr ""-#: src/components/FolderOverview.tsxmsgid "This folder is empty."msgstr ""@@ -5655,10 +5655,6 @@ msgstr ""msgid "This looks like a drive root (e.g., C:\\). Scaffolding here will scan an entire drive."msgstr ""-#: src/components/CreateProjectDialog.tsx-msgid "This name has no characters that are safe for a folder identifier. Try a name with at least one letter or number."-msgstr ""-#: src/components/SeedDialog.tsxmsgid "This pack is already set up here."msgstr ""@@ -6145,6 +6141,10 @@ msgstr ""msgid "Will be created as <0>{sanitizedName}</0>"msgstr ""+#: src/components/CreateProjectDialog.tsx+msgid "Will be created at: <0>{targetPreview}</0>"+msgstr ""+#: src/components/CreateProjectDialog.tsxmsgid "Will be saved as <0>{sanitized}</0>."msgstr ""diff --git a/packages/desktop/tests/smoke/_helpers/create-new-dialog.ts b/packages/desktop/tests/smoke/_helpers/create-new-dialog.tsnew file mode 100644index 000000000..5ba50606d--- /dev/null+++ b/packages/desktop/tests/smoke/_helpers/create-new-dialog.ts@@ -0,0 +1,8 @@+import type { Page } from '@playwright/test';+import { expect } from './smoke-test';++export async function typeProjectName(page: Page, name: string): Promise<void> {+ const nameInput = page.locator('[data-testid="create-name"]');+ await expect(nameInput).toBeVisible({ timeout: 5_000 });+ await nameInput.fill(name);+}diff --git a/packages/desktop/tests/smoke/create-new-project.e2e.ts b/packages/desktop/tests/smoke/create-new-project.e2e.tsindex 67fb8c61d..d9ee3df07 100644--- a/packages/desktop/tests/smoke/create-new-project.e2e.ts+++ b/packages/desktop/tests/smoke/create-new-project.e2e.ts@@ -13,6 +13,7 @@ import { dirname, join, resolve } from 'node:path';import { fileURLToPath } from 'node:url';import type { ElectronApplication, Page } from '@playwright/test';import { _electron as electron } from '@playwright/test';+import { typeProjectName } from './_helpers/create-new-dialog';import { expect, test } from './_helpers/smoke-test';const __dirname = dirname(fileURLToPath(import.meta.url));@@ -43,7 +44,7 @@ function seedTmpHome(prefix: string): string {}interface LaunchOpts {- pickedPath?: string;+ pickedParent?: string;}async function launchApp(tmpHome: string, opts: LaunchOpts = {}): Promise<ElectronApplication> {@@ -55,7 +56,9 @@ async function launchApp(tmpHome: string, opts: LaunchOpts = {}): Promise<Electr...process.env,HOME: tmpHome,OK_DESKTOP_E2E_SMOKE: '1',- ...(opts.pickedPath !== undefined ? { OK_DESKTOP_TEST_PICKED_PATH: opts.pickedPath } : {}),+ ...(opts.pickedParent !== undefined+ ? { OK_DESKTOP_TEST_PICKED_PATH: opts.pickedParent }+ : {}),},});}@@ -119,7 +122,7 @@ test.describe('Create-new-project smoke', () => {}});- test('creates a new project at the picked location when target is free', async ({+ test('creates a new project at the named location when target is free', async ({captureStderrFor,}) => {const tmpHome = seedTmpHome('free');@@ -129,7 +132,7 @@ test.describe('Create-new-project smoke', () => {const expectedTarget = join(parent, projectName);trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: expectedTarget });+ const app = await launchApp(tmpHome, { pickedParent: parent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');@@ -138,16 +141,21 @@ test.describe('Create-new-project smoke', () => {const dialog = navigator.locator('[data-testid="create-project-dialog"]');await expect(dialog).toBeVisible({ timeout: 15_000 });- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ parent,+ { timeout: 15_000 },+ );++ await typeProjectName(navigator, projectName);+ await expect(navigator.locator('[data-testid="create-target-caption"]')).toContainText(expectedTarget,{ timeout: 15_000 },);await expect(navigator.locator('[data-testid="create-banner-nested"]')).toHaveCount(0);await expect(navigator.locator('[data-testid="create-banner-git-confirm"]')).toHaveCount(0);- await expect(navigator.locator('[data-testid="create-banner-nonempty"]')).toHaveCount(0);const submit = navigator.locator('[data-testid="create-submit"]');await expect(submit).toBeEnabled();@@ -163,7 +171,7 @@ test.describe('Create-new-project smoke', () => {.toBe(true);});- test('blocks creation when picked target is inside an existing OK project', async ({+ test('blocks creation when chosen Location is inside an existing OK project', async ({captureStderrFor,}) => {const tmpHome = seedTmpHome('nested');@@ -172,10 +180,10 @@ test.describe('Create-new-project smoke', () => {writeFileSync(join(rootPath, '.ok', 'config.yml'), 'schemaVersion: 1\ncontent:\n dir: "."\n');const subFolder = join(rootPath, 'sub');mkdirSync(subFolder, { recursive: true });- const pickedTarget = join(subFolder, 'Nested');+ const projectName = 'Nested';trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app = await launchApp(tmpHome, { pickedParent: subFolder });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');@@ -184,13 +192,13 @@ test.describe('Create-new-project smoke', () => {timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);-+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(- pickedTarget,+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ subFolder,{ timeout: 15_000 },);+ await typeProjectName(navigator, projectName);const nestedBanner = navigator.locator('[data-testid="create-banner-nested"]');await expect(nestedBanner).toBeVisible({ timeout: 15_000 });@@ -212,7 +220,7 @@ test.describe('Create-new-project smoke', () => {const target = join(pickedParent, projectName);trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: target });+ const app = await launchApp(tmpHome, { pickedParent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');@@ -221,11 +229,15 @@ test.describe('Create-new-project smoke', () => {timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);-+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(target, {- timeout: 15_000,+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ pickedParent,+ { timeout: 5_000 },+ );+ await typeProjectName(navigator, projectName);+ await expect(navigator.locator('[data-testid="create-target-caption"]')).toContainText(target, {+ timeout: 5_000,});const gitBanner = navigator.locator('[data-testid="create-banner-git-confirm"]');@@ -258,18 +270,18 @@ test.describe('Create-new-project smoke', () => {const proj1Root = join(tmpHome, 'existing-project-1');mkdirSync(join(proj1Root, '.ok'), { recursive: true });writeFileSync(join(proj1Root, '.ok', 'config.yml'), 'schemaVersion: 1\ncontent:\n dir: "."\n');- const target1 = join(proj1Root, 'sub', 'NestedA');- mkdirSync(join(proj1Root, 'sub'), { recursive: true });+ const sub1 = join(proj1Root, 'sub');+ mkdirSync(sub1, { recursive: true });const proj2Root = join(tmpHome, 'existing-project-2');mkdirSync(join(proj2Root, '.ok'), { recursive: true });writeFileSync(join(proj2Root, '.ok', 'config.yml'), 'schemaVersion: 1\ncontent:\n dir: "."\n');- const target2 = join(proj2Root, 'sub', 'NestedB');- mkdirSync(join(proj2Root, 'sub'), { recursive: true });+ const sub2 = join(proj2Root, 'sub');+ mkdirSync(sub2, { recursive: true });trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: `${target1}\x1f${target2}` });+ const app = await launchApp(tmpHome, { pickedParent: `${sub1}\x1f${sub2}` });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');@@ -278,6 +290,8 @@ test.describe('Create-new-project smoke', () => {timeout: 15_000,});+ await typeProjectName(navigator, 'NestedX');+await navigator.locator('[data-testid="create-browse"]').click();const nestedBanner = navigator.locator('[data-testid="create-banner-nested"]');await expect(nestedBanner).toBeVisible({ timeout: 15_000 });@@ -351,11 +365,11 @@ test.describe('Create-new-project smoke', () => {const repoRoot = join(tmpHome, 'some-checkout');mkdirSync(repoRoot, { recursive: true });execSync('git init -q', { cwd: repoRoot });- const target = join(repoRoot, 'docs', 'Notes');- mkdirSync(join(repoRoot, 'docs'), { recursive: true });+ const pickedParent = join(repoRoot, 'docs');+ mkdirSync(pickedParent, { recursive: true });trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: target });+ const app = await launchApp(tmpHome, { pickedParent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');@@ -364,6 +378,7 @@ test.describe('Create-new-project smoke', () => {timeout: 15_000,});+ await typeProjectName(navigator, 'Notes');await navigator.locator('[data-testid="create-browse"]').click();const gitBanner = navigator.locator('[data-testid="create-banner-git-confirm"]');await expect(gitBanner).toBeVisible({ timeout: 15_000 });diff --git a/packages/desktop/tests/smoke/qa-create-new-extended.e2e.ts b/packages/desktop/tests/smoke/qa-create-new-extended.e2e.tsindex 6e3a47622..4f1873e48 100644--- a/packages/desktop/tests/smoke/qa-create-new-extended.e2e.ts+++ b/packages/desktop/tests/smoke/qa-create-new-extended.e2e.ts@@ -13,6 +13,7 @@ import { dirname, join, resolve } from 'node:path';import { fileURLToPath } from 'node:url';import type { ElectronApplication, Page } from '@playwright/test';import { _electron as electron } from '@playwright/test';+import { typeProjectName } from './_helpers/create-new-dialog';import { captureAppProcess, closeAppBounded } from './_helpers/electron-cleanup';import { expect, test } from './_helpers/smoke-test';@@ -50,7 +51,7 @@ function seedTmpHome(prefix: string, stateOverride?: Record<string, unknown>): s}interface LaunchOpts {- pickedPath?: string;+ pickedParent?: string;}async function launchApp(tmpHome: string, opts: LaunchOpts = {}): Promise<ElectronApplication> {@@ -62,7 +63,9 @@ async function launchApp(tmpHome: string, opts: LaunchOpts = {}): Promise<Electr...process.env,HOME: tmpHome,OK_DESKTOP_E2E_SMOKE: '1',- ...(opts.pickedPath !== undefined ? { OK_DESKTOP_TEST_PICKED_PATH: opts.pickedPath } : {}),+ ...(opts.pickedParent !== undefined+ ? { OK_DESKTOP_TEST_PICKED_PATH: opts.pickedParent }+ : {}),},});}@@ -127,10 +130,11 @@ test.describe('QA extended create-new-project', () => {const tmpHome = seedTmpHome('editors');const parent = join(tmpHome, 'projects');mkdirSync(parent, { recursive: true });- const expected = join(parent, 'Customized');+ const projectName = 'Customized';+ const expected = join(parent, projectName);trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: expected });+ const app = await launchApp(tmpHome, { pickedParent: parent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();@@ -138,12 +142,18 @@ test.describe('QA extended create-new-project', () => {timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(expected, {- timeout: 15_000,- });+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ parent,+ { timeout: 5_000 },+ );+ await typeProjectName(navigator, projectName);+ await expect(navigator.locator('[data-testid="create-target-caption"]')).toContainText(+ expected,+ { timeout: 5_000 },+ );await expandCreateAdvanced(navigator);await navigator.locator('[data-testid="create-editor-cursor"]').click();@@ -169,25 +179,27 @@ test.describe('QA extended create-new-project', () => {expect(existsSync(join(expected, '.codex'))).toBe(false);});- test('QA-010 dialog UX — focus, caption, checkboxes, ARIA', async ({ captureStderrFor }) => {+ test('QA-010 dialog UX — focus, location, checkboxes, ARIA', async ({ captureStderrFor }) => {const tmpHome = seedTmpHome('uxshape');const parent = join(tmpHome, 'projects');mkdirSync(parent, { recursive: true });- const pickedTarget = join(parent, 'Live Preview');+ const projectName = 'Live Preview';+ const expectedTarget = join(parent, projectName);trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app = await launchApp(tmpHome, { pickedParent: parent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();const dialog = navigator.locator('[data-testid="create-project-dialog"]');await expect(dialog).toBeVisible({ timeout: 15_000 });- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);- await expect(navigator.locator('[data-testid="create-browse"]')).toBeFocused();+ await expect(navigator.locator('[data-testid="create-name"]')).toBeFocused();- const caption = navigator.locator('[data-testid="create-target-caption"]');+ const locationDisplay = navigator.locator('[data-testid="create-location-display"]');+ await expect(locationDisplay).toBeVisible();+ const caption = navigator.locator('[data-testid="create-target-caption"]');const ariaLive = await caption.getAttribute('aria-live');expect(ariaLive).toBe('polite');@@ -197,8 +209,9 @@ test.describe('QA extended create-new-project', () => {await expect(navigator.locator('[data-testid="create-editor-cursor"]')).toBeChecked();await expect(navigator.locator('[data-testid="create-editor-codex"]')).toBeChecked();+ await typeProjectName(navigator, projectName);await navigator.locator('[data-testid="create-browse"]').click();- await expect(caption).toHaveText(pickedTarget, { timeout: 15_000 });+ await expect(caption).toContainText(expectedTarget, { timeout: 15_000 });});test('QA-011 + QA-016 — lastUsedProjectParent persists across opens; transient form state resets on reopen', async ({@@ -211,10 +224,10 @@ test.describe('QA extended create-new-project', () => {const parent = join(tmpHome, 'projects-persist');mkdirSync(parent, { recursive: true });const userDataDir = join(tmpHome, 'Library', 'Application Support', DESKTOP_PRODUCT_NAME);- const pickedTarget = join(parent, 'First');+ const projectName = 'First';trackForCleanup(tmpHome);- const app1 = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app1 = await launchApp(tmpHome, { pickedParent: parent });captureStderrFor(app1);const app1Proc = captureAppProcess(app1);const navigator = await findWindowByMode(app1, 'navigator');@@ -222,10 +235,11 @@ test.describe('QA extended create-new-project', () => {await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible({timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();+ await typeProjectName(navigator, projectName);await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(- pickedTarget,+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ parent,{ timeout: 15_000 },);const submit = navigator.locator('[data-testid="create-submit"]');@@ -261,11 +275,13 @@ test.describe('QA extended create-new-project', () => {await expect(navigator2.locator('[data-testid="create-project-dialog"]')).toBeVisible({timeout: 15_000,});- await expect(navigator2.locator('[data-testid="create-name"]')).toHaveCount(0);- const caption2 = navigator2.locator('[data-testid="create-target-caption"]');- await expect(caption2).toContainText('Select or create a folder for your new project', {- timeout: 5_000,- });+ const nameInput = navigator2.locator('[data-testid="create-name"]');+ await expect(nameInput).toBeVisible();+ await expect(nameInput).toHaveValue('');+ await expect(navigator2.locator('[data-testid="create-location-display"]')).toContainText(+ persistedParent,+ { timeout: 15_000 },+ );await expandCreateAdvanced(navigator2);await expect(navigator2.locator('[data-testid="create-editor-claude"]')).toBeChecked();await expect(navigator2.locator('[data-testid="create-editor-claude-desktop"]')).toBeChecked();@@ -273,7 +289,7 @@ test.describe('QA extended create-new-project', () => {await expect(navigator2.locator('[data-testid="create-editor-codex"]')).toBeChecked();});- test('submit with no folder does not create; Browse enables creation', async ({+ test('submit with no name does not create; typing the name enables creation', async ({captureStderrFor,}) => {const tmpHome = seedTmpHome('toast-when-empty');@@ -281,7 +297,7 @@ test.describe('QA extended create-new-project', () => {mkdirSync(parent, { recursive: true });trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: join(parent, 'AfterPick') });+ const app = await launchApp(tmpHome, { pickedParent: parent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();@@ -289,21 +305,21 @@ test.describe('QA extended create-new-project', () => {timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ const nameInput = navigator.locator('[data-testid="create-name"]');+ await expect(nameInput).toHaveValue('');const submit = navigator.locator('[data-testid="create-submit"]');await expect(submit).toBeEnabled();const caption = navigator.locator('[data-testid="create-target-caption"]');- await expect(caption).toContainText('Select or create a folder for your new project', {- timeout: 5_000,- });+ await expect(caption).toHaveText('', { timeout: 5_000 });await submit.click();await navigator.waitForTimeout(2_000);await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible();expect(await countWindowsByMode(app, 'editor')).toBe(0);+ await typeProjectName(navigator, 'AfterPick');await navigator.locator('[data-testid="create-browse"]').click();- await expect(caption).toHaveText(join(parent, 'AfterPick'), { timeout: 15_000 });+ await expect(caption).toContainText(join(parent, 'AfterPick'), { timeout: 15_000 });await expect(submit).toBeEnabled();});@@ -313,20 +329,21 @@ test.describe('QA extended create-new-project', () => {const tmpHome = seedTmpHome('dblclick');const parent = join(tmpHome, 'projects-dbl');mkdirSync(parent, { recursive: true });- const pickedTarget = join(parent, 'Unique');+ const projectName = 'Unique';trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app = await launchApp(tmpHome, { pickedParent: parent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible({timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();+ await typeProjectName(navigator, projectName);await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(- pickedTarget,+ await expect(navigator.locator('[data-testid="create-target-caption"]')).toContainText(+ join(parent, projectName),{ timeout: 15_000 },);@@ -344,7 +361,7 @@ test.describe('QA extended create-new-project', () => {await new Promise((r) => setTimeout(r, 2_000));const editorCount = await countWindowsByMode(app, 'editor');expect(editorCount).toBe(1);- expect(existsSync(join(parent, 'Unique', '.ok', 'config.yml'))).toBe(true);+ expect(existsSync(join(parent, projectName, '.ok', 'config.yml'))).toBe(true);});test('QA-025 — banner ARIA roles per severity', async ({ captureStderrFor }) => {@@ -354,20 +371,21 @@ test.describe('QA extended create-new-project', () => {writeFileSync(join(rootPath, '.ok', 'config.yml'), 'schemaVersion: 1\ncontent:\n dir: "."\n');const subFolder = join(rootPath, 'sub');mkdirSync(subFolder, { recursive: true });- const pickedTarget = join(subFolder, 'Nested');+ const projectName = 'Nested';trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app = await launchApp(tmpHome, { pickedParent: subFolder });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible({timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();+ await typeProjectName(navigator, projectName);await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(- pickedTarget,+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ subFolder,{ timeout: 15_000 },);@@ -386,20 +404,21 @@ test.describe('QA extended create-new-project', () => {execSync('git init -q', { cwd: repoRoot });const pickedParent = join(repoRoot, 'notes');mkdirSync(pickedParent, { recursive: true });- const pickedTarget = join(pickedParent, 'MyProj');+ const projectName = 'MyProj';trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app = await launchApp(tmpHome, { pickedParent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible({timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();+ await typeProjectName(navigator, projectName);await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(- pickedTarget,+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ pickedParent,{ timeout: 15_000 },);@@ -415,20 +434,21 @@ test.describe('QA extended create-new-project', () => {const tmpHome = seedTmpHome('kbd');const parent = join(tmpHome, 'projects-kbd');mkdirSync(parent, { recursive: true });- const pickedTarget = join(parent, 'KbdSubmit');+ const projectName = 'KbdSubmit';trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app = await launchApp(tmpHome, { pickedParent: parent });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible({timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();+ await typeProjectName(navigator, projectName);await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(- pickedTarget,+ await expect(navigator.locator('[data-testid="create-target-caption"]')).toContainText(+ join(parent, projectName),{ timeout: 15_000 },);@@ -441,7 +461,7 @@ test.describe('QA extended create-new-project', () => {await expect.poll(() => countWindowsByMode(app, 'editor'), { timeout: 30_000 }).toBeGreaterThanOrEqual(1);- expect(existsSync(join(pickedTarget, '.ok', 'config.yml'))).toBe(true);+ expect(existsSync(join(parent, projectName, '.ok', 'config.yml'))).toBe(true);});test('QA-002 — clicking Open <basename> dispatches openProject and closes dialog', async ({@@ -453,20 +473,21 @@ test.describe('QA extended create-new-project', () => {writeFileSync(join(rootPath, '.ok', 'config.yml'), 'schemaVersion: 1\ncontent:\n dir: "."\n');const subFolder = join(rootPath, 'sub');mkdirSync(subFolder, { recursive: true });- const pickedTarget = join(subFolder, 'Anything');+ const projectName = 'Anything';trackForCleanup(tmpHome);- const app = await launchApp(tmpHome, { pickedPath: pickedTarget });+ const app = await launchApp(tmpHome, { pickedParent: subFolder });captureStderrFor(app);const navigator = await findWindowByMode(app, 'navigator');await navigator.locator('[data-testid="nav-create-new"]').click();await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible({timeout: 15_000,});- await expect(navigator.locator('[data-testid="create-name"]')).toHaveCount(0);+ await expect(navigator.locator('[data-testid="create-name"]')).toBeVisible();+ await typeProjectName(navigator, projectName);await navigator.locator('[data-testid="create-browse"]').click();- await expect(navigator.locator('[data-testid="create-target-caption"]')).toHaveText(- pickedTarget,+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ subFolder,{ timeout: 15_000 },);@@ -485,4 +506,46 @@ test.describe('QA extended create-new-project', () => {});}});++ test('PRD-7129 — name resolving to a non-empty folder shows inline name-taken error', async ({+ captureStderrFor,+ }) => {+ const tmpHome = seedTmpHome('name-taken');+ const parent = join(tmpHome, 'projects-taken');+ mkdirSync(parent, { recursive: true });+ const taken = join(parent, 'Notes');+ mkdirSync(taken, { recursive: true });+ writeFileSync(join(taken, 'existing.md'), '# existing\n');+ trackForCleanup(tmpHome);++ const app = await launchApp(tmpHome, { pickedParent: parent });+ captureStderrFor(app);+ const navigator = await findWindowByMode(app, 'navigator');+ await navigator.locator('[data-testid="nav-create-new"]').click();+ await expect(navigator.locator('[data-testid="create-project-dialog"]')).toBeVisible({+ timeout: 15_000,+ });++ await navigator.locator('[data-testid="create-browse"]').click();+ await expect(navigator.locator('[data-testid="create-location-display"]')).toContainText(+ parent,+ { timeout: 15_000 },+ );++ await typeProjectName(navigator, 'Notes');++ await expect(navigator.locator('[data-testid="create-name-error-taken"]')).toBeVisible({+ timeout: 15_000,+ });+ await expect(navigator.locator('[data-testid="create-submit"]')).toBeDisabled();+ await expect(navigator.locator('[data-testid="create-subfolder-rescue"]')).toHaveCount(0);++ await typeProjectName(navigator, 'FreshNotes');+ await expect(navigator.locator('[data-testid="create-name-error-taken"]')).toHaveCount(0, {+ timeout: 15_000,+ });+ await expect(navigator.locator('[data-testid="create-submit"]')).toBeEnabled({+ timeout: 15_000,+ });+ });});