From 565106d333062f023f964640fe3656ae9568b058 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Fri, 14 Aug 2026 12:35:08 -0700 Subject: [PATCH] fix(web): explain why create is unavailable for names with no slug characters Co-Authored-By: Claude Fable 5 --- apps/web/src/components/CommandPalette.tsx | 44 ++++++++++++++++------ 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx index 5273fd2f49..c9f07c5ea3 100644 --- a/apps/web/src/components/CommandPalette.tsx +++ b/apps/web/src/components/CommandPalette.tsx @@ -2100,8 +2100,10 @@ function OpenCommandPaletteDialog(props: { !createProjectCollision && canCreateProjectInEnvironment(browseEnvironment?.connection.phase) && !isCreatingProject; + // A typed name with no usable slug (e.g. all-symbol or non-Latin input) + // must not leave the view silently dead; explain why Create is unavailable. const createProjectGroups: CommandPaletteView["groups"] = - addProjectCreateFlow && createProjectPlan + addProjectCreateFlow && trimmedCreateProjectName.length > 0 && createProjectPlan === null ? [ { value: "create-project", @@ -2109,23 +2111,43 @@ function OpenCommandPaletteDialog(props: { items: [ { kind: "action", - value: "action:create-project:confirm", + value: "action:create-project:invalid-name", searchTerms: [], - title: `Create "${trimmedCreateProjectName}"`, - description: createProjectCollision - ? `Folder already exists: ${createProjectPlan.destinationPath}` - : createProjectPlan.destinationPath, + title: "Name needs a letter or number", + description: "The folder name is built from a-z and 0-9 characters in the name", icon: , - disabled: !canSubmitCreateProjectFlow, + disabled: true, keepOpen: true, - run: async () => { - await submitAddProjectCreateFlow(); - }, + run: async () => {}, }, ], }, ] - : []; + : addProjectCreateFlow && createProjectPlan + ? [ + { + value: "create-project", + label: "Create project", + items: [ + { + kind: "action", + value: "action:create-project:confirm", + searchTerms: [], + title: `Create "${trimmedCreateProjectName}"`, + description: createProjectCollision + ? `Folder already exists: ${createProjectPlan.destinationPath}` + : createProjectPlan.destinationPath, + icon: , + disabled: !canSubmitCreateProjectFlow, + keepOpen: true, + run: async () => { + await submitAddProjectCreateFlow(); + }, + }, + ], + }, + ] + : []; let displayedGroups: CommandPaletteView["groups"] = filteredGroups; if (addProjectCreateFlow) {