Skip to content

feat(editor): add the studio panels - #24

Merged
khachuongvn merged 1 commit into
mainfrom
feat/editor-ui
Jul 19, 2026
Merged

feat(editor): add the studio panels#24
khachuongvn merged 1 commit into
mainfrom
feat/editor-ui

Conversation

@khachuongvn

Copy link
Copy Markdown
Contributor

The editor, on the operation layer: a scene filmstrip, a stage you select on by clicking, an inspector, and a track timeline of what happens when.

Ported from the arrangement in Bingoo's own editor — scene-centric, so the timeline and preview show the scene being worked on in that scene's own time. A whole-lesson timeline sounds more useful and is not: twelve minutes compresses a four-second reveal into three pixels.

The operation layer now acts on a workspace

The document and its locale bundles. Words live in bundles because structure and language are orthogonal (R4) — which made text editing, the commonest edit there is, the one thing undo could not take back.

With two histories, undo after "rename the heading, then reorder the scenes" walks back through them in an order that belongs to neither. Operations that only touch structure are still written against the document alone and lifted by documentOp, so they cannot alter a bundle by accident.

The package gained a second entry point: @bingoo.ai/explainer-editor/ops is pure and pulls in no renderer, for a server applying edits or a script running a migration.

What is dynamic

  • The palette of things you can add is built from the painter registry, so a kit that registers fraction-bar is creatable without a line changing here.
  • Templates, regions and clip colours come from registries or CSS variables, never a list written in a component.
  • Position is region, order and alignment — no coordinates (R6).
  • Colour is a theme token, not a hex value.

Found while testing

The new-scene fallback named a template that is not in the built-in set, so adding a scene laid out nothing. It now takes whatever the deployment registered first. This is the class of bug the R1 rule exists to prevent, and it was written by hand into the very PR that enforces it.

Tests

332 across six packages, 63 in this one. The studio tests render the real component and drive it the way a person does — click an element on the stage, type, undo — because the operation layer previously had a full suite of passing tests while the editor showed nothing you could click.

A scene filmstrip, a stage you select on by clicking, an inspector and a
track timeline of what happens when — the arrangement every editing tool has
converged on, and worth being unoriginal about.

Every panel changes a lesson by dispatching an operation, so undo, history and
audit work for edits nobody has written yet.

The operation layer now acts on a workspace — the document *and* its locale
bundles. Words live in bundles because structure and language are orthogonal
(R4), which made text editing the one thing undo could not take back. With two
histories, undo after "rename the heading, then reorder the scenes" walks back
through them in an order that belongs to neither. Operations that only touch
structure stay written against the document and are lifted by `documentOp`.

The package now has two entry points: `/ops` is pure and pulls in no renderer,
for a server applying edits headlessly. The default entry adds the panels.

- clip model derived from the compiled timeline, packed into rows
- palette built from the painter registry, so a kit's element is creatable
- typing coalesces into one undo step
- new ops: text.set/clear, narration.setScript/restore/remove, meta.setTitle,
  meta.setTheme, scene.setBeats, element.setFlow

Found while testing the panels: the new-scene fallback named a template that
does not exist in the built-in set, so adding a scene laid out nothing.
It now takes whatever the deployment registered first.

Signed-off-by: khachuongvn <khachuong.vn@gmail.com>
@khachuongvn
khachuongvn merged commit eb34bc6 into main Jul 19, 2026
7 checks passed
@khachuongvn
khachuongvn deleted the feat/editor-ui branch July 19, 2026 16:24
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.

1 participant