ondras / my-mind

Online Mindmapping Software
https://my-mind.github.io
MIT License
3.29k stars 651 forks source link

Support for third party formats on WebDAV #146

Open rosensvv opened 2 years ago

rosensvv commented 2 years ago

I tried loading and saving a .mm (Freemind) formatted mindmap using the webDAV option, but it doesn't work, it tries to read is as it's native json. It would be really nice if the option to specify a format is also available on the webDAV storage backend, even better if it remembers/autodetects the type (maybe using the file extension?).

ondras commented 2 years ago

Good point. The main question here is what is the preferred detection mechanism:

  1. explicit: show a selectbox so the user can pick one
  2. correct: use the Content-type response header
  3. easy: check the file extension

The first approach gives user the most control, but requires explicit interaction. The second one should be preferred in the theoretical case your WebDAV backend is extra-properly configured and respects mime types for individual mind map formats. I am not even sure they have mime types :)

So we are probably going to end with the last one. Cheers to Redmond! 😃

rosensvv commented 2 years ago

I can only add that maybe it would be a good idea to match the loaded mindmap by default, ie if the user loads a .mm mindmap from a webDAV source, pressing the save icon would default to overwriting the loaded map on the same source, matching the format. If the "save as" prompt is invoked then one can use an explicit selectbox to specify (although the file extension approach is totally valid as well, there should be at least a table of format extensions shown in the same menu).