Skip to content

Double undo required for 'Make editable copy' on changedparent script #1734

Description

@alexwarren

Summary

In the WebEditor (and confirmed as an exception in the desktop editor), clicking "Make editable copy" for the changedparent script (inherited from defaultobject) requires two Undo clicks to revert, whereas other inherited scripts such as changedisopen only require one.

Steps to reproduce

  1. Open the WebEditor with a game that has a room
  2. Go to the Attributes tab for the room
  3. Find the changedparent attribute (inherited from defaultobject) — it shows as locked/read-only
  4. Click Make editable copy
  5. Press Undo

Expected: changedparent reverts to inherited state in one Undo step.
Actual: One Undo step is consumed but the attribute remains as an owned (non-inherited) copy; a second Undo step is required to revert.

Notes

  • This only affects changedparent, not other changed* scripts like changedisopen or changedlocked.
  • The desktop editor (Quest 5) throws an exception when attempting the same operation, suggesting a deep pre-existing bug in how changedparent interacts with the undo system.
  • changedparent is distinctive in that it sets this.hasbeenmoved = true and contains a nested if/else block, whereas other changed* scripts do not.
  • Investigation confirmed that MakeScriptEditable creates exactly one undo transaction via EditableScripts.CloneFields.Set, so the extra undo step must be created by some secondary effect triggered specifically by setting the changedparent attribute.
  • Possible lead: Fields.Set fires AttributeChangedNotifyElementFieldUpdate — something in this chain may be triggering an extra undo entry specifically for the changedparent attribute name.

Environment

  • Branch: webeditor-attributes
  • Quest Viva v6 (WebEditor, Svelte 5 + C# WASM)

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