Skip to content

TUI debug sidebar: scrollbar click doesn't reach handle_mouse #242

Description

@JDonaghy

Problem

In the activity-bar Debug sidebar (Variables / Watch / Call Stack / Breakpoints), per-section scrollbar clicks don't trigger the click handler in `src/tui_main/mouse.rs`. The user reports that thumb-drag and track-click both fail to scroll the section.

Investigation so far

After Phase B.4 Stage 5c (commit `f8d394f`), the click handler at `src/tui_main/mouse.rs:2641` should arm a `quadraui::DragState::ScrollbarY` with widget id `tui:debug_sidebar:N`. The renderer's thumb-position formula was also fixed to match `dispatch_mouse_drag` math (`scroll * sec_height / total_items` instead of the previous one-off `/(total - sec_height)`).

A debug-log trace (`vcd --debug /tmp/vcd.log`) showed:

  • Clicks were captured at `col=5..11`, never near the rendered scrollbar column (`sb_col=31` in that session).
  • A second test with a single deliberate scrollbar-track click produced zero `debug-sidebar` log entries — the click never reached `handle_mouse`'s debug-sidebar branch at all.

Hypotheses

  1. The scrollbar isn't visually rendered in the user's setup despite the heights/item-count condition being met (renderer bug).
  2. A gating check earlier in `handle_mouse` swallows the event before reaching the debug-sidebar block.
  3. Coordinate mismatch — terminal mouse-event column doesn't match the visible scrollbar column.

Repro

  1. Run `cargo run --bin vcd -- --debug /tmp/vcd.log `.
  2. Set breakpoints / start a debug session so a section overflows its allocated rows.
  3. Click on the visible scrollbar column at the right edge of an overflowing section.
  4. Observed: nothing scrolls. Log shows no `debug-sidebar` entries.

Files

  • `src/tui_main/mouse.rs:2611-2700` — `TuiPanel::Debug` click handler.
  • `src/tui_main/panels.rs:3360-3380` — section scrollbar renderer.
  • `src/tui_main/mouse.rs:62-133` — `apply_scrollbar_drag` apply-side router.

Acceptance

Click anywhere on the visible thumb or track of any debug-sidebar section should scroll that section, with thumb-grab preservation matching every other migrated scrollbar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions