Skip to content

Give playgrounds one working state across inline and shared controls - #3000

Merged
max-sixty merged 6 commits into
mainfrom
codex/playground-working-store
Oct 15, 2026
Merged

max-sixty merged 6 commits into
mainfrom
codex/playground-working-store

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Playground editors previously kept private configuration models alongside the playground's aggregate. An unrelated control change could restore an older value over an unfinished edit. Give the playground one immutable working configuration: structured contributors replace named slices through get()/set(), and synchronous subscribers draw through its existing LeafElement lifecycle. Reset and canonical choice changes restore complete configurations; acknowledgement of the same choice preserves later drafts.

Cut every maintained consumer over together, including the undo simulator, and update the package's authoring contract. Keep native editor nodes during filter reordering. Preserve inline/shared composition, remove the empty rail for all-inline previews, and allow long button labels to wrap. The early drawing pass stays; clipboard permissions remain deferred.

Validation covers the runtime suite and focused browser journeys for native editing, late registration, reconnect, acknowledgement, refusal, Reset/Undo, required-view failure, early drawing, constrained layouts, and prepared install/export. Independent code review found no actionable issues; independent screen review covered desktop light/dark and phone. Existing journeys carry the state contrasts, with one added required-view failure case. No broader authoring-efficiency improvement is claimed.

This was written by Codex on behalf of max-sixty

# Conflicts:
#	examples/corpus.html
#	examples/data-explorer.html
#	skills/leaf/assets/registry.json
#	skills/leaf/assets/styles/components/controls.css
#	skills/leaf/packages/playground/initial.js
#	skills/leaf/packages/playground/instructions/author.md
#	skills/leaf/packages/playground/registry.json
#	skills/leaf/packages/playground/theme.css
#	skills/leaf/packages/playground/vendor/lf-playground-initial.js
#	skills/leaf/packages/playground/widgets/lf-playground.js
#	skills/leaf/references/page-authoring.md
#	tests/model/test_interact_product.py
#	tests/runtime/initial-render.test.mjs
Replace contributor read/apply/notifier models with immutable slice handles and synchronous retained views. Cut every maintained consumer over together, keep the initial drawing pass, and preserve canonical choice identity and native editor state.

Adapt existing state and example journeys instead of adding an API test matrix. Add one required-view failure contrast, exercise a genuine reconnect and native undo across reordering, remove redundant event-count probes, and repair the prepared-install helper to re-export the current widget API.
leaf-agent
leaf-agent previously approved these changes Oct 15, 2026
@max-sixty
max-sixty merged commit 7a8fa61 into main Oct 15, 2026
3 checks passed
@max-sixty
max-sixty deleted the codex/playground-working-store branch October 15, 2026 08:20
leaf-agent added a commit that referenced this pull request Oct 15, 2026
#3000 intentionally holds projected values until contributors register.
The old browser case seeded an admitted `choose` action with an extra
value in a page using the generic playground registry, then expected the
browser to reject that value. Its expectation is obsolete: the value can
belong to a contributor that joins after projection.

Remove the case.
`test_playground_keeps_contributor_drafts_until_reset_or_a_new_choice`
already checks an admitted choice before contributor registration and
the pending slice through undo;
`test_notification_playground_admits_only_its_exact_page_configuration`
checks that a page with an exact value schema refuses extra fields. Both
focused cases pass locally. The obsolete assertion failed in the [main
CI run](https://github.com/max-sixty/leaf/actions/runs/38708320180).
#3012 separately repaired the shared control-styling cause behind 16
failures there.

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants