Repository navigation
Release v4.29.0
The effective navigation of a region now renders as a shared React component: a topbar (flat) and a sidebar (hierarchical, collapsible) with active state, routing into the item's slot, a permission hook and keyboard support. Stage, the Studio preview and generated React use this one component.
Added
NavigationRegionViewin@cratis/scene.react, driven byeffectiveNavigation(...)for the module of the screen on the page, so a module swap recomputes the items in place without remounting thenav. A sidebar nests, collapses and expands the parents of the active item (expand='all'shows everything); a topbar is flat.- Active state follows the navigation host: an item is active (
aria-current,data-active) when the screen it opens is shown in the slot it renders into, so items rendering into different slots are active at once. - Render-into-slot: activating an item calls
navigatewithnavigationItemDestination(item)(module/feature identity, screen, slot asoutlet).navigationDestinations(...)lists every destination so deep links resolve. SceneNavigationHosttakesnavigationModel(structure, navigation,screenFor,isVisible) and aframethat wraps the primary outlet in chrome that stays mounted across navigation;SceneNavigationModelProviderdoes the same without a host.- Hooks for the layers around it:
isVisible(item)hides items (never disables), items carrydata-origin/data-read-only, andrenderAdornment(item)lets Studio draw the lock of an inherited item. No design chrome is rendered. - Keyboard: roving tab stop, arrows (left/right in a topbar, up/down in a sidebar), Home/End, and right/left to expand/collapse a sidebar parent.
blueprint.defaultTopbarandSidebarshow the region as the shell menu (thelayout-menuclasses, with the active underline and pill of the specification) when a navigation model is in scope and the element has nomenu/contentslot of its own;regionNavigation: falseopts out. A Storybook story shows the hierarchical sidebar and two slots.- Docs: "Rendering the regions" in
blueprints/navigation-regions.md.
core:navigationBar and the legacy Navigation contributions are unchanged.
Part of #103