Skip to content

Add theme/package compatibility engine - #12

Merged
einari merged 2 commits into
mainfrom
feature/theme-compatibility-engine
Aug 15, 2026
Merged

Add theme/package compatibility engine#12
einari merged 2 commits into
mainfrom
feature/theme-compatibility-engine

Conversation

@einari

@einari einari commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Added

  • ThemeCompatibility.IncompatiblePackages()/incompatiblePackages() and IsCompatible()/isThemeCompatible() - reuse the exact rule Screenplay's compiler already applies (ValidateThemes): every package a ui profile declares must be in the theme's compatibleWith list, with no implicit exemption for core. Sharing this rule here means Stage's build-time warning and Studio's design-time theme-picker filtering don't each reimplement it. (Theme engine: applying and validating theme/package compatibility #5)
  • ThemeCompatibility.ApplicablePackages()/applicableThemePackages() - the renderer-facing half: the packages a profile activates that a theme also declares compatible, which Scene.React scopes token application to (rather than applying a theme's tokens globally). Computing it fresh from the current theme/profile pair, rather than caching a resolved result, is what makes theme switching a live re-resolution with no reload. (Theme engine: applying and validating theme/package compatibility #5)
  • A shared JSON fixture corpus (theme-compatibility-fixtures.json) asserted independently by both the C# and TypeScript specs, following the pattern established in ui profile package resolution engine #3/Layout engine: flow and freeform arrangement rendering #4.

Notes

The theme token model's own shape (colors, spacing, typography) is explicitly out of scope for this issue, confirmed by its own text - this PR only builds the compatibility check and the package-scoping helper a future token-application layer in Scene.React will consume; it does not attempt to design or apply actual tokens.

einari added 2 commits August 15, 2026 10:30
IncompatiblePackages/incompatiblePackages and IsCompatible/
isThemeCompatible reuse the exact rule Screenplay's compiler already
applies (ValidateThemes): every package a profile declares must be in
the theme's compatibleWith list, no implicit exemption for core.
Sharing this rule here means Stage's build-time warning and Studio's
design-time theme-picker filtering (#5) don't each
reimplement it.

ApplicablePackages/applicableThemePackages is the renderer-facing
half: the packages a profile activates that the theme also declares
compatible, which Scene.React scopes token application to rather than
applying a theme's tokens globally. Computing it fresh from the
current theme/profile pair, rather than caching a resolved result, is
what makes theme switching a live re-resolution with no reload.
theme-compatibility-fixtures.json is asserted independently by both
Cratis.Scene.Engine.Specs (C#) and @cratis/scene.engine's own Vitest
suite - the same pattern used for the package resolver in #3 and the
layout evaluator in #4. Explicitly covers the "core has no implicit
exemption" case, mirroring Screenplay's own theme compatibility specs.
@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 75303b4 into main Aug 15, 2026
5 of 6 checks passed
@einari
einari deleted the feature/theme-compatibility-engine branch August 15, 2026 08:32
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