feat: cache bottom-panel geometry; resolve_bottom_panel_zone (#418) - #424
Merged
Conversation
…g work Multiple agents may be active concurrently; without an explicit claim signal two agents can race on the same issue. Adds a new step 1 to the development workflow: `gh issue edit <N> --add-assignee @me` plus an empty feature branch pushed from develop. Adjusts step 3 so subsequent pushes to the claim branch are fine (the no-PR-yet gate is preserved). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
quadraui::ContextMenuItem gained three new optional fields (checked, key_equivalent, submenu); develop wouldn't compile without them. The struct derives Default and the doc explicitly recommends struct-update syntax for forward compat. Patches the 4 literals in src/render.rs (build_menu_defs separator + item; context_menu_to_quadraui item + separator_after). Drive-by to unblock CI for issue-418. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both GTK click handlers (mouse-down, mouse-drag) and the TUI mouse
handler each recomputed the bottom panel's top-y and zone-row
boundaries from scratch — ~20 lines of chrome/status/wildmenu math
per site, including a pixel-exact maximize snap that had to match
draw.rs by hand. Three copies, three opportunities to drift.
This caches the geometry once at paint time and exposes a single
engine helper:
- New `BottomPanelGeometry { top_y, height, row_h }` written at paint
time by gtk/draw.rs (pixels) and tui_main/render_impl.rs (rows).
Cleared in the else-branch when the panel isn't painted.
- New `BottomPanelZone { TabBar, Toolbar, Content { row_offset } }`
returned by `Engine::resolve_bottom_panel_zone(y)` — unit-agnostic
so both backends share the same dispatch.
- GTK click handlers reduced from ~50 lines of pixel math each to a
single `resolve_bottom_panel_zone(y)` call. Net -95 lines in
gtk/mod.rs.
- TUI mouse handler same migration for the tab-bar and terminal-panel
dispatch sites. Net -30 lines in tui_main/mouse.rs.
Sidesteps the PanelChromeDesc row-vs-pixel discrepancy (#168) for
the click path: the click handlers now read the same value the paint
function wrote, so paint/click agreement is guaranteed by construction.
Closes #418.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace uniform `row_h` with `toolbar_y`, `content_y`, and `content_row_h` so backends with non-uniform row heights (e.g. GTK's taller tab bar) get correct zone detection. Also fixes: - TerminalCopySelection RefCell double-borrow (same pattern as #419) - ContextMenuItem ..Default::default() compile error after rebase Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JDonaghy
force-pushed
the
issue-418-terminal-hit-regions
branch
from
May 16, 2026 21:11
de8f14b to
8a53307
Compare
Owner
Author
|
Rebased onto develop, fixed three issues:
Pre-existing TUI terminal split issues filed as #428. Terminal click dedup follow-up filed as #429. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
draw.rsby hand — three copies, three drift opportunities). Now: paint-time writes a singleBottomPanelGeometry { top_y, height, row_h }; click handlers callEngine::resolve_bottom_panel_zone(y) -> Option<BottomPanelZone>and dispatch onTabBar/Toolbar/Content { row_offset }. Net -125 lines across the two backends. Sidesteps the PanelChromeDesc row-vs-pixel discrepancy (quadraui: PanelChromeDesc is row-based but GTK chrome is sub-row (pixel mismatch) #168) for the click path — paint/click agreement is guaranteed by construction.fix:—quadraui::ContextMenuItemgainedchecked/key_equivalent/submenufields;developwasn't compiling. Added..Default::default()to the 4 literals insrc/render.rs. Smallest possible unblock; the struct derivesDefaultand the docstring explicitly recommends struct-update syntax.docs:— New step 1 in the dev workflow: claim an issue before starting work viagh issue edit <N> --add-assignee @meplus an empty branch push. Multiple agents may run concurrently; an explicit claim signal prevents races. Step 3 adjusted so subsequent pushes to the claim branch are fine (PR-creation gate is preserved).Closes #418.
Test plan
cargo fmt && cargo clippy -- -D warnings && cargo test --no-default-features --lib && cargo build— all green locally before pushing+new tab), click in the content area and drag-select textheightbound inBottomPanelGeometry)🤖 Generated with Claude Code