Repository navigation
Conversation
… is on Open on with Keep existing file > Do nothing now opens a note only on the run that creates it. The new keep mode is stored as leaveClosed. Choices saved with 2.33's leaveUnchanged move to the mode with the same behavior: doNothing when Open is on, leaveClosed when it is off. A migration handles data.json and package import handles exported packages. Refs #2279
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Deploying quickadd with
|
| Latest commit: |
0cce329
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3f70808a.quickadd.pages.dev |
| Branch Preview URL: | https://issue-2279.quickadd.pages.dev |
This branch has not been deployed
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.
Why
The goal is to create a note on every run, such as a daily note made by a startup macro, and open it only on the run that creates it. QuickAdd had no setting for that. With Open on, both Keep existing file actions opened an existing note. With Open off, a new note stayed closed.
Product decision
QuickAdd should support this as a general rule, not a daily-note flag. Open applies to the note a run creates or updates. Keep action applies to a note that already exists. Before this change, Open on + Do nothing behaved exactly like Open on + Open existing file, so one combination was redundant and the useful one was missing. Now each of the four combinations does something different:
This helps any Template choice run by a startup macro, a URI, the CLI, or another macro. It adds no setting and no UI row.
Rejected alternative: an "only open new notes" toggle under Open. It overlaps Keep action and adds a setting for the same need.
What changed
leaveClosed.TemplateChoiceEngine.run).leaveUnchanged(2.33.0, feat(template): add Do nothing to Keep existing file #2245) is retired, not reinterpreted. A stored id with a new meaning would be ambiguous in packages exported by other versions. It maps by behavior. With Open on it becomesdoNothing, and with Open off it becomesleaveClosed. Both match the old behavior exactly. The newretireLeaveUnchangedKeepModemigration coversdata.json, andnormalizeTemplateChoicecovers package import.The labels in the choice builder do not change ("Open existing file", "Do nothing"), so this PR has no screenshots. Only the stored value behind Do nothing changes.
Release and migration impact
leaveClosed. feat(template): add Do nothing to Keep existing file #2245 noted the same limit for any new mode.Verification
tests/e2e/file-exists-behavior.test.tspasses 37/37. It adds a [FEATURE REQUEST] Open note only if newly created #2279 scenario that runs the choice twice with Open on and Do nothing. The first run creates and opens the note. The second leaves it closed (effect: unchanged). It also adds an E2E check that the migration mapsleaveUnchangedby Open.expected [ Array(1) ] to deeply equal [], meaning the existing note opened. The unit cellleaveClosed with openFile=truefails the same way. With the normalizer reverted, all 3 mapping tests fail.Daily 2279.mdand opened it. Load 2 left it closed and showed "'Daily 2279' already exists.".dev:errorscaptured no errors.pnpm run testpassed 6991 tests andpnpm run lintpassed.Fixes #2279
Note
Rename
leaveUnchangedtoleaveClosedso Do nothing can open existing notes with Open onleaveUnchangedkeep mode toleaveClosedin fileExistsPolicy.ts.leaveClosedkeeps the reused note closed even when Open is enabled;doNothingopens it.openFilesetting and applies the keep mode'skeptFileOpensvalue only when an existing file is reused.retireLeaveUnchangedKeepModemigration in migrate.ts, backed by normalization in normalizeTemplateFileExistsBehavior.ts. LegacyleaveUnchangedchoices map todoNothingwhenopenFileis true andleaveClosedotherwise.leaveUnchangedchange behavior after migration — with Open on they now open the existing note viadoNothing; with Open off they keep it closed vialeaveClosed. The legacy mode map inlegacyFileExistsModeMapno longer recognizesleaveUnchanged, so unmigrated settings with that value will not resolve.Macroscope summarized 0cce329.