Repository navigation
fix(workflows): preserve input drafts across editor modes - #1065
Conversation
dovvnloading
left a comment
There was a problem hiding this comment.
Merge review
Reviewed all four changed files against #1034's acceptance criteria. The conversion no longer resets to examples when required inputs are incomplete, JSON-to-form switching checks the complete typed request for loss, failed conversions retain the active editor, and edits invalidate the preview without changing the approval/start sequence. No blocking new code defect found. Existing CSV parser limitations (#1031) remain outside this patch.
Verified CI run 45594651177: Python compile/lint/pytest, frontend schema/typecheck/lint/Vitest/build, package build/import and POSIX checks passed. The frontend log explicitly shows all 11 launcher regressions passing, 185 test files and 4,181 tests total. The PR is one commit ahead of its merge base and main has advanced eight unrelated commits, with no changed-file overlap or GitHub-reported merge conflict at review time. No existing review comments/threads.
Limitations: the browser E2E job is intentionally skipped on PRs by repository CI policy; manual app/keyboard/theme verification was not performed because checkout and npm registry DNS are unavailable here. The original draft notes requested manual verification. For this targeted nonvisual fix, the repository owner's current request to process and merge a PR, the passing interaction regression tests covering the linked issue's acceptance criteria, and unchanged switch/design-system components are the basis for proceeding; this is not a claim that manual checks passed. This is a comment review rather than independent approval because the connected account authored the PR.
Summary
Fixes #1034. Switching the workflow launcher between the form and JSON used to replace partial or invalid drafts with example inputs and restore stale form values after editing JSON. Convert the current values in both directions; keep the active editor and show an error whenever the form cannot faithfully represent a request.
What Changed
Why
Validation
python -m compileall -q .passes (run from the repo root - matches CI)python -m pytest -qpasses (run from the repo root - matches CI)cd web_ui && npm run checkpasses (matches CI)Local Git checkout failed because github.com cannot be resolved in this environment. The isolated harness does not exercise React, Vitest, the full TypeScript project or the backend. The new component tests and required CI jobs remain unverified locally. From a configured checkout:
npm --prefix web_ui run test -- src/app/chrome/WorkflowRunLauncher.test.tsx src/app/chrome/workflowApi.test.ts src/app/chrome/WorkflowPresetsPanel.test.tsx npm --prefix web_ui run checkManual verification: fill one required input, leave another empty, switch to JSON, edit values, switch back, and preview. Try malformed JSON and an asset reference; verify the mode and draft remain unchanged on failure. Check keyboard operation and both themes.
UI Notes
Uses the existing switch and InlineAlert kit, without new styles. Visual and keyboard checks still pending.
Additional Context
JSON formatting may change when switching successfully; the round-trip protects typed values, not whitespace or object key order. The existing CSV form parser's separate issues (#1031) are not changed; the JSON-to-form round-trip prevents silently coercing typed table values. No dependency, schema, workflow execution, approval, or CI changes. Draft pending CI and manual verification; do not merge until these pass.