fix(ignore-pattern): match note path and vault file path - #27
Merged
ClaudiaFang merged 1 commit intoSep 3, 2026
Merged
ClaudiaFang merged 1 commit into
ClaudiaFang merged 1 commit into
Conversation
…tive note
ignorePattern previously only checked the currently active Markdown note
via shouldIgnoreCurrentFile(), which was wrong for auto-upload-on-create:
it checked whichever note happened to be open instead of the newly
created attachment's path, so a pattern like "Private/**" would not
reliably skip a matching created file.
Add a single pure helper, matchesIgnorePattern(pattern, {notePath,
filePath}), used by both pasteHandler and main's auto-upload-on-create
path, replacing the duplicated minimatch call and the removed
shouldIgnore()/shouldIgnoreCurrentFile() zero-argument APIs. An upload is
now ignored if the pattern matches either the relevant note path or the
source vault file path (never the generated S3 object key). Update the
"Ignore pattern" setting description to document this.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uj2kZV1XMWSqnNqvVYyjn7
|
ClaudiaFang
marked this pull request as ready for review
September 3, 2026 08:15
ClaudiaFang
merged commit Sep 3, 2026
9975a25
into
refactor/settings-ux-overhaul
12 of 13 checks passed
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.


Summary
ignorePatternpreviously only ever checked the currently active Markdown note (shouldIgnoreCurrentFile()), which was wrong for auto-upload-on-create: it checked whichever note happened to be open, not the newly created attachment's path.matchesIgnorePattern(pattern, { notePath, filePath })(insrc/ignorePattern.ts), used by bothpasteHandlerandmain.ts's auto-upload-on-create path, replacing the duplicatedminimatchcalls and the removed zero-argumentshouldIgnore()/shouldIgnoreCurrentFile()APIs.Test plan
npm run lintnpm run build(tsc -noEmit + esbuild)npm test— 111 tests passing, including newtests/ignorePattern.test.ts,tests/autoUploadIgnore.test.ts, and ignore-behavior additions totests/pasteHandler.test.tsNotes/foo.md, createdPrivate/image.png, patternPrivate/**→ auto-upload is skipped🤖 Generated with Claude Code
https://claude.ai/code/session_01Uj2kZV1XMWSqnNqvVYyjn7