Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRefactors template file-existence conflict handling into a centralized policy model. Adds Changes
Sequence DiagramsequenceDiagram
actor User
participant TemplateChoiceEngine
participant fileExistsPolicy
participant GenericSuggester
participant Vault
User->>TemplateChoiceEngine: Request create with targetFilePath
TemplateChoiceEngine->>Vault: exists(targetFilePath)?
alt File exists
TemplateChoiceEngine->>fileExistsPolicy: getBehaviorCategory / getSelectedFileExistsMode
alt Behavior == prompt
TemplateChoiceEngine->>GenericSuggester: show collision options
GenericSuggester->>User: present modes
User-->>GenericSuggester: select mode
GenericSuggester-->>TemplateChoiceEngine: modeId
end
TemplateChoiceEngine->>fileExistsPolicy: applyFileExistsMode(modeId)
alt ResolutionKind == createNew
TemplateChoiceEngine->>fileExistsPolicy: resolveCreateNewCollisionFilePath(targetFilePath)
fileExistsPolicy->>Vault: exists(candidatePath)?
loop until free
fileExistsPolicy->>fileExistsPolicy: compute next candidate
fileExistsPolicy->>Vault: exists(nextCandidate)?
end
fileExistsPolicy-->>TemplateChoiceEngine: collisionFreePath
TemplateChoiceEngine->>Vault: create file at collisionFreePath
else ResolutionKind == modifyExisting
TemplateChoiceEngine->>Vault: update existing file (append/overwrite)
else ResolutionKind == reuseExisting
TemplateChoiceEngine->>Vault: open existing file
end
else File does not exist
TemplateChoiceEngine->>Vault: create file at targetFilePath
end
TemplateChoiceEngine-->>User: return created/opened file
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Deploying quickadd with
|
| Latest commit: |
0f8fa2e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b6e25eeb.quickadd.pages.dev |
| Branch Preview URL: | https://1139-bug-leading-zeros-are-s.quickadd.pages.dev |
Fix template choice file-collision handling and make the settings easier to understand.
This PR fixes the runtime bug where QuickAdd could eagerly increment the target path even when the setting implied it should prompt first. It keeps the existing trailing-number behavior for compatibility, adds an identifier-safe
Append duplicate suffixmode, and preserves zero padding when incrementing existing numeric suffixes.On the settings side, I reworked the existing-file UI so it reflects the actual outcomes instead of mixing file updates, new-file creation, and no-op behavior in one flat list. The top-level choice now separates
Ask every time,Update existing file,Create another file, andKeep existing file, and only shows the follow-up action picker when that category needs more configuration.I considered keeping the earlier combined toggle/dropdown row, but it overloaded one setting with too many concepts and made the action meanings hard to scan. The current version is a little more explicit, but it better matches what the runtime actually does.
Reviewer notes:
Increment the file namedocs/docs/..., not versioned snapshotsbun run test,bun run build-with-lint, and Obsidian dev-vault reload/runtime checksFixes #1139
Summary by CodeRabbit
New Features
Documentation