Skip to content

fix(page-header): pin the inline title width and drop a class wind ignores - #97

Merged
anilcancakir merged 1 commit into
mainfrom
fix/page-header-inline-title-width
Aug 21, 2026
Merged

fix(page-header): pin the inline title width and drop a class wind ignores#97
anilcancakir merged 1 commit into
mainfrom
fix/page-header-inline-title-width

Conversation

@anilcancakir

Copy link
Copy Markdown
Contributor

What

  • Adds a regression test for the inline (inlineActions: true) layout: with a leading control, a long title and a titleSuffix, the actions column must stay icon-sized and the title row must span the header.
  • Removes -ml-1 from backControlClassName (the default, the useWindTheme derivation, and the docblock).

Why

Driving the header on an iPhone at 402pt showed the title collapsing to a couple of glyphs while roughly 140pt of the row sat blank after the status badge. The cause is in wind rather than here: a justify-between Row wrapped every child in Flexible, so the icon-sized actions column reserved an equal 185pt share it never painted, and the flex-1 title row had no leftover to take. Fixed in fluttersdk/wind#175; this pins the component-level behaviour so the regression cannot come back silently.

-ml-1 was inert. wind accepts a negative value only in the position family and logs unknown className '-ml-1' was ignored for a margin, so the class read like it was pulling the chevron toward the gutter while doing nothing.

Testing

  • New case in test/ui/components/page_header/page_header_test.dart, asserted on the two wrappers rather than on the text: a widget test lays text out in a placeholder font at roughly one em per glyph, so comparing a title width against a badge width measures the harness. Verified non-vacuous against unfixed wind (title row 185pt instead of 346pt).
  • Full suite green: 1256 tests.

Note

Needs fluttersdk/wind#175 to land first; the new test fails against a wind without it.

…nores

Two findings from driving the header on an iPhone.

The inline layout collapsed its title. With a leading control, a long title and
a titleSuffix, the title measured ZERO width at 402pt while 140pt of the row sat
blank after the status badge. The cause was in wind, not here: a
`justify-between` Row wrapped every child in `Flexible`, so the icon-sized
actions column reserved an equal 185pt share it never painted and the `flex-1`
title row had nothing left to take (fluttersdk/wind#175). This adds the
regression test at the component level, asserted on the two wrappers rather than
on the text: a widget test lays text out in a placeholder font roughly one em per
glyph, so comparing a title against a badge measures the harness.

`-ml-1` on the back control never did anything. wind supports a negative value
only in the position family, and it reports `unknown className '-ml-1' was
ignored` for a margin. Removed from the default, the derived theme, and the
docblock rather than left in as a class that reads like it is doing work.
@anilcancakir

Copy link
Copy Markdown
Contributor Author

@kodizm

@kodizm

kodizm Bot commented Aug 21, 2026

Copy link
Copy Markdown

Note

Kodizm (AI-generated). May contain mistakes; verify before acting.

The -ml-1 removal is correct and provably inert, but the new test fails on the dependency set this branch actually resolves, so merging as-is turns CI red.

Critical

test/ui/components/page_header/page_header_test.dart:175 — The new case fails against the wind version this repo resolves today (correctness/CI). Confirmed locally with fluttersdk_wind-1.3.0 from pub.dev: Expected: a value greater than <300> / Actual: <185.0>, plus a secondary RenderFlex overflowed by 20 pixels on the right thrown during layout. The PR body acknowledges the upstream fix has not landed; until it is published and resolvable, ci.yml (flutter test --coverage) fails on this branch.

Major

pubspec.yaml — Nothing in the manifest encodes the wind version the new test requires. fluttersdk_wind is not a direct dependency here; it arrives transitively through magic: ^0.0.6, so a fresh pub get is free to resolve a wind without the layout fix and the suite breaks with no signal that a dependency floor was the cause. Either add a direct fluttersdk_wind: ^<fixed> constraint or bump the magic floor to a release that carries it.

CHANGELOG.md:5[Unreleased] is empty, but this change alters a published default (MagicStarterPageHeaderTheme.backControlClassName, and the useWindTheme derivation). CLAUDE.md's Post-Change Checklist asks for a [Unreleased] entry before committing any source change. The value change is visually neutral, but an app that copied the old default string still carries the dead class and has no note telling it why.

Tests

The inline layout is now covered at 402pt by assertions on the actions column and the title row rather than on text width, which is the right thing to measure. The backControlClassName change has no test of its own; none is warranted, since the class it drops never reached a parser.

Checks I ran

  • flutter test test/ui/components/page_header/page_header_test.dart+22 -1; only the new case fails (output above). I did not run the full suite, so the "1256 green" claim is unverified here.
  • flutter analyze --no-fatal-infosNo issues found!
  • dart format --output=none --set-exit-if-changed lib test321 files (0 changed)
  • Verified the -ml-1 claim rather than taking it on trust: fluttersdk_wind-1.3.0/lib/src/parser/parsers/margin_parser.dart:165 gates on className.startsWith('ml-'), which a leading-hyphen class can never match, and negative prefixes are handled only in position_parser.dart:80. The class was dead; removing it changes no rendering.
  • grep -rn -- "-ml-1" lib doc README.md CHANGELOG.md → no remaining references, so no stale docs left behind.

@anilcancakir

Copy link
Copy Markdown
Contributor Author

@kodizm review

1 similar comment
@anilcancakir

Copy link
Copy Markdown
Contributor Author

@kodizm review

@kodizm

kodizm Bot commented Aug 21, 2026

Copy link
Copy Markdown

Note

Kodizm (AI-generated). May contain mistakes; verify before acting.

What changed since my last review: no new commits - the upstream dependency landed instead, which clears the Critical. fluttersdk_wind 1.4.0 is on pub.dev, resolves here through magic 0.0.6, and the full suite is green.

The -ml-1 removal and the new regression test are both correct on the dependency set this branch resolves today. My two earlier notes stand unchanged and unaddressed: the missing [Unreleased] CHANGELOG entry, and the absence of any declared wind floor. On the floor, the practical risk is now lower than I put it: pubspec.lock is untracked, so CI resolves the latest wind and gets 1.4.0. But magic 0.0.6 asks for fluttersdk_wind: ^1.2.0, so 1.2.x and 1.3.0 still satisfy the graph - anything that pins wind below 1.4.0 (a host app's lockfile, a pub downgrade, a future dep that caps wind) fails this test with no signal that a dependency floor was the cause.

Tests

The new inline case is non-vacuous and its selectors are sound: containerInlineClassName carries no flex-1, so the contains('flex-1') predicate picks the title row at page_header.dart:141, and the more_horiz icon's first WDiv ancestor is the actions container. The backControlClassName change needs no test - the class it drops never reached a parser.

Checks I ran

  • flutter pub get → resolves fluttersdk_wind 1.4.0 (transitive, via magic 0.0.6^1.2.0)
  • flutter test test/ui/components/page_header/page_header_test.dart → 24 passed, including the new inline case (previously failed at <185.0>)
  • flutter testAll tests passed!, 1254 tests
  • flutter analyze --no-fatal-infosNo issues found!
  • Grep '-ml-1' across the repo → no matches, so the docblock, the default and the useWindTheme derivation are the only places it lived

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@anilcancakir
anilcancakir merged commit e55e640 into main Aug 21, 2026
2 of 3 checks passed
@anilcancakir
anilcancakir deleted the fix/page-header-inline-title-width branch August 21, 2026 21:38
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