Skip to content

update notes import and export file type to jsonl #3301

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

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

Conversation

sutterseba
Copy link
Collaborator

Changes the file type of notes exports to .jsonl (JSON Lines), which is a more common format used by compatible wallets as specified in BIP-329.

For example, exporting labels with Sparrow Wallet creates a .jsonl, which would previously have to be renamed manually in order to allow importing it in the BitBoxApp.

The supported import file types are updated accordingly, still allowing .txt imports for exports created prior to this change.

@sutterseba sutterseba requested a review from benma April 22, 2025 14:18
Copy link
Contributor

@benma benma left a comment

Choose a reason for hiding this comment

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

I assume this also needs to be extended:

// import notes form uses .txt file type, but is not supported here.
if (".txt".equals(mimeTypes[0])) {
fileType = "text/plain";

@sutterseba sutterseba force-pushed the allow-jsonl-import-export branch from 880cd7a to a6d1b3e Compare April 23, 2025 06:06
@sutterseba
Copy link
Collaborator Author

@benma PTAL, change assumes that getAcceptTypes() returns two elements .jsonl and .txt (not ".jsonl,.txt" as a single one). The latter should not happen afaiu but I can't really test on Android.

(Kept the existing check to map to a single valid type)

@thisconnect
Copy link
Collaborator

tested a6d1b3e on Android.

Importing .txt worked. somehow I can only see .txt and not .jsonl. If I browse to Downloads, I can see the .jsonl file but grayed out. Only the txt file is selectable.

@sutterseba sutterseba force-pushed the allow-jsonl-import-export branch 2 times, most recently from d840753 to 27486cc Compare April 23, 2025 08:53
@sutterseba
Copy link
Collaborator Author

sutterseba commented Apr 23, 2025

The (android) filer picker shows .jsonl files as binary (i.e. it doesn't recognize it), so I opted to remove the file type restriction now. In notes import, any file should be able to be selected again. Not ideal, but restricting the picker to only allow .txt and .jsonl would probably require a more involved change.

Changes the file type of notes exports to .jsonl (JSON Lines), which
is a more common format used by compatible wallets as specified in
BIP-329.

For example, exporting labels with Sparrow Wallet creates a .jsonl,
which would previously have to be renamed manually in order to allow
importing it in the BitBoxApp.

The supported import file types are updated accordingly, still allowing
.txt imports for exports created prior to this change.
@sutterseba sutterseba force-pushed the allow-jsonl-import-export branch from 27486cc to e690423 Compare May 5, 2025 09:22
@sutterseba
Copy link
Collaborator Author

rebased, sry forgot to re-request review

@sutterseba sutterseba requested a review from benma May 5, 2025 09:23
@thisconnect
Copy link
Collaborator

The (android) filer picker shows .jsonl files as binary (i.e. it doesn't recognize it), so I opted to remove the file type restriction now. In notes import, any file should be able to be selected again. Not ideal, but restricting the picker to only allow .txt and .jsonl would probably require a more involved change.

It would be still very nice to have the filter-by-file-type so that it only shows supported files (.txt and .jsonl).

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