Skip to content

feat: add import and export functionality for notes#167

Open
paulowender wants to merge 3 commits into
vixalien:mainfrom
paulowender:feature/import-export
Open

feat: add import and export functionality for notes#167
paulowender wants to merge 3 commits into
vixalien:mainfrom
paulowender:feature/import-export

Conversation

@paulowender

Copy link
Copy Markdown

Overview

This PR introduces the ability to export and import notes, allowing users to backup their data or migrate notes between different devices.

Features

  • Export Notes: Allows users to save all their notes into a single JSON file.
  • Import Notes: Allows users to restore notes from a previously exported JSON file.
  • Modern UI: Integrated into the main application menu using the modern Gtk.FileDialog for a seamless GNOME experience.

Technical Details

  • Added export_notes and import_notes actions to Application.
  • Implemented file selection using the asynchronous Gtk.FileDialog (GTK4).
  • The exported format is a standard JSON structure containing all note properties (content, style, dimensions, etc.).

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.

image

@vixalien vixalien left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, what's the format used for export/import? I think you can try using markdown

Comment thread src/application.ts Outdated
Comment thread src/application.ts Outdated
Comment thread src/application.ts Outdated
Comment thread src/application.ts
Comment thread src/application.ts
@paulowender
paulowender force-pushed the feature/import-export branch from 9b8e525 to 464f635 Compare April 23, 2026 15:33
@paulowender
paulowender force-pushed the feature/import-export branch from 464f635 to 4cb137c Compare April 23, 2026 15:37
@paulowender

Copy link
Copy Markdown
Author

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!

@paulowender

Copy link
Copy Markdown
Author

Hello, what's the format used for export/import? I think you can try using markdown

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!

@paulowender

Copy link
Copy Markdown
Author

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

@voltagecontrol

Copy link
Copy Markdown

This feature would be really nice!
Because my wife wants to move from Windows to Linux Mint and she has a lot of notes in her Windows Sticky Notes app. I can export these notes in Windows (its in a sqlite-DB), but need a way to import them to Sticky. JSON would be nice. I can then write a script that will do the conversion.

@paulowender

Copy link
Copy Markdown
Author

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.

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.

3 participants