Commit Graph
4 Commits
Author SHA1 Message Date
FredApps ee081d033e fix(scripts): keep timers past a refused script; page actions before timers
A script refused before it runs (too long, or nested too deeply) left the
realm untouched but reported no timers. The viewer keeps only the timers
a run reports, so a button or console script over the limit stopped every
page timer. The realm now reports the timers it still has on that path.

The viewer built the page actions' run and the timers' run before it
handled either, so a due timer ran before what the page's open action
asked for: on a page that goes on to another, before that page's close
action could stop it. The timers now run after the page actions, and only
if those left the page, the tab and the dialogs as they were; otherwise
they wait a frame. The focused field's editor text is taken before each
run, not once for both.

Tests: a_script_refused_before_it_runs_reports_the_realms_timers (js),
a_script_refused_before_it_runs_keeps_the_pages_timers (engine),
timers_wait_for_the_page_a_page_action_goes_to (ui). Each fails without
its fix.
2026-11-11 19:48:17 +01:00
FredApps 223c1f02d4 fix(scripts): review fixes for page actions and timers
- A page action or timer whose edits are refused shows nothing it did:
  view changes go in only after apply_script_outcome accepts them.
- js_advance runs at most its 6,000-run cap; the last call only moves
  the clock (Session::run_timers_at_most).
- Field callbacks see the document's layers (getOCGs), also after a
  batch rebuilds the runner.
- The viewer's hit test uses what scripts show (shown_by_scripts): a
  frame they showed takes presses, one they hid doesn't.
- Print previews draw without the live annotation and appearance
  overrides.
- An appearance override naming no form (a cleared icon) draws nothing
  instead of the button's own face (hayro patch 105).
- Page actions and timers wait while a dialog or prompt is open.
- A timer editing the focused field refreshes its untouched draft.
2026-11-11 15:53:02 +01:00
FredAppsandPeter Yatsyshin 65ea96da4c style: fmt and a type alias for clippy
Co-authored-by: Peter Yatsyshin <p.yatsyshin@googlemail.com>
2026-11-11 11:37:07 +01:00
FredAppsandPeter Yatsyshin 17ae6ec9cd feat(engine): page actions and timers run in the document realm and change only the view (#169)
show_page runs a page's close/open actions, run_timers fires due timers (at most 16 a call),
next_timer and script_clock drive the viewer. Fields they show, hide or give another icon
are drawn so on screen only (screen_config); values and resets are undoable edits. A timer's
alerts and requests go to the console. getOCGs layer changes turn layers as the panel does.

Co-authored-by: Peter Yatsyshin <p.yatsyshin@googlemail.com>
2026-11-11 11:22:32 +01:00