mdelobelle / metadatamenu

For data management enthusiasts : type and manage the metadata of your notes.
https://mdelobelle.github.io/metadatamenu
MIT License
477 stars 27 forks source link

Changing the Parent of an Object or Object List Should Update the Child List #638

Open ChristinWhite opened 3 months ago

ChristinWhite commented 3 months ago

Issue

In trying to determine what was going on with #637 I did a fair but of changing parents for ObjectLists and Objects and whenever I did so I had to relink any of their child properties back to them.

Let's say we have the following:

  - name: Parent
    type: Object
    path: ""
    id: xREaom
  - name: Middle
    type: Object
    path: xREaom
    id: MdLgWd
  - name: ChildProperty
    type: Input
    options: {}
    path: xREaom____MdLgWd
    id: Z3FCeA

Deleting Middle's parent to the root of the fileClasss does the following:


  - name: Parent
    type: Object
    path: ""
    id: xREaom
  - name: Middle
    type: Object
    path: "" ← This changed
    id: MdLgWd
  - name: ChildProperty
    type: Input
    options: {}
    path: xREaom____MdLgWd ← This didn't
    id: Z3FCeA

We now need to go in an relink ChildProperty to Middle

  - name: Parent
    type: Object
    options:
      displayTemplate: ""
    path: ""
    id: xREaom
  - name: Middle
    type: Object
    options:
      displayTemplate: ""
    path: ""
    id: MdLgWd
  - name: ChildProperty
    type: Input
    options: {}
    path: MdLgWd ← Now we've restored the proper hierarchy
    id: Z3FCeA

Desired Function

It would be nice to be able to change the parent of a property that has its own children and have the children update their respective paths as well so we could eliminate that third step above.

This isn't usually a big deal unless you're creating complex nested metadata objects in which case it takes a lot of steps to relink up the chain and creates a lot of opportunities for mistakes.

Workaround

Do it manually.

Priority

Since nothing is actually broken this is a pretty low priority issue, just a nice thing to have at some point.

Environment

Obsidian: 1.5.11 Metadata Menu: 0.8.5