fix: footer margin handling (Closes #6616 )#6618
Open
ninix07 wants to merge 1 commit into
Open
Conversation
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.
Description
This PR resolves the issue where setting a margin on a docked
Footerwould not shrink the footer correctly on both sides, causing the right margin to clip off-screen.Root Cause
The
Footerwidget inherits fromScrollableContainer, which defaults towidth: 1fr;. For docked widgets, the layout resolver evaluates fractional widths (1fr) relative to the full container size (e.g.120cells) without subtracting the margins. It then adds the margins on top of this width (e.g.120 + 10 = 130cells), which causes the widget to exceed the screen width and clip the right margin off-screen when translated by the left margin.Solution
Adding
width: 100%;to theFooterwidget'sDEFAULT_CSSoverrides the inherited1fr. Percentage-based widths in the box model resolver are calculated relative to the container width minus the margins. This allows the footer to resolve to the correct size (110cells) and shrink properly to respect both the left and right margins (matching howHeaderworks).Testing
tests/snapshot_tests/snapshot_apps/footer_margin.pyto render theFooterwith a margin of 5 on all sides over a blue background.test_footer_margintotests/snapshot_tests/test_snapshots.pyand generated the baseline SVG (test_footer_margin.svg).Related Issues
Closes #6616
This Pull Request was generated with the assistance of Windsurf, an AI-powered code editor.