Skip to content

Release v4.29.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 06:06
153c851

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

  • NavigationRegionView in @cratis/scene.react, driven by effectiveNavigation(...) for the module of the screen on the page, so a module swap recomputes the items in place without remounting the nav. 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 navigate with navigationItemDestination(item) (module/feature identity, screen, slot as outlet). navigationDestinations(...) lists every destination so deep links resolve.
  • SceneNavigationHost takes navigationModel (structure, navigation, screenFor, isVisible) and a frame that wraps the primary outlet in chrome that stays mounted across navigation; SceneNavigationModelProvider does the same without a host.
  • Hooks for the layers around it: isVisible(item) hides items (never disables), items carry data-origin / data-read-only, and renderAdornment(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.default Topbar and Sidebar show the region as the shell menu (the layout-menu classes, with the active underline and pill of the specification) when a navigation model is in scope and the element has no menu / content slot of its own; regionNavigation: false opts 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