Repository navigation
feat(template): add Do nothing to Keep existing file - #2245
Conversation
Deploying quickadd with
|
| Latest commit: |
2c36246
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f6f44ba0.quickadd.pages.dev |
| Branch Preview URL: | https://issue-2244.quickadd.pages.dev |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Verifier verdict: PASS (independent agent,
|
Keep existing file always opens the note, even with Open off. These tests expect a second keep mode, Do nothing, that leaves the note closed unless Open is on, while the saved mode keeps opening it. Refs #2244
Keep existing file opened the note even with Open off, and there was no way to keep it closed. Keep existing file now has two actions. Open existing file is the old behavior, under the id that saved choices already store. Do nothing leaves the note alone and lets Open decide. When the choice is set to Do nothing and nothing else shows the note, QuickAdd says the note already exists. The Ask every time prompt keeps its items and what they do. Its Do nothing item, which opened the note, is now labeled Open existing file. Fixes #2244
|
Verifier verdict: PASS for head
|
Why
With Open off and If the target file already exists set to Keep existing file, a Template choice still opened the existing note, and there was no way to keep it closed. That auto-open is a released feature (#867, from #61), so this change adds an option instead of changing it. Fixes #2244.
What changed
Scope
doNothing, now labeled Open existing file, and behave as before. The new option isleaveUnchanged.Tradeoffs
Blast Radius
Existing choices and prompt picks behave as before. An older QuickAdd on a synced device cannot run or edit a choice saved with Do nothing, because it does not know the new mode. Any new mode has this limit.
Verification
tests/e2e/file-exists-behavior.test.tsruns every mode with Open off. Against master's code, onlyleaveUnchangedfails, anddoNothingalready opens the note. With the change, all 35 tests pass.Home.mdstays open.pnpm run test(6900 passed) andpnpm run lintpass.Note
Medium Risk
Changes template collision UX and auto-open behavior for existing notes; legacy
doNothingkeeps prior behavior but older QuickAdd versions cannot readleaveUnchanged.Overview
Keep existing file now exposes a Keep action with two choices instead of one implicit behavior. Open existing file (
doNothing, unchanged stored id) still opens the colliding note even when Open is off. Do nothing (leaveUnchanged) leaves the file closed unless Open is on.The template engine uses
opensExistingFileon reuse-existing resolutions rather than always auto-opening. When a run ends witheffect: unchangedand nothing opens or links the note, it shows an "'…' already exists." notice (same pattern as create notices).The Ask every time prompt renames the old Do nothing entry to Open existing file and omits the new true no-op (Escape already dismisses). Docs and CLI
effectwording now refer to Keep existing file instead of the old Do nothing label.The choice builder always shows the mode row for update/create/keep (including Keep action). Saved choices keep
doNothingwithout migration.Reviewed by Cursor Bugbot for commit 2c36246. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add 'Do nothing' keep mode for existing files in Template choices
reuseExisting.TemplateChoiceEngine.run.getPromptModes.doNothingmode ID keeps its ID but its label and behavior now mean 'Open existing file' — it always opens the existing file even when Open is disabled; previously the Open setting could suppress this. PersistedleaveUnchangedvalues now resolve via a legacy mapping instead of being unmapped.Macroscope summarized 2c36246.
Summary by CodeRabbit