moving
This commit is contained in:
@@ -805,7 +805,7 @@ const CreateWorkspaceDialog = ({ open, onClose, onCreate }: CreateWorkspaceDialo
|
||||
}, [selectedTemplate, templates]);
|
||||
|
||||
const handleCreate = () => {
|
||||
if (!name.trim()) return;
|
||||
if (!name.trim() || (storageType === 'local' && !storagePath.trim())) return;
|
||||
onCreate({
|
||||
name: name.trim(), group,
|
||||
persona: agentMode === 'single' ? selectedPersona : undefined,
|
||||
@@ -1316,7 +1316,7 @@ const CreateWorkspaceDialog = ({ open, onClose, onCreate }: CreateWorkspaceDialo
|
||||
|
||||
<div className="flex justify-end gap-2 px-6 py-4 border-t border-border/30">
|
||||
<button type="button" onClick={onClose} className="px-4 py-2 text-xs font-display rounded-lg text-muted-foreground hover:text-foreground transition-colors">Cancel</button>
|
||||
<button type="button" onClick={handleCreate} disabled={!name.trim()} aria-label="Create workspace"
|
||||
<button type="button" onClick={handleCreate} disabled={!name.trim() || (storageType === 'local' && !storagePath.trim())} aria-label="Create workspace"
|
||||
className="flex items-center gap-1.5 px-4 py-2 text-xs font-display rounded-lg bg-primary text-primary-foreground hover:bg-primary/80 disabled:opacity-50 transition-colors">
|
||||
<Plus className="w-3.5 h-3.5" /> Create
|
||||
</button>
|
||||
|
||||
@@ -175,6 +175,20 @@ describe('SpawnAgentDialog durable launch', () => {
|
||||
expect(modelList).toContainElement(screen.getByTitle('anthropic/claude-3-5-sonnet'));
|
||||
});
|
||||
|
||||
it('shows the retry CTA when a configured provider returns no models', async () => {
|
||||
mocks.adapter.getModels.mockResolvedValue([]);
|
||||
mocks.adapter.getModel.mockResolvedValue('');
|
||||
mocks.adapter.getProviders.mockResolvedValue({
|
||||
providers: [{ id: 'anthropic', name: 'Anthropic', hasKey: true, models: [] }],
|
||||
search: [],
|
||||
activeSearch: '',
|
||||
});
|
||||
renderDialog();
|
||||
|
||||
const retryCta = await screen.findByTestId('spawn-no-models-cta');
|
||||
expect(retryCta).toHaveTextContent('Retry');
|
||||
});
|
||||
|
||||
it('blocks launch and explains how to configure a model when no provider is ready', async () => {
|
||||
mocks.adapter.getModels.mockResolvedValue([]);
|
||||
mocks.adapter.getModel.mockResolvedValue('anthropic/claude-3-5-sonnet');
|
||||
|
||||
@@ -97,9 +97,6 @@ const SpawnAgentDialog = ({ open, onClose, workspaces, activeWorkspaceId, onWork
|
||||
const deduped = Array.from(new Set(fromProviders));
|
||||
if (deduped.length > 0) modelList = deduped;
|
||||
}
|
||||
if (modelList.length === 0 && providers.providers.some((p) => p.hasKey)) {
|
||||
setModelsError('Model list unavailable right now — retry, or check provider keys in Settings.');
|
||||
}
|
||||
setModels(modelList);
|
||||
setPricing(p);
|
||||
setProvidersWithKeys(countProvidersWithKeys(providers.providers));
|
||||
|
||||
Reference in New Issue
Block a user