git_graph: Fix height realignment issues#54429
Merged
Anthony-Eid merged 5 commits intomainfrom Apr 21, 2026
Merged
Conversation
Replaces the hand-rolled `buffer_font_size + 12px` formula with the window text style's UI line height plus a named padding constant, then snaps the result to the nearest physical pixel so the canvas and uniform_list table layouts never drift. Also drops the `row_height` field on `GitGraph` since the value is cheap to recompute and all call sites have access to `&Window` + `&App`. Co-authored-by: lingyaochu <zx0@mail.ustc.edu.cn>
cole-miller
approved these changes
Apr 21, 2026
This was referenced Apr 22, 2026
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.
Special thanks to @lingyaochu for finding out the root cause of the issue.
Took the test from: #54233
The git graph was using
buffer_ui_sizewhen calculating the canvas row height and the table row height. This is wrong because elements such asLabelsin the graph table were rendered usingui_font_size. This PR normalizes the row height calculation by always usingui_font_sizefor the canvas and table row height calculation, and taking into account the scaling factor.This PR also fixes a bug where the bottom of the canvas could flicker on its first redraw because the uniform list hadn't cached the viewport size yet, and we underestimated the visible size of the canvas and underdrew it. We now fallback to the window height as the viewport size. This means we'll overdraw for a single frame whenever the uniform list hasn't cached the last item size, but it avoids the flicker!
Self-Review Checklist:
Closes #53492
Closes #53469
Release Notes: