Skip to content

fix(fortal): keep the date picker trigger to its content width - #681

Open
chrishiguto wants to merge 5 commits into
fortal-refresh/wb-fix-2-clear-fillsfrom
fortal-refresh/wb-fix-3-date-picker
Open

chrishiguto wants to merge 5 commits into
fortal-refresh/wb-fix-2-clear-fillsfrom
fortal-refresh/wb-fix-3-date-picker

Conversation

@chrishiguto

Copy link
Copy Markdown
Contributor

Why

The Fortal date picker trigger took the full width of loose constraints: centred in a 1000px story it stretched edge to edge, and the panel opened at the far left under it. The value text sat in a SizedBox(width: double.infinity) so the chevron could reach the end of the 200px minimum.

Scope

  • FortalDatePicker wraps its picker in IntrinsicWidth. Under loose constraints the trigger is its content width, at least 200px, with the chevron at its end; under a tight width it still fills it.
  • Tests: 200px for a short value under loose constraints, wider for a long value but not the full width, a tight width still stretching, and the chevron at the trigger's end.
  • The calendars polish board golden is refreshed: the triggers there are now 200px wide.

Tradeoffs

  • The date range picker trigger keeps its own rule (its text width, no floor).
  • Frames drop while the panel opens (50 to 67ms on CanvasKit with semantics on). Profiling shows the whole calendar, about 1,400 elements, rebuilding in each of the first three frames as focus enters it, then semantics and raster cost. That is in the Remix calendar and Naked focus code and is not changed here; it is logged.

Blast Radius

  • Every FortalDatePicker placed under loose constraints becomes narrower (from the available width to its content, at least 200px). Pickers in a stretched column or a sized box keep their width.
  • Registry template and mirrors for date_picker.

Verification

  • Mutation: without IntrinsicWidth two of the four new tests fail.
  • cd registry_source && flutter test; cd apps/demo && flutter test with the refreshed golden.

This branch has not been deployed

No deployments
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