etesync-notes icon indicating copy to clipboard operation
etesync-notes copied to clipboard

Export note

Open zecakeh opened this issue 3 years ago • 10 comments

The format is different than the Share feature, it adds data in front-matter to be able to import it later (it only sets a title attribute right now). The front-matter format should be compatible with most apps that use it.

I had to implement this differently for each platform:

  • On Android, it asks for a location to save to, the OS creates an empty file and we write to that file.
  • On iOS, it creates the file in cache and then uses the share feature, since they can save to files directly.
  • On Web, we create a Blob that we ask the user to download.
  • The default export.ts file is for future platforms before they implement it.

Tested on web Firefox and Chromium Linux Tested on native Android, iOS Simulator

zecakeh avatar Jan 18 '21 17:01 zecakeh

Looks good I think.

One thing though: I think the import / export should be something from the settings and should let you do mass import/export otherwise it's a bit tedious to go one by one. Would probably need to let you either create a zip archive (are there tiny zip implementations?) or something and let people export the whole thing at once. This will also be useful once we support generic file attachments and etc.

What do you think?

tasn avatar Feb 05 '21 11:02 tasn

I agree it would be tedious, but I thought it could still be useful to want to export only one note. It's also because on web there's no "sharing" feature per se. Of course the next steps are collection export and "account" export (export everything). I'm just building on the previous work each time.

zecakeh avatar Feb 05 '21 13:02 zecakeh

I think that the "share" on the web should just copy it to clipboard, and export/import should export everything as said above.

I understand you are just building on previous work (and that's great, and the right way of doing it), but the problem is that if you add functionality it can be annoying/confusing to remove it later on for users. You don't want to keep on changing the UIs and user behaviours 10 times a week. So it's better to plan such functionality changes before and introduce whatever you think is right rather than in incompatible steps. That's at least how I see it.

tasn avatar Feb 07 '21 08:02 tasn

I do believe there is value in exporting only one note or one collection, but if you disagree I'll focus on a general export feature.

zecakeh avatar Feb 07 '21 16:02 zecakeh

I'm not saying there isn't, I'm just arguing against complexity. It's very easy to go down a path and have a million buttons in every screen and a million configuration options. It's much better to plan in advance. Doesn't "share" fulfil the "export one" use case? What's exactly the use-case you are envisioning?

tasn avatar Feb 08 '21 11:02 tasn

The use case would be to store the note or share it as a file instead of sharing its content. On iOS this doesn't change anything since they can save as a file from the share menu but on Android or Web you'd have to share first to a text editor, and then share that file. It's basically a "Save as…" function from on editor. On the plus side, this makes EteSync Notes usable as a text editor (when import/incoming share will be available anyway).

zecakeh avatar Feb 08 '21 14:02 zecakeh

How about we do this: have an export/import page that lets you save note separately as a file, and will later also let you do mass export? I just don't like having it in the quick action menu, as I bet we'll want this real estate for other things later on.

tasn avatar Feb 08 '21 14:02 tasn

This would be available in the settings, right? What would the UI look like? A checklist to chose what note to export?

zecakeh avatar Feb 08 '21 17:02 zecakeh

Now there's a screen in Settings to export notes. For now it exports all the selected notes in a zip file, it doesn't care about notebooks.

Ready for review, but we should wait until after #117 is merged to be able to make a new release first.

zecakeh avatar Feb 22 '21 14:02 zecakeh

Potential conflicts warning

This pull request has changes that are conflicting with the changes in 2 open PRs.

#163 Rename RootStackParamList.tsx to NavigationConfig.tsx by @zecakeh (updated 5 minutes ago)

  • src/RootStackParamList.tsx

#164 Move linking config to NavigationConfig by @zecakeh (updated Just now)

  • src/App.tsx
  • src/RootStackParamList.tsx

sturdy-devtools[bot] avatar Feb 23 '21 19:02 sturdy-devtools[bot]