fix(notifications): stop a preference row overflowing at a phone width - #100
Conversation
The icon-plus-text half of a preference row demanded its intrinsic width, so any channel carrying the push hint underneath its label pushed the row wider than its container: measured at 430px in a consuming app, Flutter painted "RIGHT OVERFLOWED BY 14 PIXELS" across every Push row. A two-line text column is wider than a one-line one, and nothing told it to shrink. `flex-1 min-w-0` on both the half and the text column lets the label and the hint wrap instead, and leaves the switch its own space. Every existing case in this file runs at 1280 or 1920, which is exactly why this was invisible: the new one runs at 430 with the hint present and asserts no exception. Without the fix it fails with a 267-pixel overflow (the test font is wider than the shipped one, so the number is larger than the app's 14).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@kodizm review |
|
@kodizm review |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. The layout fix is correct and narrowly scoped; only two minor housekeeping points, both outside the rendered code. The Minor
TestsThe new case at Checks I ran
|
What
The icon-plus-text half of a notification-preference row demanded its intrinsic
width, so any channel carrying the push hint underneath its label pushed the row
wider than its container. Measured at 430px in a consuming app (uptizm), Flutter
painted "RIGHT OVERFLOWED BY 14 PIXELS" across every Push row.
flex-1 min-w-0on both the half and the text column lets the label and the hintwrap, and leaves the switch its own space.
Why it was invisible
Every existing case in
magic_starter_notification_preferences_view_test.dartruns at 1280 or 1920, two of them widening the surface further with a comment
saying they do it so untranslated keys fit. So the row was only ever laid out
where it had room to spare.
The new case runs at 430 with
pushProvisioned: false, so the hint is present andthe row is two lines tall. Without the fix it fails with a 267-pixel overflow; the
number is larger than the app's 14 because the test font is wider than the shipped
one, which is also why the assertion is "no exception" rather than a pixel count.
Testing
flutter test: 1256 pass.dart formatclean,flutter analyzeclean.Correction, added after merge
This PR also carried an
analysis_options.yamlchange that its description nevermentioned: an
analyzer.excludeblock forbuild/**and the six platformdirectories. It had been sitting uncommitted in my working tree across several
sessions and a
git add -Aswept it in.The content is wanted (it is the same block going into uptizm as its own PR), so
it is not being reverted, but the record should say what actually landed. Measured
in the sibling repo: the block changes nothing today, since the platform
directories hold zero Dart files and the analyzer already leaves
build/alone.It is a guard for the first time that stops being true.
The preventable part was the staging. Explicit paths from here, not
-A.