Skip to content

feat(demo): make every widgetbook story usable and add the missing families - #682

Open
chrishiguto wants to merge 14 commits into
fortal-refresh/wb-fix-3-date-pickerfrom
fortal-refresh/wb-fix-4-widgetbook
Open

chrishiguto wants to merge 14 commits into
fortal-refresh/wb-fix-3-date-pickerfrom
fortal-refresh/wb-fix-4-widgetbook

Conversation

@chrishiguto

Copy link
Copy Markdown
Contributor

Why

A browser pass over the Fortal widgetbook found stories that could not be used to review their family: the combobox dropped keystrokes with semantics on, the segmented control and data table were catalogs that ignored clicks, twenty installed families had no story at all, and a few stories drew the wrong thing.

Scope

  • Story host: storyHost gives each story its own Overlay inside the page route (Overlay.wrap). Under the router's page-based Navigator, any overlay that opened made Flutter wrap the page route in a new semantics node, and on the web the move took DOM focus from a focused text field: the combobox story typed one character. Flutter's own Autocomplete does the same under a page-based Navigator. Inside the route, the overlay's node joins the route's own and nothing moves. The routes test uses the same host.
  • New interactive stories: action button, bottom sheet, button group, chart, color picker, context menu, copy button, pagination, password field, resizable panels, split button, tag input, tree view, drawer, empty state, file dropzone, hover card, scroll area, stepper and time picker; catalogs for button group, copy button and split button.
  • Segmented control and data table get interactive stories (selection, sortable columns) next to their catalogs.
  • The menu story no longer adds a second chevron; the Bold toggle shows a bold icon; the avatar story loads no remote photo by default (the web build cannot load one without CORS and logged two errors per load).
  • helpers/story_navigator.dart: the bottom sheet and drawer stories open from a navigator under the theme, since the root navigator sits above the theme addon.
  • Tests: the combobox story keeps the editor's semantics ancestry while it types san and opens its list; the wiring fixes each have a test. The actions polish board golden is refreshed for the bold icon.

Tradeoffs

  • The story host changes where every story's overlays render: in the story's own overlay instead of the router's. Dialogs still use the navigator.
  • Widgetbook rebuilds a story when a knob changes, so in-story state resets then.

Blast Radius

  • apps/demo only: stories, helpers, main.dart, tests, generated directories and one golden. No package or registry change.

Verification

  • On the release web build with semantics on, the combobox story now types san and lists six cities (before: s, no list).
  • Mutations: without the story host the ancestry test fails (a new node appears above the editor); the old menu, toggle and avatar stories fail their tests.
  • cd apps/demo && flutter test and flutter analyze (no new issues).

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