Skip to content

fix(sidebar): rest the footer on the composer's baseline - #251

Merged
haitaopanhq merged 1 commit into
mainfrom
feature/sidebar-footer-baseline
Aug 7, 2026
Merged

fix(sidebar): rest the footer on the composer's baseline#251
haitaopanhq merged 1 commit into
mainfrom
feature/sidebar-footer-baseline

Conversation

@haitaopanhq

Copy link
Copy Markdown
Contributor

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

Sidebar footer Composer card (minimum)
Block height 1 + 6 + 40 + 6 + 40 + 6 + 40 = 139 176 − 8 − 8 − 8 = 152
Bottom edge paneBottom − 4 paneBottom − 16
Top edge paneBottom − 143 paneBottom − 168

A 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 footer adds 12pt below; the sidebar pane's own 4pt padding makes up the composer's 16pt.
  • The divider gap widens until the block reaches the composer card's 152pt.

The numbers are named and derived (sidebarFooterBlockHeight is composed from its parts) rather than inlined as magic constants.

What keeps it aligned

test/features/app/sidebar_footer_baseline_test.dart asserts 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 assistantComposerBaseHeightCompactInternal wins over assistantWorkspaceMinLowerPaneHeightInternal. 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 → clean
  • flutter test568 passed, 6 failed. The 6 are the pre-existing mobile baseline, unchanged from main.
  • Confirmed visually in a release build (window-targeted capture): the footer's last row and the composer card end on the same line.

Migration / rollback

Presentation only. Straight revert.

🤖 Generated with Claude Code

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>
@haitaopanhq
haitaopanhq merged commit 66d9c28 into main Aug 7, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant