microdotblog / microblog-mac

Micro.blog for Mac
https://micro.blog
MIT License
37 stars 6 forks source link

Improve Day One Export #14

Closed otaviocc closed 2 years ago

otaviocc commented 2 years ago

Description

This Pull Request adds a new option in Preferences, which allows users to specify the Day One journal they want to use to import their posts.

The Journal information is store per account. When exporting to Day One, the user can import for all accounts or skip the account they don't want to import.

I tried to follow the coding style used in the project, but if I missed something, please let me know in the comments so that I can update the Pull Request.

Fell free to update the strings; I've just added them as placeholders since I don't know the mood/language you want to use to communicate with users.

Additionally, I don't have multiple accounts to try, so please would test it for me? I really appreciate it.

Screenshots

Preferences Window

1 2

Exporting

3 4
manton commented 2 years ago

@otaviocc This is great, thanks again! Do you mind if I remove the prompt for each account and just use the currently selected account and blog when starting the export? I think that would be more consistent with the other export options.

otaviocc commented 2 years ago

@otaviocc This is great, thanks again! Do you mind if I remove the prompt for each account and just use the currently selected account and blog when starting the export? I think that would be more consistent with the other export options.

Of course I don't mind. It actually simplifies the experience for the user and eliminates excessive (and blocking) prompts. And, of course, keeps consistency with other parts of the app.

Thanks @manton!

otaviocc commented 2 years ago

@manton, I've pushed a new commit removing the prompt and exporting posts of the default account.

otaviocc commented 2 years ago

@manton the latest commit in this PR removes the Day One Journal information during sign out.

manton commented 2 years ago

Cool, I'm going to merge this in. I might tweak the prefs layout slightly but otherwise this is looking good to me. (I also looked briefly at whether we could ask Day One for a list of journal names, or find the names in the file system somewhere, but doesn't look like there's an obvious way. And I think just entering the name as you have it will be less prone to breaking later anyway.)

otaviocc commented 2 years ago

Cool, I'm going to merge this in. I might tweak the prefs layout slightly but otherwise this is looking good to me. (I also looked briefly at whether we could ask Day One for a list of journal names, or find the names in the file system somewhere, but doesn't look like there's an obvious way. And I think just entering the name as you have it will be less prone to breaking later anyway.)

I wish their CLI tool had an option to list the existing journals. I tried looking the file system as well, but found nothing.

After submitting I noticed the separator between the blog area and day one are isn't vertically centered.

If there's anything you need from my side, please let me know.

Cheers.

manton commented 2 years ago

I'm shipping this preference change in version 2.5.2 today. I made a couple tweaks to it, improving the spacing between fields and also moved the alert to a message pane at the top of the prefs window so the alerts don't need to be modal. Thanks again!