Skip to content

[MAIC Editor] Enablement infrastructure (pre-slide-surface) #570

@wyuc

Description

@wyuc

Parent: #560. Lands before #562 (slide surface).

Scope

1. Feature flag

  • NEXT_PUBLIC_MAIC_EDITOR_ENABLED, default OFF.
  • Gates only the Pro toggle in Header; StageMode union unchanged.
  • Retained as kill-switch post-rollout.

2. Slide DSL schema versioning

  • slide.schemaVersion: number on slide content; current shape is v1.
  • migrateSlide(slide) keyed by version; v1 body empty, shape + tests in.
  • Slide loader funnels through migrateSlide.
  • Tests: pure, idempotent, v1 round-trip is identity.

3. Round-trip integration test harness

4. Edit history persistence

5. Concurrency guards

  • AI regen lock — reverse of feat(maic-editor): framework primitives + edit StageMode #564's auto-exit. Edit mode holding a scene → any regenerate-this-scene call (manual retry, auto-on-failure) is refused (pessimistic; no queue).
  • Multi-tab detectBroadcastChannel with localStorage event fallback. Second tab attempting edit on the same course is refused with a clear message.
  • i18n: 2 strings × 6 locales.

Out of scope

  • Server-side history sync (Phase 2).
  • Cross-device conflict resolution.
  • Optimistic regen guard (revisit if pessimistic friction shows up).

Acceptance criteria

  • Flag OFF: zero behavior change vs feat/maic-editor-v0 tip
  • Flag ON: Pro toggle behaves as in refactor(maic-editor): drop EditModeSidebar; clean Pro mode chrome #568
  • slide.schemaVersion in type + serialized; migrateSlide tested
  • Round-trip harness with noop + trivial op cases, green in CI
  • Refresh mid-edit → per-scene restore prompt on remount; accept restores, dismiss clears
  • Regenerate-this-scene refused while edit mode holds it
  • Second tab edit on same course refused
  • All 6 CI gates green; no new lint warnings beyond pre-existing 7

Note

No new user-visible edit affordances ship here — Pro mode behavior is identical to #568 with flag ON. Tests dominate the diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions