From b13b1f181483dfb61d1be1d666f1595b4e7d504f Mon Sep 17 00:00:00 2001 From: blasty Date: Fri, 24 Jul 2026 16:43:36 +0200 Subject: decomp: restore the 'decompiling…' overlay on F5/Tab from the listing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The F5/Tab-from-listing path decompiled the function inside _decomp_from_listing (via _decomp_line_for) in a background thread with no overlay, THEN _show_active re-decompiled it -- but that second call hit the cache and returned instantly, so dec.loading was set and cleared within a frame and the overlay only flashed. The long wait (the real decompile) happened with nothing on screen. Raise the pseudocode pane + loading overlay synchronously in action_toggle_view before launching the background decompile, so the wait is covered. Non-function F5 restores the listing via _decomp_from_listing_failed. Pilot view_toggle now drives the real path (action_toggle_view from the listing) and asserts the overlay is raised synchronously; F5 paths (decomp_fallback, continuous_view, region_define) all still pass (20/20 + view_toggle 7/7). --- tests/test_scenarios.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index 94baf93..e21226c 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -617,17 +617,18 @@ async def s_view_toggle(c: Ctx): c.check("tab switches to disassembly", app._active == "listing" and dis.display and not dec.display, f"active={app._active}") - await c.press("tab") - await c.wait(lambda: app._active == "decomp", 10) - # a (re)decompile shows the grayed overlay + # F5/Tab from the listing must raise the 'decompiling…' overlay synchronously, + # BEFORE the background decompile runs (regression: it used to decompile first + # in _decomp_from_listing, so the overlay only flashed once cached). dec.loaded_ea = None - app._show_active() + app.action_toggle_view() cover = dec._cover_widget - c.check("decompile shows a 'decompiling…' overlay", + c.check("F5 from the listing raises the 'decompiling…' overlay", dec.loading and cover is not None and "decomp-loading" in cover.classes and "decompiling" in str(cover.render()), f"loading={dec.loading} cover={cover!r}") - await c.wait(lambda: not dec.loading and dec._cover_widget is None, 25) + await c.wait(lambda: app._active == "decomp" and not dec.loading + and dec._cover_widget is None, 25) c.check("overlay clears when the decompile finishes", not dec.loading and dec._cover_widget is None) # line-number gutter -- cgit v1.3.1-sl0p