mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 08:00:59 +00:00
Return to summary selector when cancelling custom instructions editor
This commit is contained in:
parent
3caaae0491
commit
a0311fd5b9
1 changed files with 24 additions and 17 deletions
|
|
@ -2807,28 +2807,35 @@ export class InteractiveMode {
|
||||||
// Ask about summarization
|
// Ask about summarization
|
||||||
done(); // Close selector first
|
done(); // Close selector first
|
||||||
|
|
||||||
const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
|
// Loop until user makes a complete choice or cancels to tree
|
||||||
"No summary",
|
let wantsSummary = false;
|
||||||
"Summarize",
|
|
||||||
"Summarize with custom prompt",
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (summaryChoice === undefined) {
|
|
||||||
// User pressed escape - re-show tree selector
|
|
||||||
this.showTreeSelector();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const wantsSummary = summaryChoice !== "No summary";
|
|
||||||
let customInstructions: string | undefined;
|
let customInstructions: string | undefined;
|
||||||
|
|
||||||
if (summaryChoice === "Summarize with custom prompt") {
|
while (true) {
|
||||||
customInstructions = await this.showExtensionEditor("Custom summarization instructions");
|
const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
|
||||||
if (customInstructions === undefined) {
|
"No summary",
|
||||||
// User cancelled - re-show tree selector
|
"Summarize",
|
||||||
|
"Summarize with custom prompt",
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (summaryChoice === undefined) {
|
||||||
|
// User pressed escape - re-show tree selector
|
||||||
this.showTreeSelector();
|
this.showTreeSelector();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wantsSummary = summaryChoice !== "No summary";
|
||||||
|
|
||||||
|
if (summaryChoice === "Summarize with custom prompt") {
|
||||||
|
customInstructions = await this.showExtensionEditor("Custom summarization instructions");
|
||||||
|
if (customInstructions === undefined) {
|
||||||
|
// User cancelled - loop back to summary selector
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// User made a complete choice
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up escape handler and loader if summarizing
|
// Set up escape handler and loader if summarizing
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue