Skip to content

TUI runs two double-click detectors — adopt quadraui DoubleClickDetector and delete the hand-rolled 400ms window #817

Description

@JDonaghy

Problem

quadraui ships DoubleClickDetector (quadraui/src/dispatch.rs:870), and TuiBackend already embeds one (tui/backend.rs:129, :235) and emits UiEvent::DoubleClick. src/tui_main/shell_app.rs handles UiEvent::DoubleClick at 8 sites.

At the same time, src/tui_main/mouse.rs threads last_click_time / last_click_pos through handle_mouse (:262-263) and re-detects double-clicks with a hand-rolled 400 ms window at :572, :1958, :2076, :2158.

Two double-click detectors are running on one backend, with independent timing state that can disagree. grep -rn DoubleClickDetector src/ → 0.

Fix

Delete the hand-rolled detection. Route all four sites through the UiEvent::DoubleClick the backend already emits, matching the 8 sites in shell_app.rs that consume it. Drop last_click_time / last_click_pos from handle_mouse's parameter list (it currently takes 33 parameters — this is a small step toward that being tractable).

Check the GTK side for the same pattern while here: src/app.rs:1182-1292 handles double/ctrl click.

Acceptance

  • Black-box tests required — double-click word selection in the editor, and on whichever of the four sites (:1958, :2076, :2158) are user-reachable.
  • State in the PR that the new tests fail against unfixed develop.
  • Both backends per the multi-backend rule.

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 pipelineplatformPlatform-specific (macOS, Windows, Linux)status:readyRefined and ready to enter the work pipeline

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions