You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ui-rewrite): reset prompt preview when Code-tab language changes (#5665)
Switching snippet language on the prompt details drawer left the previous
run's response body visible and kept the button on "Re-run". The Preview
state is prompt-scoped, but the visible affordances sit outside the language
tabs — so state persisted across tab switches.
- Add `reset()` to `usePromptPreview` that aborts any in-flight request,
clears result/error, and explicitly clears `isLoading` (run's finally
skips setLoading(false) when the signal is aborted).
- Make `PromptSnippetTabs` fully controlled via `value` + `onValueChange`.
- `PromptCodeTab` owns the active language and calls `preview.reset()`
before switching, so the button returns to "Preview" and the response
block unmounts.
Signed-off-by: a-effort <anna.effort@ibm.com>
0 commit comments