Skip to content

Add ui profile package resolution engine - #9

Merged
einari merged 5 commits into
mainfrom
feature/package-resolution-engine
Aug 15, 2026
Merged

Add ui profile package resolution engine#9
einari merged 5 commits into
mainfrom
feature/package-resolution-engine

Conversation

@einari

@einari einari commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Added

  • PackageResolver.Resolve() (C#, Cratis.Scene.Engine) and resolveComponentName() (TypeScript, @cratis/scene.engine) - resolve a bare or package-qualified component name against a ui profile's package list. A bare name walks the package list from highest to lowest priority (core always the lowest-priority fallback); a package-qualified name (e.g. Internal.Widgets.TrendChart) resolves directly against its named package, bypassing priority order entirely. (ui profile package resolution engine #3)
  • Every resolution also reports which other active packages declared the same bare name but were shadowed by the winner, directly answering the issue's own open question ("why did my button render as PrimeReact's and not core's") without needing separate CLI tooling. (ui profile package resolution engine #3)
  • A shared JSON fixture corpus (package-resolution-fixtures.json) asserted independently by both the C# and TypeScript specs, so the two implementations of the algorithm cannot drift apart - the same pattern scene-model-shape.json already establishes for Scene.Model's shape.
  • New Cratis.Scene.Engine C# project, sibling to Scene.Model, mirroring the existing TypeScript model/engine package split - keeps Scene.Model's strict shape-parity manifest free of behavioral types.

Notes

Wiring this resolver into SceneElementView/ComponentRegistry's actual rendering path (resolving an entire element tree's component names before it renders) is left to Stage#39 and StudioIssues#160, which this issue explicitly lists as downstream consumers - not attempted here.

einari added 5 commits August 15, 2026 10:05
New Cratis.Scene.Engine C# project, sibling to Model - resolution and
other runtime/design-time engine logic belongs here rather than in
Model's assembly, whose shape is tracked by a strict parity manifest
(scene-model-shape.json) that has no room for behavioral types. Mirrors
the existing TypeScript model/engine package split.
PackageResolver.Resolve() implements #3: a bare name walks
a ui profile's package list from highest to lowest priority (core
always the lowest-priority fallback); a package-qualified name (last
dot splits package from name) resolves directly against its named
package, bypassing priority order and shadow tracking entirely. Every
active package that also declares a bare name's resolved value is kept
as Shadows rather than discarded, answering the issue's own "why did
this resolve to X and not Y" question directly in the result.
resolveComponentName() is the runtime twin of the C# PackageResolver,
run in the browser whenever a ui profile is applied - same algorithm,
same shadow-tracking result shape.
package-resolution-fixtures.json is asserted independently by both
Cratis.Scene.Engine.Specs (C#) and @cratis/scene.engine's own Vitest
suite, so the two implementations of the resolution algorithm cannot
drift apart - the same pattern scene-model-shape.json already
establishes for Model's shape. Caught a real bug before either spec
was trusted: the first PackageResolver draft appended "core" to the
END of the priority list, which made it the highest-priority match
(walked first) instead of the intended lowest-priority fallback.
@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 240eb7b into main Aug 15, 2026
5 of 6 checks passed
@einari
einari deleted the feature/package-resolution-engine branch August 15, 2026 08:07
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