fix(ui/tree): no fingerer-ring bleed at the bottom of the modal#29
Merged
Conversation
The tree modal subtracted a hardcoded `HELP_BAR_HEIGHT = 2` from the frame height, but `ui::mod.rs` reserves `wrapped_height(help_text, …)` rows for the help bar — which is `1` on wide-enough terminals. When help fit in a single row, the modal stopped 2 rows from the bottom and the bottom-most row of the biscuit (its surrounding fingerers) showed through underneath the modal. Pass the live `help_height` from `ui::mod.rs` down to `tree::draw` so the modal hugs exactly the row above the help bar. The hardcoded constant goes away.
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
The tree modal hardcoded
HELP_BAR_HEIGHT = 2and shrunk its own rect toarea.height - 2, but the help bar actually useswrapped_height(help_text, …)which is 1 on wide-enough terminals where the help text fits in a single row. When that happens, the modal stops 2 rows from the bottom but the help bar only paints the last 1 — leaving a one-row strip where the biscuit + orbiting fingerers underneath show through.Fix: pass the live
help_heightfromui::mod.rsintotree::drawso the modal hugs exactly the row above the actual help bar. The hardcoded constant goes away.Reproduction (pre-fix)
Run at a wide terminal (≥ ~145 columns wide) where the help text fits on one line, with many owned fingerers so the orbital ring extends to the bottom of the play area. Open the tree (
t). The bottom row of the orbit (Index Finger>>, Whole Hand[], Latex Glove<>glyphs etc.) is visible just above the help bar.Test plan
cargo test,cargo clippy --all-targets -- -D warnings,cargo fmt --check.