← Commit history

0.9.282: Wiki #71 (Ray's remaining case): on a fresh Symbol Editor the filtered tree lists the symbol but nothing is selected, so the posted Enter has nothing to activate and the posted double-click depends on row geometry (DPI). Ray measured select-then-real-Enter loads it. show_library now adds keyboard-only rounds: Down x1..3 posted to the tree candidates, then Enter, title-verified, still PostMessage only (no focus, no foreground). Success responses carry the navigation trace too, so a re-run shows which round landed.

John Lauer ·0975877daf ·1mo ago ·parent fb85a63
1 file changed +26
handlers/open_symbol_editor.py+26
@@ -564,6 +564,30 @@ def _background_navigate_win32(sym_hwnd: int, filter_text: str, verify: str,             return True     trace["steps"].append(f"VK_RETURN to {len(cands)} tree candidate(s); title still {_get_symbol_editor_title()!r}") +    # Round 1b/1c (wiki #71, measured 2026-09-03 on ConfRoomROG and by Ray on+    # ROG-Zephyrus): on a FRESH editor the filtered tree lists the symbol but+    # NOTHING is selected, so Enter has nothing to activate; Down posted to the+    # search Edit does not move the tree's selection. After one real click in+    # the tree (which selects a row), the same posted Enter loads the symbol+    # even with the editor behind other windows. So select from inside the+    # tree: post Down to the tree candidates (first Down lands on the library+    # node, second on the symbol row under it), then Enter, and let the title+    # judge. Still PostMessage only: no focus, no foreground.+    for downs in (1, 2, 3):+        for hwnd, _r in cands:+            user32.PostMessageW(hwnd, WM_KEYDOWN, VK_DOWN, 0)+            user32.PostMessageW(hwnd, WM_KEYUP, VK_DOWN, 0)+        time.sleep(0.4)+        for hwnd, _r in cands:+            user32.PostMessageW(hwnd, WM_KEYDOWN, VK_RETURN, 0)+            user32.PostMessageW(hwnd, WM_KEYUP, VK_RETURN, 0)+        for _ in range(5):+            time.sleep(0.6)+            if _title_ok():+                trace["steps"].append(f"Down x{downs} then VK_RETURN to tree candidates -> title confirms")+                return True+        trace["steps"].append(f"Down x{downs} then VK_RETURN to tree; title still {_get_symbol_editor_title()!r}")+     # Round 2: double-click the selected row (first visible row sits just under     # the header) — pure PostMessage, still zero focus.     WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, MK_LBUTTON = 0x0201, 0x0202, 0x0203, 0x0001@@ -1077,6 +1101,7 @@ def handle_open_symbol_editor(kicad_info: dict, args: dict) -> dict:             "success": True,             "output": f"Symbol '{search_text}' loaded (background win32 path): {_get_symbol_editor_title()}",             "via": "win32-background",+            "navigation": dict(_LAST_NAV_TRACE),             "rescanned": rescanned,             **_resolved_fields(_get_symbol_editor_title(), library_name),         }@@ -1105,6 +1130,7 @@ def handle_open_symbol_editor(kicad_info: dict, args: dict) -> dict:             "output": f"Symbol '{search_text}' loaded (background win32 path, 2nd attempt): "                       f"{_get_symbol_editor_title()}",             "via": "win32-background",+            "navigation": dict(_LAST_NAV_TRACE),             "attempts": 2,             **_resolved_fields(_get_symbol_editor_title(), library_name),             "rescanned": rescanned,