fix(app): prevent stale prompt control reads (#39842)

This commit is contained in:
OpeOginni 2026-08-01 11:46:46 +02:00 committed by GitHub
commit f67e80c275
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -212,20 +212,20 @@ export function PromptInputV2(props: PromptInputV2Props) {
onContext={props.controller.openContext}
onShell={props.controller.openShell}
/>
<Show when={view.agent}>
<Show when={view.agent} keyed>
{(control) => (
<PromptInputV2ConfiguredSelect title="Choose agent" keybind={["Mod", "."]} control={control()} />
<PromptInputV2ConfiguredSelect title="Choose agent" keybind={["Mod", "."]} control={control} />
)}
</Show>
<Show
when={props.modelControl}
fallback={
<Show when={view.model}>
<Show when={view.model} keyed>
{(control) => (
<PromptInputV2ConfiguredSelect
title="Choose model"
keybind={["Mod", "M"]}
control={control()}
control={control}
model
/>
)}
@ -234,13 +234,13 @@ export function PromptInputV2(props: PromptInputV2Props) {
>
{props.modelControl}
</Show>
<Show when={(props.variantControlVisible ?? true) && view.variant}>
<Show when={(props.variantControlVisible ?? true) && view.variant} keyed>
{(control) => (
<Show when={control().options().length > 1}>
<Show when={control.options().length > 1}>
<PromptInputV2ConfiguredSelect
title="Choose model variant"
keybind={["Shift", "Mod", "D"]}
control={control()}
control={control}
/>
</Show>
)}