Add file prefix format option to Bear importer#510
Open
KrauseFx wants to merge 1 commit intoobsidianmd:masterfrom
Open
Add file prefix format option to Bear importer#510KrauseFx wants to merge 1 commit intoobsidianmd:masterfrom
KrauseFx wants to merge 1 commit intoobsidianmd:masterfrom
Conversation
tgrosinger
reviewed
Mar 13, 2026
Contributor
tgrosinger
left a comment
There was a problem hiding this comment.
Thanks for making this improvement!
I'm wondering if the note prefix should apply to attachments too, like it does in the Apple Notes importer format?
| t.onChange(v => updatePrefix(v)); | ||
| // In practice, users may click Import while focus is still in this field. | ||
| // 'change' may not fire yet, so persist on each keystroke too. | ||
| t.inputEl.addEventListener('input', () => updatePrefix(t.inputEl.value)); |
Contributor
There was a problem hiding this comment.
I do not think this is necessary. In my testing I see that the onChange hook is called before this listener every time I press a key.
| async import(ctx: ImportContext): Promise<void> { | ||
| // The importer modal clears/rebuilds its DOM before import runs, so read from | ||
| // persisted settings here instead of trusting the now-detached input element. | ||
| this.filePrefixFormat = localStorage.getItem(LOCAL_STORAGE_KEY) || ''; |
Contributor
There was a problem hiding this comment.
I'm not sure why this is necessary. this.filePrefixFormat is the same before and after this line in my testing.
|
|
||
| idMapping[metadata?.id] = { | ||
| filename: fileName, | ||
| filename: file.basename, |
Contributor
There was a problem hiding this comment.
Why does this need to change?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
File prefix formatoption to the Bear importer, matching the Apple Notes behavior for note filenames.This lets users prefix imported Bear note names with creation dates using a format like
YYYY-MM-DD, or leave it blank for no prefix.Apple Notes implementation similar to https://github.com/obsidianmd/obsidian-importer/blob/master/src/formats/apple-notes.ts