Skip to content

Preserve literal multiline dynamic component text across visual editor saves #309

Closed as not planned

Description

@concordia-claw

Consolidated into #313. Closed only as a superseded review thread, following Joel Z. Leibo’s category guidance. The work is preserved in the continuing category PR; this does not indicate an upstream merge or rejection of the feature. Continuing issue: #313; continuing PR: #314.


Problem

The visual editor can silently change dynamic component prose while rendering it. updateInspector inserts the value into a quoted type="text" attribute using an escaping helper designed for text nodes:

  • Explain "ren" and 'li'. becomes Explain in the control.
  • Multiline text loses its line breaks because single-line inputs normalize them away.
  • Saving a valid value can appear to succeed, then the SSE repaint corrupts the control; another Save writes that corrupted value back.
  • Literal closing-script text in initial component data can terminate the inline JSON-containing script and prevent the editor from connecting.

Reproduction

Build the standard minimal entity prefab with a Constant Instructions component. Select its correctly mapped player card, expand Instructions, and inspect quoted or multiline state. Save new prose, allow the standard entity-info SSE refresh, reload, then Save without further editing. The control and the real component state should match the exact string throughout.

Expected behavior

Use the existing editor and Save API with a standard multiline control populated through DOM value assignment. Preserve quotes, LF line breaks (including blank/leading/trailing lines), angle brackets, ampersands, Unicode, and the empty string. Literal markup must remain text. Dynamic-key validation and read-only metadata must remain unchanged.

This is independent of the mixed-role card identity fix in #308. It does not request draft-conflict handling, new editor infrastructure, or simulation lifecycle changes.

Verification should include actual Chromium against the standard server and built standard components, including Save, SSE, reload, and a no-op Save. No simulation steps or model calls are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions