dendron icon indicating copy to clipboard operation
dendron copied to clipboard

Move Note between vaults should move assets as well

Open grizz-pl opened this issue 4 years ago • 6 comments
trafficstars

Please Select if your Request is Either something new or an Enhancement

  • [x] Enhancement of an existing Feature.
  • [ ] Request of a new feature.

Please select the area your request applys to. (Multiple selections are Possible)

  • [ ] UI
  • [x] Workbench
  • [ ] Publishing
  • [ ] Pods
  • [ ] Markdown
  • [ ] Hierarchy
  • [ ] Graph
  • [ ] Misc (Choose this if your not sure)

Is your feature request related to a problem? Please describe

When I use move note command, only note is moved. Assets stay in old vault.

Describe the solution you'd like

There should be an option to move assets as well.

grizz-pl avatar Mar 05 '21 15:03 grizz-pl

Hmm, that's an interesting addition. When you are saying assets, should this mean any markdown links to local vault specific assets? What if there are other notes in the vault that are still referring to the assets?

On Fri, Mar 5, 2021 at 7:44 AM Witold Firlej (grizz) < [email protected]> wrote:

Please Select if your Request is Either something new or an Enhancement

  • Enhancement of an existing Feature.
  • Request of a new feature.

Please select the area your request applys to. (Multiple selections are Possible)

  • UI
  • Workbench
  • Publishing
  • Pods
  • Markdown
  • Hierarchy
  • Graph
  • Misc (Choose this if your not sure)

Is your feature request related to a problem? Please describe

When I use move note command, only note is moved. Assets stay in old vault. Describe the solution you'd like

There should be an option to move assets as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dendronhq/dendron/issues/525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABPIPSL4QSXVMG57XD34ADTCD36PANCNFSM4YVN5DQA .

kevins8 avatar Mar 05 '21 15:03 kevins8

What if the assets are stored in a folder with the same name as the markdown note? Instead of storing all assets in one folder. The disadvantage would be that referring to an asset from multiple notes doesn't work anymore. A solution could be to refer to the note instead of to the asset. Or to store that specific asset in a central location. The advantage would be that moving and removing notes can move/remove the assets as well. And it also makes more sense when browsing through the files manually on the fileserver, outside of VS code.

suuuz avatar Apr 18 '21 12:04 suuuz

Can we take a phased approach with this one? Write now it feels like it is a bug since image links get broken on a vault move.

  1. If there's only one note linked to the asset, the asset should move to the new vaults asset directory (the majority case). It should throw a warning if more than one note is linked to the asset (IMO the whole point of vaults are to have separate access control/separate data).
  2. If there are many notes linked to the same asset, if one note is moved then I think the right thing is to copy the asset into the second vault as well. People can always go back and delete the asset.
  3. Dendron: doctor command to remove unused assets (so people who run into the situation from 2 can clean up easily).

@suuuz - the main reason I don't think we should have assets per note/folder is it would quickly not scale. There would be lots of tiny folders with only a few files each, which defeats the point of a central folder for media.

kpathakota avatar May 12 '21 15:05 kpathakota

Some thoughts here.

  • quick fix - move assets. we could have a confirmation prompt: eg. We found X assets linked to this vault. Would you like to move them as well?
    • potential issues arises if other notes also link to this file, in which case those links will be broken
  • long term - extend reference synta ![ ] to also work with assets
    • when we move a note, assets can stay in the original vault but the link can be converted into a xvault link
    • when we move the asset, the link can be converted in existing notes

kevinslin avatar May 13 '21 14:05 kevinslin

This issue was selected by the community in the latest round of CROP.

aleksey-rowan avatar May 18 '22 00:05 aleksey-rowan

I made this script for my needs, could be useful for others https://github.com/enibrn/dendron-move-images

enibrn avatar Sep 08 '24 14:09 enibrn