Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix off-by-one error when calculating popup panel dimensions#5312

Open
stefanhaller wants to merge 3 commits intomasterfrom
fix-panel-resizing
Open

Fix off-by-one error when calculating popup panel dimensions#5312
stefanhaller wants to merge 3 commits intomasterfrom
fix-panel-resizing

Conversation

@stefanhaller
Copy link
Collaborator

The symptom of the bug was that confirmation panels with wrapped text were one character too wide, which could sometimes result in them being one line too heigh. One concrete example is the "Discard file changes" confirmation that appears when pressing d in the commit files panel.

The symptom of the bug was that confirmation panels with wrapped text were one
character too wide, which could sometimes result in them being one line too
heigh. One concrete example is the "Discard file changes" confirmation that
appears when pressing `d` in the commit files panel.

I got very confused when investigating this bug, and the reason is that
getPopupPanelDimensionsAux took two parameters panelWidth and panelHeight, but
the second was actually contentHeight. Rename it to contentHeight, and change
the first one to also be the content width rather than the panel width. This is
easier for clients, and less confusing.
I got confused when I investigated the bug that was fixed in the previous
commit, so hopefully these will be helpful for the next person reading this
code.
@stefanhaller stefanhaller added the bug Something isn't working label Feb 22, 2026
@codacy-production
Copy link

codacy-production bot commented Feb 22, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 818ca171 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (818ca17) Report Missing Report Missing Report Missing
Head commit (1b6c3ef) 59631 51958 87.13%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#5312) 24 24 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant