Skip to content

Retire four vimcode duplicates of logic quadraui already ships (tab scroll, measure, hit shim, split tree) #660

Description

@JDonaghy

What

Retire four pieces of vimcode that duplicate logic quadraui already ships. No behaviour change
in any of them.

Why now

These predate the current tab/split work — quadraui grew the generic version and vimcode was never
migrated. They surfaced while auditing what coord-tui should and should not copy from vimcode
(2026-08-15), and the audit's conclusion is worth recording: coord-tui will consume the quadraui
versions
, so every day vimcode keeps its own is a day the two apps can diverge on identical
functionality.

Two of these are load-bearing rather than cosmetic. fit_active_scroll_offset's own doc comment
says backends MUST use it instead of the engine algorithm, because a per-tab width estimate that
mismatches actual rendering leaves the active tab off-screen — exactly the class of bug quadraui
#554 was.

Design

Duplicate quadraui replacement
Engine::ensure_active_tab_visible (engine/windows.rs:1817) TabBar::fit_active_scroll_offset (primitives/tab_bar.rs:180)
tab_display_width / tabs_fitting_from TabMeasure + TabBar::layout
TabBarHitRegion / TabBarClickTarget (engine/mod.rs:1182-1209) TabBarLayout.hit_regions + TabBarHit
core/window.rs's split tree — its own SplitDirection, ratio, set_ratio_at_index, divider geometry quadraui::SplitTree

The third is already labelled as temporary in vimcode's own source
(src/render.rs:494): the shim exists "Until TUI / GTK / Win-GUI migrate to consume TabBarLayout
directly"
. This issue is that migration.

SplitDirection is inverted between the two crates. vimcode's Horizontal means split
top/bottom
(core/window.rs:9-13); quadraui's Horizontal means panes side-by-side, first =
left
(primitives/split.rs:40-49). A mechanical swap will silently rotate every split by 90°, and
it compiles. Convert deliberately, and assert orientation on a rendered grid rather than on the
enum name.

Sequence them as four separate commits — or four separate PRs — so a regression is bisectable to
one replacement.

Acceptance criteria

  • None of the four duplicates remain in src/.
  • The active tab is still scrolled into view after switching to an off-screen tab.
  • Wide-glyph tab labels (CJK / emoji) still measure correctly — the quadraui #448-G: GTK scroll wheel scrolls editor text in the wrong (inverted) direction #554 case.
  • Splits open in the same orientation as before, proven by a screen assertion, not by the enum.
  • Divider drag still resizes in the same direction and clamps the same way.
  • cargo build && cargo test EXIT=0 after each step.

Files

  • src/core/engine/windows.rs
  • src/core/engine/mod.rs
  • src/core/window.rs
  • src/render.rs
  • src/tui_main/render_impl.rs
  • src/gtk/click.rs

Out of scope

  • Any behaviour change.
  • The preview-tier and harness migrations, filed separately.

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 pipeline

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions