Skip to content

Adopt quadraui SplitTree for divider geometry — 0 uses today, ~800 lines hand-rolled #818

Description

@JDonaghy

Problem

quadraui ships primitives/split_tree.rs (916 lines): SplitTree::layout, hit_test_divider, hit_test_divider_cell, and ratio adjustment.

grep -rn SplitTree src/0 uses anywhere in vimcode.

vimcode instead hand-rolls the same geometry across ~800 lines:

  • src/render.rs:20485-21008 (524 lines) — DividerGeometry trait, divider_hit_test, divider_ratio_from_pos, divider_to_split, DividerMetrics
  • src/render.rs:4472-4850 — divider grab/drag routing
  • Per-backend metrics tables: GTK_DIVIDER_METRICS at src/render.rs:4511 (quantize: false), while the TUI builds its own inline at src/tui_main/mouse.rs:2397

Those two metrics tables are one of the per-backend policy forks that keep render.rs from being genuinely neutral — the fork moved into the argument rather than out of existence.

Fix

Adopt SplitTree for divider layout, hit-testing and ratio adjustment on both backends. Delete src/render.rs:20485-21008 and the divider half of :4472-4850. Both metrics tables should collapse into whatever unit parameter SplitTree already takes.

If SplitTree cannot express the quantize-vs-continuous difference the two tables encode, file the quadraui gap and leave this open behind it rather than keeping the local copy.

Acceptance

  • Black-box tests required, both backends: drag a window divider and assert the rendered split ratio changes; assert the divider hit zone is where paint put it.
  • Assert on rendered output, not on state.
  • State in the PR that the new tests fail against unfixed develop.

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