Skip to content

Complete the Scene-based editor with package designers and design-time actions #156

Closed

Description

@einari

Screens release scope

The old #156 introduction is now stale: upstream ScreenTemplateEditor.tsx imports ScreenEditorWorkspace and Source/Editor/ScreenEditor has Scene edits, inspectors, query bindings and exposure. #394/#395/#396/#397 shipped. Preserve the existing migration/cleanup checklist below where still applicable; do not reimplement the editor or reopen completed work.

Acceptance criteria

  • Host package-provided component/internal designers, custom property editors/display and contextual design actions through the Scene extension contract.
  • Honor owner-defined visible/enabled state and inherited exposure; action/edit batches participate in validation, save, undo/redo and accessible keyboard interaction.
  • Keep preview on the real Scene renderer and permit a package to customize its own component without Studio maintaining another property schema.
  • Audit remaining legacy-editor consumers and the six original designer checklist items against current code, retire only unused paths, and record implemented versus remaining items.
  • Prove extension loading and fallback both inside Studio and via the embeddable editor.

References and dependencies

Part of Cratis/Scene#7.

Blocked by

Blocks


Previous scope and historical context

The release scope above updates this issue without deleting its prior context. Completed foundations and superseded product questions are not new blockers. Existing non-screen requirements remain in scope.

Studio has two screen editors, and the good one is read-only.

Source/Editor/ Source/Scene/Prototypes/Editor/
Renders through @cratis/scene.react, unmodified — what Stage actually ships its own UIElement/Panel/ContentControl hierarchy, a parallel copy of Scene
Can you edit in it? No Yes
Used by the routed Blueprint page EventModelingEditor, ScreenTemplateEditor

So today you either get a trustworthy preview you cannot touch, or an editor that is quietly drifting from what production renders.

The architecture question this issue originally asked is answered and shipped: chrome and preview are split, and design-mode affordances (selection, hover) are drawn by the chrome using the data-scene-id attribute the renderer already emits. Scene.React needs no design-mode flag.

What's actually left

Port the editing half onto Scene.Model, then delete the legacy editor.

  • Migrate ScreenTemplateEditor — the smaller consumer — onto PreviewSurface + chrome
  • Port drag/drop, resize and multi-select onto Scene.Model mutations (the bulk of the work)
  • Migrate EventModelingEditor
  • Make the six designers editable, not just readable:
    • Form — rename affordance, populate-source picker, compose using handoff to the code editor
    • Navigation — drag-to-reorder, jump-to-declaration
    • Strings — "extract to resource" actually writing the .strings entry and rewriting the .play reference
    • UI profile — drag-reorderable package list, component picker with package qualification
    • Layout — the live flow-reflow canvas, freeform placement editing
    • New project — the scaffold/confirm step
  • Bind command properties from input widgets ({property} expressions), with the binding visible in the preview
  • Delete Source/Scene/Prototypes/Editor/ and its .NET/TS model mirror

Not blocked

Every upstream dependency shipped: Cratis/Scene #1–#6 and Cratis/Screenplay #91–#96 are all closed, and @cratis/scene.* 3.x is a real published dependency.

Related

Consolidates #10, #80, #157, #158, #159, #160, #161, #162 — detail in the comment below.

Status

State: Done — Closed by einari; follow-up StudioIssues#630. Registry reconciled by L0 sweep.
Branch: -
Scope: As described above.
Delivered: Nothing yet.
Remaining: To be confirmed.
Follow-ups: None.

Activity

  1. cratis-direct commented on Aug 27, 2026

    @cratis-direct
    Contributor

    Thanks for opening this - it has been received and will be looked at.


    Posted by Stagehand (AI) - an autonomous agent, not a person. Review accordingly.

  2. cratis-direct commented on Aug 27, 2026

    @cratis-direct
    Contributor

    Thanks for opening this - it has been received and will be looked at.


    Posted by Stagehand (AI) - an autonomous agent, not a person. Review accordingly.

  3. self-assigned this
    on Sep 6, 2026
  4. woksin commented on Sep 6, 2026

    @woksin
    Contributor

    Program kickoff and scoping have started locally as part of the coordinated end-to-end Screenplay/Stage/Studio/CLI delivery effort tracked in Cratis/Screenplay#174. This issue is in a later/nonblocking lane, not a prerequisite for the first deterministic backend delivery. @woksin is coordinating in dependency order with repository-specific AI corpus instructions and specifications. Existing work/PRs will be reconciled rather than duplicated. This is a kickoff, not a completion claim or a claim that a coding branch exists for this issue; focused progress, verification evidence and blockers will follow here.

  5. added
    taskConcrete engineering work, no new product behaviour
    and removed on Sep 24, 2026
  6. changed the title [-]Studio editor architecture: chrome vs. preview surface[/-] [+]Screen editor: make the Scene designers editable and retire the legacy wireframe editor[/+] on Sep 24, 2026
  7. added
    area: screenScreen/UI modelling: Scene, Stage rendering, Studio designers
    on Sep 24, 2026
  8. einari commented on Sep 24, 2026

    @einari
    ContributorAuthor

    What the eight consolidated issues asked for, and where each one stands

    Verified against Cratis/Studio@main (Source/Editor/, Source/Editor/README.md) on 2026-09-24.

    Was Asked for Landed Left
    #156 Split editor into preview surface (real Scene renderer) + editing chrome PreviewSurface.tsx, SelectionOverlay.tsx; design-mode question resolved in favour of chrome-side injection via data-scene-id migrating the two real consumers off PrototypeEditor
    #157 Form designer classifyFormFields (AutoMapped/Renamed/Composed/Broken, so a renamed command property shows broken in the designer instead of only at build), summarizePopulateSource, FormDesigner.tsx where commandProperties comes from; rename affordance; populate-source picker interaction; compose using handoff; live preview
    #158 Navigation / contribution designer aggregateNavigationItemsWithSource (runs the identical aggregation NavBar uses, but keeps the item↔contribution pairing), groupNavigationItems live AppShell preview; jump-to-declaration (needs source locations Scene's model does not carry — see Cratis/Stage#37); nearest-enclosing resolution indicator; drag-to-reorder
    #159 String resource management proposeResourceKey, computeMissingTranslations, per-locale table parsing/writing .strings (needs a backend endpoint over Screenplay's own StringsFile); the extract action's file mutation; hooking it to a selected literal
    #160 ui profile + theme configuration findComponentCollisions (reuses resolveComponentName), filterCompatibleThemes (reuses isThemeCompatible), routed Blueprint page composing all four package bundles one product decision first: who owns the stored profile — Studio persisting edits back into the repo's .play, or Studio holding it in its own model. That decides the State Change/State View slice shapes. Then: drag-reorder, platform/size-class inputs, component picker
    #161 Layout designer findMissingVariants (reuses evaluateFreeformArrangement) the flow live-reflow canvas; freeform artboard content; drag-to-place. Slot-level flow/freeform switching stays out until Cratis/Screenplay#95's mixed-arrangement question is settled
    #162 New-project wizard selectableStarterThemes, starter picker, sandboxed profile via buildStarterProfile, filtered theme switcher, gallery list the scaffold/confirm step (waiting on Cratis/Scene#6's gallery-retention decision); live gallery navigation; re-opening gallery mode from an existing project
    #80 Configure the UI profile — target platform, UI framework, component library superseded by #160's design, whose read-only half shipped same as #160
    #10 Bind widgets to command properties, {property} style, visible in the preview nothing all of it — depends on the editing chrome existing

    Two known Scene-side limits surfaced by the Blueprint page

    1. A Scene theme does not restyle PrimeReact 10 widgets. PrimeReact's compiled themes carry literal colours and no var(--surface-card), so only CSS reading Scene's variables follows. Against a dark PrimeReact host you get a light shell with dark cards. The package's own answer swaps the stylesheet globally, which an embedded preview cannot do.
    2. dataTable resolves away from PrimeReact in a full profile — Cratis.Components outranks PrimeReact for that name and its implementation is Arc-bound, so the gallery shows Missing query binding. That is the designed indicator, not a failure.

    Migration order recommended by the spike

    1. ScreenTemplateEditor first — standalone, smaller.
    2. Port drag/drop + resize from Source/Scene/Prototypes/Editor/WireframeElement/ onto Scene.Model mutations.
    3. EventModelingEditor once the new path has parity.
    4. Delete the legacy editor and the model mirror.
  9. einari commented on Oct 2, 2026

    @einari
    ContributorAuthor

    #394 (PR Cratis/Studio#1501) takes the necessary part of this, by decision.

    Delivered in that PR

    • Migrated ScreenTemplateEditor onto the Scene model: it opens a Scene document and edits it in the same window, surface, palette and inspector as the floating editor.
    • Migrated EventModelingEditor's floating editor onto the Scene model. The screen is drawn by @cratis/scene.react through the same name resolution Play uses, and edited only through Scene's applyEdit with inspection through inspect.
    • Ported placement, nesting, reorder and reparent onto Scene edits (InsertNodeEdit, MoveNodeEdit, RemoveNodeEdit, SetProperty), with drop regions computed from the model so empty containers and insertion markers need no renderer flag.
    • Persistence of a screen as a Scene document, with a deterministic, tested conversion of existing prototypes on open that keeps what Scene cannot represent.
    • Undo and redo over Scene edits.
    • Template ownership taken from Scene's own inspection, exposed configuration, and a template author's expose and unexpose.

    Left here

    • Deleting Source/Scene/Prototypes/Editor and the UIElement hierarchy. Other readers still use it: the board thumbnails, the Viewer and Components/TemplateEditor read the prototype element shape, and the editor still saves that projection beside every document.
    • Moving an existing component by dragging it on the surface (the Structure tree and the keyboard do this today); resize and multi-select on the surface.
    • The six designers (Form, Navigation, Strings, UI profile, Layout, New project).
    • Binding command properties from input widgets.
  10. changed the title [-]Screen editor: make the Scene designers editable and retire the legacy wireframe editor[/-] [+]Complete the Scene-based editor with package designers and design-time actions[/+] on Oct 8, 2026
  11. added
    releaseRequired for the Studio release
    screensScreens release delivery
    on Oct 8, 2026
  12. self-assigned this
    on Oct 8, 2026
  13. einari commented on Oct 8, 2026

    @einari
    ContributorAuthor

    Implementation plan

    Screens release: Cratis/Scene#7.

    Prerequisites: Cratis/Scene#70, Cratis/Scene#75.

    1. Audit current ScreenEditorWorkspace and migrated ScreenTemplateEditor/EventModelingEditor consumers against the historical Complete the Scene-based editor with package designers and design-time actions #156 checklist; distinguish shipped work from remaining legacy paths.

    2. Add package extension discovery and host rendering for whole-component/internal/property editors and action menus, using Scene descriptors and optional design bundles.

    3. Route all edits/actions through existing controller validation, exposure and undo/redo. Keep design chrome outside unmodified Scene rendering.

    4. Test a third-party plugin in Studio and the embeddable editor, then remove only legacy paths proven unused or fully migrated.

    Completion evidence: link implementation PRs and the tests/results for every checkbox under ## Acceptance criteria; keep release dependency links current. This is a proposed implementation plan, not a claim that the work or tests have already run.

  14. woksin commented on Oct 9, 2026

    @woksin
    Contributor

    Recommendations for when you get to this

    You own this one, and you have already started it, so this is not a takeover. These are our answers to the open points, in case they save you time. Ignore anything that does not fit what you are building.

    Stored UI profile

    Scope

    Deleting the legacy editor

    Trusted bundles

    • Load a package's design bundle only when the package is in both the effective ui profile and scene-package-catalog.json, and only in the editor, never at runtime.
    • An unknown extension gives a diagnostic and falls back to the generic editors.

    Action results

    • A design action returns canonical Scene edits that go through applyEdit. They then take the normal path to .play, which decision 0012 already settles. Validation, exposure and undo/redo then come for free.

    Shout if you disagree, einari.

  15. einari commented on Oct 12, 2026

    @einari
    ContributorAuthor

    Final conformance refresh (2026-10-12). Public vector: CLI 3.53.1 (latest) + cratis/stage:4.73.1 + Screenplay 4.137.0 + corpus Cratis.Screenplay.CanonicalCorpus 4.139.0, via run-public-acceptance.sh: live-Stage browser PASSED 76 assertions / 0 blockers (60 + 16 history/guarded assertions added by Screenplay#671, merged), render-audit PASSED (62 artifacts byte-identical and portable, CLI-RENDER-007/008 refusals exit 5, stale managed artifact refused, 45 declarations recovered), MCP transcript PASSED (38 tools, stale apply refused, apply, reopen). Generated React on the same CLI/Stage pair: 70 passed / 0 blockers. Local Studio (Playwright screen-editor-dom): 18/18. Production Studio 0.157.7 scratch vector: save PASS, export PASS (lossy), import PASS (lossy, STUDIO0026), Play chrome PASS, Play content blocked (no Stage pod schedulable: cluster CPU).

    Not closing. Status on Studio 0.157.7 (production is on this version): package designers/actions load and fail safely in Studio and the embedded editor (#1637, #1642; Playwright extensions.spec.ts 2/2), per-component CommandForm and Form editors (#1685), no raw-JSON property editors: structured recursive Object/Collection editors with an undescribed-property diagnostic (#1686, Scene 4.19), template preview and input-widget command feeding (#1660). Local Playwright vector 18/18.

    Remaining gaps: the migration/deletion checklist is unfinished: drag/drop, resize and multi-select on Scene.Model mutations (ScreenTemplateEditor and EventModelingEditor migration), 'make the six designers editable', and deleting Source/Scene/Prototypes/Editor/; Scene PrimeReact descriptors still declare chart options/style, selection, icons and tree columns as plain Json (Studio now shows a 'Properties without an editor' diagnostic for them instead of a text box); the extension-loading proof ran against the local Studio only, not production.

  16. einari commented on Oct 12, 2026

    @einari
    ContributorAuthor

    Gap run (2026-10-12). Scene PrimeReact descriptors now describe every structured property (chart options/style/data, treeTable columns/nodes/selection, dataScroller items, multiStateCheckbox options/icons/value) - Scene#91, 4.22.0 - and Studio#1718 edits them with no JSON text; Playwright structured-properties 3/3 asserts no 'Properties without an editor'. Not closing.

  17. einari commented on Oct 13, 2026

    @einari
    ContributorAuthor

    Closing; the unfinished editor migration is tracked in the new follow-up Cratis/StudioIssues#630.

    Proven: package designers/internal designers, custom property editors and contextual design actions hosted through the Scene extension contract with safe fallback (Studio #1637, #1642; Playwright extensions.spec.ts 2/2 in Studio and the embedded editor); owner-defined visible/enabled state and inherited exposure, action/edit batches in validation/save/undo-redo and keyboard interaction; preview on the real Scene renderer; no JSON-text property editors - recursive Object/Collection editors and package-registered editors (#1686, Scene #91 describing every PrimeReact structured property, #1718, structured-properties.spec.ts 3/3); per-component CommandForm/Form editors (#1685); a package can customize its own component without Studio maintaining another schema.

    Not done (#630): the legacy-editor audit/record, ScreenTemplateEditor/EventModelingEditor migration, making the six designers editable, deleting Source/Scene/Prototypes/Editor/, and the extension-loading proof against the deployed Studio.

    Final public acceptance (2026-10-13), run-public-acceptance.sh against the newest public releases: CLI 3.59.0 (Homebrew cratis 3.59.0) + cratis/stage:4.92.0 (the CLI default; Stage 4.93.0 is published too) + Screenplay 4.153.0 with Cratis.Screenplay.CanonicalCorpus 4.153.0 (read from the NuGet package) + Scene 4.22.1 (npm + NuGet) + AI 7.46.0 + production Studio 0.170.1 (core 2/2 ready):

    • live-Stage browser: passed, 81 assertions, 0 blockers; render-audit: passed (62 artifacts byte-identical across two renders and portable, CLI-RENDER-007/008 refusals); MCP stdio transcript: passed (41 tools, stale apply refused, apply, reopen); production Studio scratch vector: passed, 14 steps (corpus ZIP imported with 0 compiler notes, board drew, a layout authored/saved/survived reload, Screenplay file + folder export, Play rendered the application on a Stage pod with no unresolved component, Stop restored the chrome, scratch project deleted).
    • Studio export vs the published corpus: 0 of 290 corpus lines absent.
    • Evidence (kept with the screens-release worktree): agents/wave2/closer2-evidence/public-acceptance-cli-3.59.0/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: screenScreen/UI modelling: Scene, Stage rendering, Studio designersreleaseRequired for the Studio releasescreensScreens release deliverytaskConcrete engineering work, no new product behaviour

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions