Skip to content

M6: retain document-script errors in console and button output - #1

Open
enriquemelzer-bit wants to merge 1 commit into
mtlcl410:fix/doc-script-error-3940from
enriquemelzer-bit:fix/ui-document-script-errors-3985
Open

enriquemelzer-bit wants to merge 1 commit into
mtlcl410:fix/doc-script-error-3940from
enriquemelzer-bit:fix/ui-document-script-errors-3985

Conversation

@enriquemelzer-bit

Copy link
Copy Markdown

What this changes

Follow-up for Brandon's review of storytold/pdfcraft#3985, based directly on that PR's head 994ce630. This targets the existing feature branch so the fix can be incorporated into storytold#3985.

run_console and run_button_script now include document-script errors in the visible JsOutput.errors list and retain their doc_errors provenance. The console displays Error: ... while keeping successful completion values; buttons retain their field changes, alerts and output. Errors from the explicitly executed script remain separate.

Two UI regressions cover successful execution after a document error, simultaneous document/console or document/button failures, and a button whose only output is the document error. The console test clicks Run and both tests check visible console labels.

Also includes one behavior-preserving boolean simplification in compare_ui.rs required by Rust 1.95's strict Clippy check, plus parity evidence, progress notes and my previously chosen public-profile credit preference.

How you verified it

  • RED: both new UI tests failed on the original code because zero document errors were displayed instead of one.
  • GREEN: all 7 JavaScript UI tests passed.
  • Full pdfcraft-ui-egui suite: 1,557 passed, 0 failed, 5 existing ignored (533 unit, 1,021 integration, 3 performance).
  • cargo fmt --all -- --check.
  • cargo clippy -p pdfcraft-ui-egui --all-targets --no-deps -j 2 -- -D warnings.
  • cargo xtask layers, cargo xtask assets, cargo xtask parity.
  • cargo check -p pdfcraft-ui-egui --target wasm32-unknown-unknown -j 2 passed; existing target-specific unused-code warnings remain.
  • Rendered and visually inspected the synthetic form's console: document error visible with result 42 retained. PDFCRAFT_SYSTEM_FONTS=0.
  • Independent diff review found no blockers.

Validation ran on Windows with Rust 1.95, --locked --offline, two build jobs and serial tests. A local-only Cargo configuration reduces debug information to match current main; no Cargo manifest or lockfile changes are included. File-writing tests ran outside the filesystem sandbox after confirming its restriction caused the existing CSV test to fail.

Safety, provenance and reach

No new panic paths, unsafe code, assets, fonts, network access, or permission changes. Tests reuse the existing synthetic form fixture. The engine and js_run behavior from storytold#3985 are unchanged; this repairs the UI adapters. Parity evidence now names the two UI regressions.

mtlcl410 pushed a commit that referenced this pull request Oct 30, 2026
Merge main; set typing_from in two tests from storytold#4441
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant