Skip to content

fix(settings): stabilize Settings search header height and alignment (#19241) - #21343

Merged
kodjima33 merged 3 commits into
BasedHardware:mainfrom
Dragonire9:fix/settings-search-header-alignment-19241
Oct 13, 2026
Merged

kodjima33 merged 3 commits into
BasedHardware:mainfrom
Dragonire9:fix/settings-search-header-alignment-19241

Conversation

@Dragonire9

@Dragonire9 Dragonire9 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #19241.

Fixes header height instability and alignment discrepancy when opening/closing search in Settings (SettingsDrawer).

Root Cause

Previously, _buildHeader in lib/pages/settings/settings_drawer.dart swapped between a 44 pt normal header and a 56 pt search header inside an AnimatedSwitcher. When opening search, the list beneath jumped down by 12 pt (and jumped back up when cancelled). Additionally, the search row padding was fromLTRB(OmiSpacing.md, 0, OmiSpacing.xs, OmiSpacing.xs) (16 pt left padding), sitting 4 pt off the settings cards which have 20 pt left padding (OmiSpacing.lg).

Fix Details

  1. Fixed both normal and search headers to a consistent height: 48 pt (SizedBox), ensuring the content below never jumps or shifts when toggling search.
  2. Updated search header padding to fromLTRB(OmiSpacing.lg, 0, OmiSpacing.xs, 0) so the OmiSearchField aligns flush at 20 pt with the settings cards.

Verification

  • Added hermetic widget test in app/test/widgets/settings/settings_search_header_stability_test.dart verifying that toggling search keeps header height strictly at 48 pt, maintains list vertical position identically, and aligns search field at 20 pt.
  • Added unreleased changelog fragment app/changelog/unreleased/20261012-settings-search-header-height-fixed.json.

View guided diff

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks for this well-scoped fix and the regression test — the root-cause analysis in the description matches what the code actually does.

Per-file notes:

  • app/lib/pages/settings/settings_drawer.dart — the fix is correct and minimal. Both branches of _buildHeader now return a fixed SizedBox(height: 48), so the AnimatedSwitcher swaps same-height children and the SingleChildScrollView below no longer jumps 12 pt on open/cancel. Moving the search row's left padding from OmiSpacing.md (16) to OmiSpacing.lg (20) matches the cards' EdgeInsets.symmetric(horizontal: OmiSpacing.lg) scroll padding, which fixes the 4 pt misalignment. One non-blocking nit: the magic 48 now appears in both branches — a shared named constant would keep them from drifting apart later.
  • app/test/widgets/settings/settings_search_header_stability_test.dart — good hermetic harness (mock SharedPreferences, PlatformManager.initializeForLocalHarness, provider setup). It asserts exactly the behaviors from Settings: opening search makes every row jump 12 pt, and the field sits 4 pt off the cards #19241: 48 pt header in both states, identical list-top position across open and cancel, and the field's left edge at OmiSpacing.lg.
  • app/changelog/unreleased/20261012-settings-search-header-height-fixed.json — correct fragment format with user-facing wording.

Checks are green on the head. This is in good shape — leaving the final approval/merge to a human maintainer since this is your first contribution here.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added flutter flutter work positive-signal Automation verified a genuine fix/quality contribution labels Oct 12, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scoped, well-tested fix for #19241 (settings search header height/alignment jump); not already on main; confidence 5/5.

@kodjima33
kodjima33 merged commit 2d77690 into BasedHardware:main Oct 13, 2026
1 check passed
@Dragonire9

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and merging! 🙏

Bounty Payout Details:

Git-on-my-level added a commit that referenced this pull request Oct 13, 2026
…21343 follow-ups) (#21425)

* fix(app): restore green Flutter tests on main (#21302 #21340 #21341 #21343 follow-ups)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(app): measure category card text heights

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings: opening search makes every row jump 12 pt, and the field sits 4 pt off the cards

3 participants