Return to summary selector when cancelling custom instructions editor

This commit is contained in:
Mario Zechner 2026-01-12 00:12:36 +01:00
parent 3caaae0491
commit a0311fd5b9

View file

@ -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