pdfcraft/crates/forms/src
Piohrun d576fe2b06
Forms: keep tiles and render unbaked field values during page re-render (#636)
* Forms: keep tiles and render unbaked field values during page re-render

In complex interactive forms, switching focus away from an edited field
caused its text to disappear for several seconds while background tiles
re-rendered.

- In DocView, retain existing tiles as stale rather than immediately
  purging them on page_changed so the canvas remains sharp without flashing.
- Prioritize visible tiles over backdrops in the render queue.
- Track unbaked form fields and paint an immediate egui widget preview
  for committed text, checkbox, and radio inputs until fresh raster
  tiles arrive.
- Scope page invalidation on form edits to pages containing the edited
  or calculated fields.
- Hoist fields lookup in recalculate_with and apply_changes to eliminate
  repeated parsing.
- Run JavaScript scripts via catch_unwind on the current thread instead of
  spawning a new thread per script invocation.
- Add contributor entry for Piohrun in contributors/people.toml.
- Add test switching_fields_keeps_committed_text_visible_immediately.

* Forms: address review feedback on tile stale tracking, hoist, and diff invalidation

- Revert crates/js to preserve dedicated 1 GiB stack thread for boa scripts.
- In DocView::page_changed, purge non-current-tag tiles and mark only current-tag tiles stale.
- Restore demand queue order in prepare_render_queue.
- Add unbaked overlay entries only on successful edit apply and only for fields whose values changed; fix font zoom calculation on 90°/270° pages.
- Re-read fields(doc) in recalculate_with only when script returns changes.
- Diff form before and after edit in apply_edit, invalidating pages with changed fields, falling back to document_changed for XFA or page-count changes.
- Add tests covering script recalculation side effects across pages, unbaked overlay cleanup on tile delivery/zoom/rejection, and checkbox recalc chaining.

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 15:15:48 -04:00
..
actions.rs Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
af.rs Run set-layer-visibility actions from links and push buttons (#292) 2026-10-08 11:27:10 -04:00
appearance.rs Forms: encode appearances with the existing simple font (#1044) 2026-10-11 12:07:47 -04:00
author.rs M6: bulk form-field properties and selection (#95) (#650) 2026-10-09 21:56:17 -04:00
detect.rs Rename PrintCraft to PdfCraft (#174) 2026-10-07 16:03:57 -04:00
lib.rs Forms: keep tiles and render unbaked field values during page re-render (#636) 2026-10-11 15:15:48 -04:00
scripting.rs Forms: keep tiles and render unbaked field values during page re-render (#636) 2026-10-11 15:15:48 -04:00
tests.rs Forms: keep tiles and render unbaked field values during page re-render (#636) 2026-10-11 15:15:48 -04:00