Let the theme turn a page header inline, so its two halves cannot drift - #92
Merged
Merged
Conversation
`MSPageHeader.inlineActions` does two things at once: it swaps `containerClassName` for `containerInlineClassName`, and it gives the title row `flex-1 min-w-0` instead of only `sm:flex-1`. Those are two halves of one decision, and until now a consumer could set the first and not the second, because the container class is a theme string while the flex behaviour is a widget argument. **That combination silently overflows.** An app that themes the container into a row at every width, so a phone header keeps its action beside the title rather than dropping it under the subtitle, leaves the title row without `flex-1` below `sm`. The title column is `flex-initial`, a loose fit, so the text takes its intrinsic width and runs past the actions. Measured in depools at 40 logical pixels on a 390px viewport with a two-word title and three icon buttons, and reproduced here at 79. `line-clamp-2` on the title cannot save it, for the same reason `truncate` cannot without a constrained box. `MSPageScaffold` does not forward `inlineActions` at all, so a scaffold consumer had no way to reach the second half even knowing it existed. Rather than threading an argument through the scaffold and asking every screen to pass it, the flag moves to `MagicStarterPageHeaderTheme`, beside the container class that requires it: one place, stated once, and the two cannot drift apart. `inlineActions` becomes `bool?` and falls back to the theme, so an explicit argument still beats it and every existing caller is unchanged. The overflow itself is a test. Reverting the title-row half turns it red with `A RenderFlex overflowed by 79 pixels on the right`, which is the defect rather than a proxy for it.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Aug 16, 2026
anilcancakir
added a commit
that referenced
this pull request
Aug 16, 2026
…#93) `CLAUDE.md` has a post-change checklist and I ran none of it: CHANGELOG under `[Unreleased]`, README where the API changed, and the relevant `doc/` pages. The code in #92 was right and the paper trail was missing, which for a released package is half the change. The CHANGELOG entry carries the measurement rather than only the fix: the combination that overflows is a theme override plus the missing flag, seen at 40 logical pixels in a host app and reproduced at 79 in the suite. `doc/architecture/manager.md` gains the case worth documenting, which is not "here is a new field" but "setting the container alone overflows". Anybody overriding `containerClassName` into a row is one paragraph away from the bug, so the paragraph sits under the override rather than under the flag. `doc/basics/components.md`'s one-line summary says the header stacks below `sm` and what turns that off. README is deliberately untouched: its component table is a name and a phrase, and the detail belongs in `doc/`, where it now is.
This was referenced Aug 16, 2026
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.
The defect
MSPageHeader.inlineActionsdoes two things at once:containerClassNameforcontainerInlineClassName, andflex-1 min-w-0instead of onlysm:flex-1.Those are two halves of one decision, and until now a consumer could set the first and not the second, because the container class is a theme string while the flex behaviour is a widget argument.
That combination silently overflows. An app that themes the container into a row at every width, so a phone header keeps its action beside the title rather than dropping it under the subtitle, leaves the title row without
flex-1belowsm. The title column isflex flex-col gap-1 flex-initial min-w-0, andflex-initialis a loose fit, so the text takes its intrinsic width and runs past the actions.line-clamp-2on the title cannot save it, for the same reasontruncatecannot without a constrained box: it sets the overflow behaviour and nothing about the width.How it was found
In depools, whose
main.dartoverridescontainerClassNametoflex-rowat every width with a comment that predicted this exactly:The product screen reported
A RenderFlex overflowed by 40 pixels on the rightat 390 with the title "Dishwasher Tablets" and three icon buttons. Confirmed by measurement rather than by reading: reverting that one override toflex-col sm:flex-rowremoved the stripe and the exception entirely, and the icons dropped to their own line.The fix
MSPageScaffolddoes not forwardinlineActionsat all, so a scaffold consumer had no way to reach the second half even knowing it existed. Rather than threading an argument through the scaffold and asking every screen to pass it, the flag moves toMagicStarterPageHeaderTheme, beside the container class that requires it. One place, stated once, and the two cannot drift apart.MSPageHeader.inlineActionsbecomesbool?and falls back toMagicStarter.pageHeaderTheme.inlineActions, so an explicit argument still beats the theme and every existing caller is unchanged.Verification
flutter analyzeclean, 1253 tests pass, of which 4 are new.The overflow is a test rather than a proxy for one. Reverting the title-row half turns two tests red, and the second names the defect itself:
(79 rather than 40 because the test uses three plain 44px icons and a slightly different title; the mechanism is the same.)
.claude/rules/widgets.mdrecords the coupling, so the next person reading the flag learns that setting one half alone is what breaks.