Skip to content

feat(rozier): add missing stories - #557

Merged
timothejoubert merged 2 commits into
developfrom
feature/539-missing-stories
Oct 30, 2026
Merged

timothejoubert merged 2 commits into
developfrom
feature/539-missing-stories

Conversation

@timothejoubert

Copy link
Copy Markdown
Contributor

Part of #539 — Phase 0 (#531), PR 3 of 3.

Summary

Adds the missing stories listed in #539, following lib/Rozier/docs/storybook.md. Each story has a renderer in app/utils/storybook/renderer/ that mirrors its Twig template. Requests the elements make are mocked with MSW, so the real custom elements run.

 Components/
   Actions/
+    BulkSection, BulkActions, SaveButton
   Form/
+    Geotag
   Overlay/
+    NodeTreeContextualMenu
   Navigation/
     HeaderNavItem       # ButtonCustomElement: is="rz-header-nav-item-button" (was a non-existent element)
 Patterns/
+  Aside, Page
 app/utils/storybook/renderer/
+├── rzActionsMenu.ts             # was hand-built in ActionsMenu, LivePreview and SaveButton stories
+├── rzAside.ts                   # reuses rzTree
+├── rzBulkActions.ts
+├── rzBulkSection.ts
+├── rzGeotag.ts
+├── rzNodeTreeContextualMenu.ts  # moved out of RzTree.stories.ts
+├── rzPage.ts
+├── rzSaveButton.ts
+└── rzTree.ts                    # moved out of RzTree.stories.ts
Story What runs
Patterns/Aside rz-aside renders its loading state, fetches the tree gateway (mocked), fades the tree in. Loading: the gateway never answers.
Actions/BulkSection Checking rows shows the bulk actions and fills the hidden input; submit prints the JSON. Select/deselect all.
Actions/BulkActions Tag and status buttons toggle their panel (data-tab-controls).
Actions/SaveButton The button moves into the actions menu and submits the form on click and on Cmd/Ctrl+S.
Form/Geotag Leaflet map, markers from the GeoJSON value, item list when multiple, click on the map places a marker.
Overlay/NodeTreeContextualMenu Default fetches contextualMenu.html.twig (mocked) on first opening, as in the backoffice. Prefilled is story-only.
Patterns/Page --scroll-top command scrolls rz-page to the top.

Simplifications, stated in the renderer comments: the Aside head has no language switcher and no "add child" variant; the contextual menu content has no node badges; Page drops the legacy overlay, loader and UIkit hooks.

Evidence

  • Before: index.json 51 titles / 199 stories; the seven elements had no story; HeaderNavItem ButtonCustomElement rendered is="rz-header-nav-button", which is never defined, so clicking did nothing.
    After: 58 titles / 212 stories. pnpm lint, pnpm build:check and pnpm build-storybook pass (node container). Each new story checked in Storybook in light and dark themes: interactions above confirmed in the DOM (e.g. BulkSection submit prints ["2","3"]; HeaderNavItem button toggles aria-expanded).
  • To check by hand, using the controls, in both themes:
    • Patterns/Aside (switch treeType), Patterns/Page
    • Actions/BulkSection, BulkActions, SaveButton, ActionsMenu (now a real rz-actions-menu with its drag handle)
    • Form/Geotag (Default, Multiple, Empty)
    • Overlay/NodeTreeContextualMenu, Navigation/Tree (With Contextual Menu)
    • Patterns/LivePreview (toggle still works)

Merge Danger

Door: two-way

Stories and story-only renderers; no runtime code, Twig or CSS changes.

Blast Radius: Storybook

Option keys follow the Twig meaning but not yet its spelling (deleteFormAction vs delete_form_action, treeType vs tree_type): the renaming is part of the v2.8 template move (ADR 0005). Some controls only change attributes (id on Page, label on SaveButton, defaultTranslationId on Aside, deleteFormInputName on BulkActions). The ActionsMenu story now uses the rz-actions-menu element, which saves its dragged position in localStorage (rz-actions-menu-position), as in the backoffice.

Timothe Joubert added 2 commits October 30, 2026 15:34
Part of #539, PR 3 of 3.

- Add stories and storybook renderers for rz-page, rz-bulk-section,
  rz-bulk-actions, rz-aside, rz-geotag, rz-node-tree-contextual-menu
  and rz-save-button; mock their requests with MSW.
- Move the tree and contextual menu renderers out of RzTree.stories.ts
  so the Aside pattern reuses them.
- Fix the HeaderNavItem button story: rz-header-nav-item-button.
- List the new titles in docs/storybook.md.
ActionsMenu, LivePreview and SaveButton stories each built rz-actions-menu by hand. They now use storybook/renderer/rzActionsMenu.ts, which mirrors macros/rz_actions_menu.html.twig (custom element, data-axis, drag handle).
@timothejoubert
timothejoubert merged commit dc20b01 into develop Oct 30, 2026
1 of 4 checks passed
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