fix(tui): align tab mouse hitboxes with rendered labels - #573
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Owner
|
@jeongjin0 this has been merged to v3.0.0: https://github.com/junhoyeo/tokscale/releases/tag/v3.0.0 thanks for the contribution! |
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
Fixes a TUI tab mouse hitbox alignment bug where clicking directly on the visible
Dailytab label could activate the tab to its left, requiring users to click farther right than the rendered label.The header previously rebuilt tab click areas with a hard-coded horizontal offset (
area.x + 12) while Ratatui rendersTabsinside the bordered block's inner area. The registered mouse hitboxes now follow the same geometry as the rendered tab strip: block inner area, left/right tab padding, rendered label width, and the custom" │ "divider.Changes
Dailylabel in the normal tab layout.Dayshort label in the very-narrow tab layout.Verification
cargo fmt --checkcargo check -p tokscale-clicargo test -p tokscale-cli daily_label_click_uses_rendered_normal_tab_positioncargo test -p tokscale-cli daily_short_label_click_uses_rendered_very_narrow_tab_positioncargo test -p tokscale-cligit diff --checkManual QA
cargo run -p tokscale-cli -- tuiDailytab label and confirmed it switches to Daily without needing to click to the right of the label.CI Notes
This touches
crates/tokscale-cli/**, so the native CLI build workflow is expected to run. The broader Rust CI may also run workspace formatting, clippy, and tests.Summary by cubic
Fixes TUI tab hitboxes so clicking directly on a label selects the correct tab. Click areas now match the rendered
ratatuiTabsgeometry, removing the rightward offset.Written for commit 059b216. Summary will update on new commits. Review in cubic