Tier: Small gap (needs cached layout exposed to drag overlay path)
Summary
build_tui_tab_slots() in src/tui_main/render_impl.rs:1202–1240 (~40 lines) hand-rolls per-tab x-bounds for the drag-and-drop overlay by walking gtb.tabs and computing tab.name.chars().count() + TAB_CLOSE_COLS per tab. This duplicates render::compute_tab_bar_hit_regions() (render.rs:463), which already does exactly this calculation and is the source of truth used by mouse-click routing.
What exists
render::compute_tab_bar_hit_regions(tabs, area, ...) (render.rs:463) — returns per-tab hit regions using quadraui::TabMeasure.
render::TAB_CLOSE_COLS (render.rs:437) — duplicated in render_impl.rs:1166 as a private const.
quadraui::TabBar::layout(...) produces per-tab layout inside the rasteriser scope when Backend::draw_tab_bar() is called.
What to do
Two options — either works:
Option A (preferred): Call compute_tab_bar_hit_regions() once per group/tab-bar during draw, cache the per-tab bounds (already a Vec<(x_start, x_end)> shape), and have render_tab_drag_overlay() consume the cache. Delete build_tui_tab_slots().
Option B: Expose TabBar.layout() results from inside Backend::enter_frame_scope() (or lift the layout call before draw) so the drag overlay can read per-tab bounds without recomputing.
Also: remove the duplicate TAB_CLOSE_COLS const in render_impl.rs:1166 and use render::TAB_CLOSE_COLS.
Files
src/tui_main/render_impl.rs — delete build_tui_tab_slots (~40 lines), update its two call sites at lines 1250 and 1353.
- Minor edits to plumb the cached bounds.
Dependencies
None blocking. Sibling refactor #347 already factored the tab-bar/breadcrumb render wrappers; this is a different residual (drag overlay slot lookup, not draw invocation).
Notes
Part of the TUI convergence backlog (#474). The biggest risk is the tab_scroll_offset > 0 → +2 overlay adjustment at lines 1212–1217 / 1227 — make sure the shared hit-region path accounts for it (or that the cached bounds already include the offset).
Tier: Small gap (needs cached layout exposed to drag overlay path)
Summary
build_tui_tab_slots()insrc/tui_main/render_impl.rs:1202–1240(~40 lines) hand-rolls per-tab x-bounds for the drag-and-drop overlay by walkinggtb.tabsand computingtab.name.chars().count() + TAB_CLOSE_COLSper tab. This duplicatesrender::compute_tab_bar_hit_regions()(render.rs:463), which already does exactly this calculation and is the source of truth used by mouse-click routing.What exists
render::compute_tab_bar_hit_regions(tabs, area, ...)(render.rs:463) — returns per-tab hit regions usingquadraui::TabMeasure.render::TAB_CLOSE_COLS(render.rs:437) — duplicated inrender_impl.rs:1166as a private const.quadraui::TabBar::layout(...)produces per-tab layout inside the rasteriser scope whenBackend::draw_tab_bar()is called.What to do
Two options — either works:
Option A (preferred): Call
compute_tab_bar_hit_regions()once per group/tab-bar during draw, cache the per-tab bounds (already aVec<(x_start, x_end)>shape), and haverender_tab_drag_overlay()consume the cache. Deletebuild_tui_tab_slots().Option B: Expose
TabBar.layout()results from insideBackend::enter_frame_scope()(or lift the layout call before draw) so the drag overlay can read per-tab bounds without recomputing.Also: remove the duplicate
TAB_CLOSE_COLSconst inrender_impl.rs:1166and userender::TAB_CLOSE_COLS.Files
src/tui_main/render_impl.rs— deletebuild_tui_tab_slots(~40 lines), update its two call sites at lines 1250 and 1353.Dependencies
None blocking. Sibling refactor #347 already factored the tab-bar/breadcrumb render wrappers; this is a different residual (drag overlay slot lookup, not draw invocation).
Notes
Part of the TUI convergence backlog (#474). The biggest risk is the
tab_scroll_offset > 0 → +2 overlayadjustment at lines 1212–1217 / 1227 — make sure the shared hit-region path accounts for it (or that the cached bounds already include the offset).