feat(showcase): vertical_menu joins the registry - #693
Conversation
…dout The maintainer caught the drift: petal.build/components/menus still served the pre-registry hand-authored demos while the playground's menu page carried the Northwind shell flagship as page-local dev.exs code no other surface could reach. The flagship (vertical_menu composed inside sidebar_nav - workspace switcher in the header, user menu in the footer, the shell's collapse and mobile sheet around it) and a standalone grouped-menu example now live in Showcase.VerticalMenu; the playground page renders from the registry (the orphaned page-local nav helper removed); the registry guard test now covers it, and marketing + MCP inherit the same demos at the next sync.
Greptile SummaryThis PR moves the vertical-menu demonstrations from page-local playground markup into the shared showcase registry.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking instance-isolation issue in the reusable flagship example. The registry migration and render contracts are otherwise consistent, but mounting the flagship example twice produces duplicate sidebar target IDs and cross-controls both instances. Files Needing Attention: lib/petal_components/showcase/vertical_menu.ex
|
| Filename | Overview |
|---|---|
| lib/petal_components/showcase/vertical_menu.ex | Adds two self-contained vertical-menu examples; the flagship's fixed sidebar target ID can collide when the reusable example is mounted twice. |
| dev.exs | Replaces the page-local menu demonstration with iteration over the new registry examples. |
| lib/petal_components/showcase/registry.ex | Adds the vertical-menu showcase to the explicit registry. |
| CHANGELOG.md | Documents the vertical-menu registry migration. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
V[Showcase.VerticalMenu] --> R[Showcase Registry]
R --> P[Playground menu page]
R --> B[petal.build sync]
R --> M[MCP showcase data]
V --> F[Flagship sidebar example]
V --> S[Standalone menu example]
Reviews (1): Last reviewed commit: "feat(showcase): vertical_menu joins the ..." | Re-trigger Greptile
| <.sidebar_shell | ||
| for="showcase-menu-sidebar" | ||
| class="h-[34rem] min-h-0 w-full overflow-hidden border border-gray-200 rounded-xl dark:border-gray-800" | ||
| > | ||
| <:sidebar> | ||
| <.sidebar_nav id="showcase-menu-sidebar" label="Platform" collapsible="offcanvas"> |
There was a problem hiding this comment.
Rendering the flagship example more than once emits duplicate showcase-menu-sidebar, -main, and -trigger IDs. Because the sidebar commands select these IDs document-wide, activating one mobile trigger updates both instances and leaves focus restoration and aria-controls relationships ambiguous.
Knowledge Base Used: Overlays, menus, and commands
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #693 +/- ##
==========================================
+ Coverage 95.40% 95.41% +0.01%
==========================================
Files 162 163 +1
Lines 8045 8078 +33
==========================================
+ Hits 7675 7708 +33
Misses 370 370 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
One item: vertical_menu joins the showcase registry (#693), so petal.build's menus page and the MCP can serve the same demos the playground does.
Nic caught the reconciliation gap: petal.build/components/menus serves ancient hand-authored demos while the playground's menu page carries the wave-era Northwind shell flagship as page-local
dev.exscode no other surface can reach -vertical_menuis the one component the registry migration never picked up (it predates the registry).Now:
Showcase.VerticalMenuwith two examples - the flagship (vertical_menu composed inside sidebar_nav: workspace switcher in the header slot,user_dropdown_menu variant="sidebar"in the footer, the shell's collapse + mobile sheet around it, with the taxonomy note as its description) and a standalone grouped menu (the component's whole API: maps in, current_page marks the reader's place). The playground page renders from the registry (orphaned page-local helper deleted), the registry guard test covers the module, and petal.build + the MCP inherit the same demos at the next release sync.Self-contained per the registry contract (nav data in a private helper). Suites 1813/0 mix, JS green.
🤖 Generated with Claude Code