Focus request/folder after creation

This commit is contained in:
Gregory Schier
2025-11-11 14:11:43 -08:00
parent 8164a61376
commit 7b6278405c
19 changed files with 138 additions and 86 deletions

View File

@@ -13,7 +13,7 @@ import { showPrompt } from '../lib/prompt';
import { resolvedModelNameWithFolders } from '../lib/resolvedModelName';
export const createFolder = createFastMutation<
void,
string | null,
void,
Partial<Pick<Folder, 'name' | 'sortPriority' | 'folderId'>>
>({
@@ -34,13 +34,14 @@ export const createFolder = createFastMutation<
confirmText: 'Create',
placeholder: 'Name',
});
if (name == null) return;
if (name == null) return null;
patch.name = name;
}
patch.sortPriority = patch.sortPriority || -Date.now();
await createWorkspaceModel({ model: 'folder', workspaceId, ...patch });
const id = await createWorkspaceModel({ model: 'folder', workspaceId, ...patch });
return id;
},
});