dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.69k stars 253 forks source link

Move Note between vaults should move assets as well #525

Open grizz-pl opened 3 years ago

grizz-pl commented 3 years ago

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

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

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.

kevins8 commented 3 years ago

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) < notifications@github.com> 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 .

suuuz commented 3 years ago

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.

kpathakota commented 3 years ago

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.

kevinslin commented 3 years ago

Some thoughts here.

aleksey-rowan commented 2 years ago

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

enibrn commented 1 month ago

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