diff --git a/.changeset/create-project-sharing-into-advanced.md b/.changeset/create-project-sharing-into-advanced.md new file mode 100644 index 00000000..7dfe2e1a --- /dev/null +++ b/.changeset/create-project-sharing-into-advanced.md @@ -0,0 +1,5 @@ +--- +"@inkeep/open-knowledge": patch +--- + +Tuck the config-sharing choice into "Advanced settings" in the Create-new-project dialog. Greenfield projects already default to Shared, so the dialog now leads with just the project name and location; the Shared / Local only cards move under Advanced alongside the AI-tool connections. The open-folder setup dialog is unchanged. It still surfaces the sharing choice at the top level, where the decision is more consequential for an existing folder. diff --git a/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsx b/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsx index e051affb..4c43110f 100644 --- a/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsx +++ b/packages/app/src/components/CreateProjectDialog.runtime.dom.test.tsx @@ -180,9 +180,10 @@ describe('CreateProjectDialog runtime wiring', () => { await waitForLocationHydrate(); - expect(screen.getByTestId('create-sharing')).not.toBeNull(); + expect(screen.queryByTestId('create-sharing')).toBeNull(); expect(screen.queryByTestId('create-editor-cursor')).toBeNull(); fireEvent.click(screen.getByTestId('create-advanced-trigger')); + expect(screen.getByTestId('create-sharing')).not.toBeNull(); for (const id of ALL_EDITOR_IDS) { const checkbox = screen.getByTestId(`create-editor-${id}`); @@ -215,6 +216,28 @@ describe('CreateProjectDialog runtime wiring', () => { expect(stub.onOpenChange).toHaveBeenLastCalledWith(false); }); + test('reopening the dialog re-collapses Advanced so sharing is hidden again', async () => { + const stub = makeBridge(); + const onOpenChange = mock(() => {}); + const { rerender } = render( + , + ); + await screen.findByTestId('create-project-dialog'); + await waitForLocationHydrate(); + + fireEvent.click(screen.getByTestId('create-advanced-trigger')); + expect(screen.getByTestId('create-sharing')).not.toBeNull(); + + rerender(); + rerender(); + await screen.findByTestId('create-project-dialog'); + + await waitFor(() => { + expect(screen.queryByTestId('create-sharing')).toBeNull(); + }); + expect(screen.getByTestId('create-advanced-trigger')).not.toBeNull(); + }); + test('Location hydrates from defaultProjectsRoot and Browse picks a fresh parent', async () => { const stub = await renderDialog(); @@ -284,6 +307,7 @@ describe('CreateProjectDialog runtime wiring', () => { await typeProjectName(PROJECT_NAME); await waitForSubmitEnabled(); + fireEvent.click(screen.getByTestId('create-advanced-trigger')); await userEvent.click(screen.getByTestId('create-sharing-local-only')); fireEvent.click(screen.getByTestId('create-submit')); @@ -378,6 +402,7 @@ describe('CreateProjectDialog runtime wiring', () => { const stub = await renderDialog(); await waitForLocationHydrate(); + fireEvent.click(screen.getByTestId('create-advanced-trigger')); const info = screen.getByTestId('config-sharing-info') as HTMLButtonElement; expect(info.type).toBe('button'); diff --git a/packages/app/src/components/CreateProjectDialog.tsx b/packages/app/src/components/CreateProjectDialog.tsx index aa2f1340..7dfee77e 100644 --- a/packages/app/src/components/CreateProjectDialog.tsx +++ b/packages/app/src/components/CreateProjectDialog.tsx @@ -555,14 +555,6 @@ export function CreateProjectDialog({ open, onOpenChange, bridge }: CreateProjec onConfirmRemoveGit={onConfirmRemoveGit} /> - - + +