mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 19:05:11 +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
|
||||
done(); // Close selector first
|
||||
|
||||
const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
|
||||
"No summary",
|
||||
"Summarize",
|
||||
"Summarize with custom prompt",
|
||||
]);
|
||||
|
||||
if (summaryChoice === undefined) {
|
||||
// User pressed escape - re-show tree selector
|
||||
this.showTreeSelector();
|
||||
return;
|
||||
}
|
||||
|
||||
const wantsSummary = summaryChoice !== "No summary";
|
||||
// Loop until user makes a complete choice or cancels to tree
|
||||
let wantsSummary = false;
|
||||
let customInstructions: string | undefined;
|
||||
|
||||
if (summaryChoice === "Summarize with custom prompt") {
|
||||
customInstructions = await this.showExtensionEditor("Custom summarization instructions");
|
||||
if (customInstructions === undefined) {
|
||||
// User cancelled - re-show tree selector
|
||||
while (true) {
|
||||
const summaryChoice = await this.showExtensionSelector("Summarize branch?", [
|
||||
"No summary",
|
||||
"Summarize",
|
||||
"Summarize with custom prompt",
|
||||
]);
|
||||
|
||||
if (summaryChoice === undefined) {
|
||||
// User pressed escape - re-show tree selector
|
||||
this.showTreeSelector();
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue