Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/cli/tui/screens/knowledge-base/AddKnowledgeBaseScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ export function AddKnowledgeBaseScreen({
setPendingType(item.id as DataSourceTypeFlag);
setStep('sources');
},
// Esc from the type picker: if we already have at least one captured
// source, the only sensible return is the add-another decision (we can't
// un-capture earlier sources). Otherwise go back to description.
onExit: () => setStep(dataSources.length === 0 ? 'description' : 'add-another'),
onExit: () => setStep('description'),
});

// Surface the "Remove a captured source" option only when there's something
Expand Down Expand Up @@ -381,7 +378,7 @@ export function AddKnowledgeBaseScreen({
prompt="Description (optional, press Enter to skip)"
onSubmit={(value: string) => {
setDescription(value);
setStep('data-source-type');
setStep(dataSources.length > 0 ? 'add-another' : 'data-source-type');
}}
onCancel={() => setStep('name')}
allowEmpty
Expand Down Expand Up @@ -413,7 +410,7 @@ export function AddKnowledgeBaseScreen({
setDataSources([...dataSources, { dataSourceType: pendingType, value }]);
setStep('add-another');
}}
onCancel={() => setStep(dataSources.length === 0 ? 'data-source-type' : 'add-another')}
onCancel={() => setStep('data-source-type')}
schema={S3UriSchema}
/>
)}
Expand Down Expand Up @@ -442,7 +439,7 @@ export function AddKnowledgeBaseScreen({
]);
setStep('add-another');
}}
onCancel={() => setStep(dataSources.length === 0 ? 'data-source-type' : 'add-another')}
onCancel={() => setStep('data-source-type')}
schema={makeConnectorConfigSchema(pendingType)}
/>
)}
Expand Down
Loading