Repro
- Start a debug session in GTK (`vimcode`, F5 with a launch.json).
- Open the Variables / Locals tree in the debug sidebar.
- Click any item (especially deeper rows).
Observed: the click activates the item ~2 rows ABOVE the one under the cursor. Worse for items further down the list.
Suspected cause
Same pattern as #210 — the click handler computes `item_idx = (y / row_height).floor()` by hand, but the rasteriser's actual row positions don't match that math. Likely the section headers (Locals / Watch / etc.) are rendered with different row heights than the items they contain, and the click handler doesn't account for that variation.
Files
- `src/gtk/draw.rs::draw_debug_sidebar` (or wherever the var tree is rendered)
- `src/gtk/mod.rs` debug sidebar click handler
- Engine-side: `Engine::dap_variables`, `Engine::dap_scope_groups`
Surfaced by
User smoke testing during #205 slice 8 (`caf62a8`) — different surface but same root cause as the menu-dropdown bug fixed in slice 6.
Likely fix
Either:
- Migrate the debug sidebar rendering to a shared primitive (TreeView or a new debug-specific layout) that owns the hit-test math — proper structural fix, similar to slice 6 / 8 pattern.
- Walk the same accumulator the rasteriser uses (variable per-row heights) and store hit zones for the click handler — bandaid.
Per #210, the structural fix is the right call once the sidebar render gets factored.
Repro
Observed: the click activates the item ~2 rows ABOVE the one under the cursor. Worse for items further down the list.
Suspected cause
Same pattern as #210 — the click handler computes `item_idx = (y / row_height).floor()` by hand, but the rasteriser's actual row positions don't match that math. Likely the section headers (Locals / Watch / etc.) are rendered with different row heights than the items they contain, and the click handler doesn't account for that variation.
Files
Surfaced by
User smoke testing during #205 slice 8 (`caf62a8`) — different surface but same root cause as the menu-dropdown bug fixed in slice 6.
Likely fix
Either:
Per #210, the structural fix is the right call once the sidebar render gets factored.