From fb82f36e6d6492dd0740984d8d78ea4eaa30361e Mon Sep 17 00:00:00 2001 From: AlexRV12 <71396855+AlexRV12@users.noreply.github.com> Date: Thu, 27 Aug 2026 18:51:08 +0200 Subject: [PATCH] fix: pre-fill the test panel JSON args editor and align its placeholder (#10871) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: pre-fill the test panel JSON args editor and align its placeholder Co-Authored-By: Claude Opus 5 (1M context) * fix: reseed the JSON args editor when the preprocessor tab is selected Co-Authored-By: Claude Opus 5 (1M context) * fix: seed schema defaults and own-property args in the JSON payload Co-Authored-By: Claude Opus 5 (1M context) * fix: follow the schema in an untouched JSON payload, ignore same-tab clicks Co-Authored-By: Claude Opus 5 (1M context) * fix: latch JSON editor ownership from Monaco, drop the late remounts The pristine check read the bound `code` value, which trails the buffer by SimpleEditor's 200ms debounce — a reseed arriving in that window overwrote text already typed. Latch ownership from Monaco's own change event instead, via a new undebounced `input` event guarded so `setCode`'s `setValue` does not read as an edit. Both `.then(() => argsRender++)` bumps are gone: the arg views now remount at the tab transition only, and follow the schema in through `initialCode` when inference resolves, so a remount can no longer land on an in-progress payload. `FlowPreviewContent.selectInput` overwrote the editor on select but not on deselect, leaving the abandoned input's payload over reverted args. Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 5 (1M context) --- frontend/src/lib/components/Dev.svelte | 7 +- .../lib/components/FlowPreviewContent.svelte | 15 +++- frontend/src/lib/components/JsonInputs.svelte | 41 +++++++++-- frontend/src/lib/components/RunForm.svelte | 10 ++- .../src/lib/components/ScriptEditor.svelte | 72 ++++++++++++++----- .../src/lib/components/SimpleEditor.svelte | 30 +++++++- frontend/src/lib/schema.test.ts | 62 ++++++++++++++++ frontend/src/lib/schema.ts | 30 ++++++++ .../(logged)/flows/get/[...path]/+page.svelte | 5 +- .../scripts/get/[...hash]/+page.svelte | 9 +-- 10 files changed, 239 insertions(+), 42 deletions(-) create mode 100644 frontend/src/lib/schema.test.ts diff --git a/frontend/src/lib/components/Dev.svelte b/frontend/src/lib/components/Dev.svelte index 54a68dd5a3..c7e83b8a80 100644 --- a/frontend/src/lib/components/Dev.svelte +++ b/frontend/src/lib/components/Dev.svelte @@ -1,6 +1,7 @@