Skip to content

Commit e82e784

Browse files
committed
feat(prompt): enable auto-resize for function-based choices
When choices are provided as a function (Mode.GENERATE), the main process was skipping resize since choices arrive dynamically. This enables resize by default for function-based choices so the prompt properly adjusts as results stream in.
1 parent 4e3d42c commit e82e784

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/target/app.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,12 @@ global.basePrompt = async (
19431943
promptConfig.resize ??= true
19441944
}
19451945

1946+
// Enable resize for function-based choices (Mode.GENERATE)
1947+
// Without this, the main process skips resize when choices arrive dynamically
1948+
if (typeof choices === 'function') {
1949+
promptConfig.resize ??= true
1950+
}
1951+
19461952
if (typeof placeholderOrConfig === "string") {
19471953
promptConfig.placeholder = placeholderOrConfig
19481954
}

0 commit comments

Comments
 (0)