Skip to content

Add runtime object editor example with screen/object DnD modeling and metadata mutation - #199

Draft
clauspruefer with Copilot wants to merge 2 commits into
mainfrom
copilot/v1-0-1-editor-functionality
Draft

Add runtime object editor example with screen/object DnD modeling and metadata mutation#199
clauspruefer with Copilot wants to merge 2 commits into
mainfrom
copilot/v1-0-1-editor-functionality

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR introduces a new x0 example app that acts as an in-browser editor for building and restructuring screens at runtime. It adds a custom editor object that can create/edit/reparent UI objects while keeping object.json and skeleton.json runtime structures synchronized.

  • New example application (example16)

    • Added /example/object_editor with sql/, static/, and README.md
    • Registered app config with template_file and setup_class so the custom editor object is loadable from metadata
    • Updated top-level example documentation to include the new example
  • Custom editor object type (ObjectEditor)

    • Added sysObjObjectEditor.js as a template-loaded custom x0 object
    • Implements:
      • main object bar:
        • screen section (add/remove/switch)
        • system-object section (all registered setup classes)
      • properties form for selected object
      • workspace canvas for hierarchy visualization and drop targets
  • Runtime model mutation behavior

    • New-object creation updates:
      • sysFactory.DataObject.XMLRPCResultData (object definitions)
      • sysFactory.DataSkeleton.XMLRPCResultData (screen hierarchy refs)
    • Existing-object reparenting updates skeleton refs in place and rebuilds affected screen without full page reload
    • Screen operations (add/remove/switch) integrate directly with sysFactory.switchScreen()
  • Guardrails and consistency controls

    • Unique object ID generation
    • Parent-cycle prevention during reparenting
    • Last-screen deletion protection
    • Safe status rendering (text sink, not HTML sink)
  • Integration test coverage scaffold

    • Added dedicated test config under /test/integration/config/editor_builder
    • Added test/integration/test_editor_builder.py to exercise editor flows (screen add/switch + runtime add/reparent assertions)
// runtime object + skeleton mutation during create
this.getObjectStore()[ObjectID] = {
  'Type': TypeID,
  'Attributes': Attributes
};

const NewEntry = {};
NewEntry[ObjectID] = { 'RefID': ParentID };
this.getSkeletonStore()[ScreenID].push(NewEntry);

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