Skip to content

Add contribution aggregation and the NavBar widget - #11

Merged
einari merged 2 commits into
mainfrom
feature/contribution-aggregation-and-navbar
Aug 15, 2026
Merged

Add contribution aggregation and the NavBar widget#11
einari merged 2 commits into
mainfrom
feature/contribution-aggregation-and-navbar

Conversation

@einari

@einari einari commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Added

  • aggregateContributions() (@cratis/scene.engine) - collects every contribution targeting a given contribution point, ordered ascending by its explicit order (unordered contributions sort after every ordered one, in their original relative order). Resolving which contribution point a contribute to targets already happens before a Contribution exists in Scene.Model (see its own doc comment), so there was no ambiguity left for the engine to resolve here, only ordering - this is narrower than the issue's original proposal, which assumed the engine would still walk a nearest-enclosing resolution; that already happened upstream. (Contribution point resolution at runtime, and the NavBar widget #2)
  • NavBar widget (@cratis/scene.react) - renders the aggregated Navigation contributions. How navigate to <Screen> becomes a concrete route is a caller-supplied renderRoute callback rather than a fixed URL scheme, so the same widget works unmodified across renderers, per the issue's own "configurable per renderer" requirement. (Contribution point resolution at runtime, and the NavBar widget #2)
  • extractNavigationItem() - reads a NavigationItem out of a Navigation contribution's ExternalComponent.properties bag.

Notes

extractNavigationItem's property-bag key contract (label, targetScreen, routeParameterBindings, order, group - the same names as NavigationItem's own fields) is a Scene#2 design choice made without a real Screenplay-to-Scene translation to confirm it against - Stage#37 (the Screenplay → Scene seam) hasn't been built yet. Documented as an assumption in the function's own doc comment; Stage#37 should either match this contract or this function should move to match whatever it actually emits.

einari added 2 commits August 15, 2026 10:23
aggregateContributions() collects every Contribution targeting a
given contribution point, ordered ascending by its explicit order
with unordered contributions sorting after every ordered one. This is
the runtime half of #2 - resolving *which* contribution
point a "contribute to" targets already happens before a Contribution
exists in Scene.Model (see its own doc comment), so there is no
ambiguity left for the engine to resolve, only ordering.
NavBar renders the aggregated Navigation contributions from across
the current element tree. How navigate to <Screen> becomes a concrete
route is a caller-supplied renderRoute callback rather than a fixed
URL scheme, so the same widget works unmodified across renderers -
per #2's own "configurable per renderer" requirement.

extractNavigationItem() reads a NavigationItem out of a contribution's
ExternalComponent.properties bag, using the same property names as
NavigationItem's own fields. This property-bag contract is a Scene#2
design choice made without a real Screenplay-to-Scene translation to
confirm it against (Stage#37 hasn't been built yet) - documented as
such in the function's own doc comment.
@einari einari added screen Screen/UI work: Screenplay UI constructs, Scene runtime, Stage rendering, Studio designers minor labels Aug 15, 2026
@einari
einari merged commit edb1f48 into main Aug 15, 2026
2 of 4 checks passed
@einari
einari deleted the feature/contribution-aggregation-and-navbar branch August 15, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor screen Screen/UI work: Screenplay UI constructs, Scene runtime, Stage rendering, Studio designers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant