authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-09-07 20:23:48-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-09-07 20:23:48-07:00
log6f5cbac92d1a569a60fc06bf1c9b993b4a5abc20
tree47d4488796ee2e3b73b19dcf8855280d648c5e95
parent06457c4d53a5d89b0271752c18d7091526928939
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

fix: reject native window timeouts before screenshot acceptance

Require the OneNote page frame and successful activation instead of accepting zero-valued AutoHotkey wait results or the transient startup frame. A timed-out window wait now fails before subsequent UI actions. Verified actual missing-modal failure and successful native page-frame navigation on a disposable Windows clone; native-runner regression tests pass. Assisted-by: gpt-6-astra

1 files changed, 4 insertions(+), 2 deletions(-)

tools/native_runner.py+4-2
......@@ -176,8 +176,10 @@ def capture(notebook, output, expected_pages=-1, author=None, screenshots=False,
176176 'OnError((exception, mode) => (FileAppend(exception.Message, "**"), ExitApp(1)))\n'
177177 'DetectHiddenWindows false\napp := ComObject("OneNote.Application")\n'
178178 f'app.NavigateTo("{page_id}", "", false)\n'
179 'hwnd := WinWait("ahk_exe ONENOTE.EXE",, 10)\n'
180 'WinMaximize(hwnd)\nWinActivate(hwnd)\nWinWaitActive(hwnd,, 10)\n',
179 'hwnd := WinWait("ahk_class Framework::CFrame ahk_exe ONENOTE.EXE",, 10)\n'
180 'if !hwnd\n throw Error("OneNote window did not appear")\n'
181 'WinMaximize(hwnd)\nWinActivate(hwnd)\n'
182 'if !WinWaitActive(hwnd,, 10)\n throw Error("OneNote window did not become active")\n',
181183 target=name, shot_delay_ms=1500)
182184 page.with_suffix('.navigation.json').write_text(json.dumps({k: v for k, v in result.items() if k != 'png_b64'}, indent=2))
183185 if result.get('png_b64'):