feat: add import and export functionality for notes#167
Conversation
vixalien
left a comment
There was a problem hiding this comment.
Hello, what's the format used for export/import? I think you can try using markdown
9b8e525 to
464f635
Compare
…gs and error handling
464f635 to
4cb137c
Compare
|
Thank you! I've refactored the logic with early returns and added Adw.MessageDialog for user-facing errors. Regarding save_async, I've promisified the FileDialog methods in util.ts, which allows using await dialog.save() directly. Cheers! |
Currently, I'm using JSON because it allows exporting all notes into a single file while preserving metadata like UUID (to avoid duplicates), note styles, and modification dates. This makes it a robust solution for backup and restore. However, I agree that a 'per-note' Markdown export would be a great addition for portability in a future update! |
|
If you think it's more appropriate to avoid confusion with sharing-oriented exports, I'd be happy to rename these actions to 'Backup' and 'Restore'. |
|
This feature would be really nice! |
|
Hi @vixalien, are there any more changes needed for approval? I'm waiting for this function to migrate my notes from my old PC to the new one. |
Overview
This PR introduces the ability to export and import notes, allowing users to backup their data or migrate notes between different devices.
Features
Gtk.FileDialogfor a seamless GNOME experience.Technical Details
export_notesandimport_notesactions toApplication.Gtk.FileDialog(GTK4).Why this is useful
Currently, there is no easy way for users to backup their notes or move them to a new system. This feature provides data portability and peace of mind for users with a large number of notes.