Skip to content

Converge the mouse ladder slice 4: panels — activity bar, sidebar, terminal, bottom tabs, quickfix #754

Description

@JDonaghy

Continuation of #733, slice 4 of 6. #733 declared a 6-slice plan and was
closed when slice 1's PR merged — the remaining slices were never filed. This issue is
one of them. Measured on develop @ 44882e9 (2026-09-02):

handle_mouse (src/tui_main/mouse.rs) 3,044 · handle_mouse_event
(src/tui_main/shell_app.rs) 365 · handle_mouse_click_msg (src/gtk/mod.rs) 919 ·
handle_mouse_drag_msg 356 · try_route_sidebar_mouse_event 1774,861 lines total,
against the 4,994 #733 was filed on. Slice 1 converged 133.

Locate everything below by symbol, not by line number#733's own body warns that
its numbers drift, and they already have.

The rungs

Rung TUI (mouse.rs banner) GTK
activity bar ── Activity bar ── handle_mouse_click_msg arm
sidebar panel area ── Sidebar panel area ── try_route_sidebar_mouse_event (177 lines)
right-click sidebar routing (#575) ── #575: right-click sidebar panel routing ── separate arm
terminal panel ── Terminal panel click ── handle_mouse_click_msg arm
SC / ext-panel hover ── SC button hover ──, ── Ext panel hover ── blank
quickfix inside the sidebar arm handle_mouse_click_msg arm

This is the slice that owns #544 (GTK sidebar clicks) and the mechanism behind
#499 / #484 (ext-panel section headers only partly toggling on click): the ext-panel
hover and header rungs exist on TUI and are blank on GTK, so a fix on one side is invisible
on the other.

The engine already owns the actions — handle_dap_sidebar_action_click (dap_ops.rs),
handle_ext_panel_double_click (ext_panel.rs), handle_terminal_pane_click
(terminal_ops.rs). This slice is the ladder, not the handlers.

Acceptance criteria

Inherited verbatim from #733 — these are the rules that make a slice done:

  • The rung is implemented once, in shared code (src/render.rs), and called from both
    backends.
  • Both backends' bespoke arms for that rung are deleted in the same PR. A migration that
    leaves both paths is not done (GOALS.md, "How to use this doc").
  • Black-box coverage on both backendsTuiDriver via driver_with_shell(TuiShellApp, …)
    in src/tui_main/shell_app.rs, and GtkDriver in src/gtk/testing.rs. Assert on rendered
    output
    , never on state being populated (CLAUDE.md rule 1).
  • The PR states the new tests were verified RED against unfixed develop (CLAUDE.md rule 2).
  • Combined production line count of the entry points above strictly decreases; the PR states
    before/after. (Converge the two mouse routers — ~4,800 lines implementing the same precedence ladder twice #733 slice 1 met this only barely — 4,994 → 4,861 — and Converge frame composition — ~4,500 lines laying down the same surfaces in two hand-kept orders #735 slice 1 did not
    meet it at all. State the numbers.)
  • cargo build && cargo test && cargo clippy -- -D warnings && cargo fmt --check EXIT=0.

Scope discipline

This is one slice. Do not attempt the rungs belonging to the sibling issues listed in
Sequencing — they conflict in the same files and are queued behind this one on purpose.

Files

  • src/render.rs (the shared router)
  • src/tui_main/mouse.rs, src/tui_main/shell_app.rs
  • src/gtk/mod.rs
  • src/gtk/testing.rs (GtkDriver coverage)

Sequencing

After slice 3 (dividers). try_route_sidebar_mouse_event should be gone, or reduced to a
native-plumbing shim, by the end of this slice.

Relates: #544, #499, #484.

Milestone

#7 Platform-Neutral

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

    coordTracked by coord-tui pipelineenhancementNew feature or requeststatus:readyRefined and ready to enter the work pipelinesub-taskSub-task of a parent issuetier:largeMulti-module / algorithm-heavy work. Routes to opus via models.labels.uiUI/rendering

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions