Close #37: GUI lifecycle: teardown, guarded callbacks, cache lock, temp-file cleanup, cancel - #158
Close #37: GUI lifecycle: teardown, guarded callbacks, cache lock, temp-file cleanup, cancel#158prekabreki wants to merge 1 commit into
Conversation
…mp-file cleanup, cancel
|
Bouncing on one function. Everything else in this PR is correct and is being kept — the teardown handler,
subprocess.run(["taskkill", "/F", "/IM", "claude.exe"], ...) # Windows
subprocess.run(["pkill", "-f", "claude"], ...) # POSIXBoth match by name, not by handle, so they kill every The root cause is that the GUI never had a handle on its child at all — The issue has been re-scoped as a single delta: plumb an optional handle up from the backend, terminate only that (bounded Retrying on pro, forked from this branch so the correct work is preserved. Not deleting the branch. |
What changed
Added full GUI lifecycle (teardown, guarded callbacks, cache lock, temp-file cleanup, cancel affordance) to
VOFormatterApp.Files
vo_format/gui.py— added_post,_on_close,_on_cancel,_reap_claude,_set_busy; routed all 18self.after(0, ...)sites through_post; addedthreading.Lockfor_raw_page_cache; fixed temp-file cleanup in preview worker; added cancel button and cancel event checks in workers; stored timer IDs for cancellation on teardown.Assumptions made
taskkill/pkillexternally since backend modules are off-limits._set_busyhelper wraps_busyassignment to auto-show/hide the cancel button and auto-clear the cancel event.self._busy = Falsein__init__stays as a bare assignment because_set_busyreferences widgets not yet created.Uncertainties
none
Test
./.venv/Scripts/python.exe -m pytest tests/ -q— 365 passedCloses #37