fix(sidebar): rest the footer on the composer's baseline - #251
Merged
Conversation
The sidebar footer and the composer card are the shell's two bottom blocks, sitting side by side across the window, but nothing kept them aligned: the footer was 139pt tall and 4pt off the pane bottom while the composer card was 152pt tall and 16pt off it. That left a 25pt step between the footer's divider and the card's top edge, which reads as a misalignment rather than as two separate components. The footer now adds 12pt below (the sidebar pane's own 4pt padding makes up the composer's 16pt) and pads the divider gap out until the block reaches the composer card's 152pt. Both blocks now share a baseline and a height. The magic numbers are named and derived rather than inlined, and sidebar_footer_baseline_test.dart asserts the footer block equals the composer's minimum card height and that the two bottom insets match — the blocks live in unrelated widgets, so nothing else would notice if one moved. One of those tests guards the derivation itself: if the min-lower-pane floor ever exceeds the compact base height, the arithmetic the other tests rely on stops describing the real layout, and that test fails first. Verification: - flutter analyze --no-pub → clean - flutter test → 568 passed, 6 failed; the 6 are the pre-existing mobile baseline, unchanged. - Confirmed visually in a release build: the footer's last row and the composer card now end on the same line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Outcome
The sidebar footer (设置 / 语言 / 主题) and the composer card are the shell's two bottom blocks, sitting side by side across the window — but nothing kept them aligned. Reported as "对话框UI 最低高度 和左侧边栏那个三设置 高度 不对齐".
They now share a baseline and a height.
Measured before
1 + 6 + 40 + 6 + 40 + 6 + 40= 139176 − 8 − 8 − 8= 152A 25pt step between the footer's divider and the card's top edge, and a 12pt step at the bottom. Two unrelated components would be fine; two blocks spanning the same row read as broken.
Fix
Only the sidebar side moves — the composer's minimum height is unchanged.
The numbers are named and derived (
sidebarFooterBlockHeightis composed from its parts) rather than inlined as magic constants.What keeps it aligned
test/features/app/sidebar_footer_baseline_test.dartasserts the footer block equals the composer's minimum card height, and that the two bottom insets match. These blocks live in unrelated widgets, so nothing else would notice if one of them moved.One test guards the derivation rather than the result: the arithmetic assumes
assistantComposerBaseHeightCompactInternalwins overassistantWorkspaceMinLowerPaneHeightInternal. If that ever flips, the other tests would be comparing against a number the layout no longer uses — so that assumption is asserted explicitly and fails first.Verification
flutter analyze --no-pub→ cleanflutter test→ 568 passed, 6 failed. The 6 are the pre-existing mobile baseline, unchanged frommain.Migration / rollback
Presentation only. Straight revert.
🤖 Generated with Claude Code