Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export note #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Export note #111

wants to merge 1 commit into from

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Jan 18, 2021

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

@tasn
Copy link
Member

tasn commented Feb 5, 2021

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?

@zecakeh
Copy link
Contributor Author

zecakeh commented Feb 5, 2021

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.

@tasn
Copy link
Member

tasn commented Feb 7, 2021

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.

@zecakeh
Copy link
Contributor Author

zecakeh commented Feb 7, 2021

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.

@tasn
Copy link
Member

tasn commented Feb 8, 2021

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?

@zecakeh
Copy link
Contributor Author

zecakeh commented Feb 8, 2021

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).

@tasn
Copy link
Member

tasn commented Feb 8, 2021

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.

@zecakeh
Copy link
Contributor Author

zecakeh commented Feb 8, 2021

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

@zecakeh
Copy link
Contributor Author

zecakeh commented Feb 22, 2021

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.

@sturdy-devtools
Copy link

sturdy-devtools bot commented Feb 23, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants