Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe changes implement functionality to properly handle inserting content after lines followed by blank lines. When using "Insert After", the formatter now scans forward from the matched line to position the cursor after any trailing blank/whitespace lines, preserving spacing patterns. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/docs/Choices/CaptureChoice.md (1)
60-70: LGTM: Documentation clearly explains the feature.The explanation and example accurately demonstrate the blank-line-preservation behavior.
💡 Optional: Consider showing before/after states
The example could be slightly clearer by explicitly showing the before and after states:
Example (Insert After `# H` with content `X`): +Before: +```markdown +# H + +A +``` + +After: ```markdown # H X AThis makes it immediately clear where X was inserted. </details> </blockquote></details> <details> <summary>src/formatters/captureChoiceFormatter-frontmatter.test.ts (1)</summary><blockquote> `181-309`: **LGTM: Comprehensive regression test suite.** The tests thoroughly verify the blank-line-preservation behavior across multiple scenarios, including edge cases like CRLF content and EOF matches. The helper functions effectively reduce duplication. Based on learnings, this provides excellent regression coverage for the bug fix. <details> <summary>💡 Optional: Consider adding a test for trailing blank lines at EOF</summary> The current tests cover most edge cases, but you could add a test for when the matched line is followed by blank lines that extend to EOF: ```typescript it('handles blank lines at EOF after the match', async () => { const { formatter, file } = createFormatter(); const choice = createInsertAfterChoice('# H'); const fileContent = '# H\n\n\n'; const result = await formatter.formatContentWithFile( 'X\n', choice, fileContent, file, ); expect(result).toBe('# H\n\n\nX\n'); });This would verify that the
scanLimitlogic correctly handles trailing blank lines.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/docs/Choices/CaptureChoice.md(1 hunks)src/formatters/captureChoiceFormatter-frontmatter.test.ts(1 hunks)src/formatters/captureChoiceFormatter.ts(2 hunks)src/gui/ChoiceBuilder/captureChoiceBuilder.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Source code lives in
src/: core logic underengine/,services/, andutils/; Svelte UI insrc/gui; shared types insrc/types; settings entry insrc/quickAddSettingsTab.ts
Files:
src/gui/ChoiceBuilder/captureChoiceBuilder.tssrc/formatters/captureChoiceFormatter-frontmatter.test.tssrc/formatters/captureChoiceFormatter.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx}: Biome enforces tab indentation (width 2), LF endings, and an 80-character line guide; align editor settings
Use camelCase for variables and functions
Prefer type-only imports in TypeScript files
Route logging through theloggerutilities for consistent output
Structure production code so Obsidian dependencies are injected behind interfaces; unit tests target pure logic and swap in adapters ortests/obsidian-stub.ts
Files:
src/gui/ChoiceBuilder/captureChoiceBuilder.tssrc/formatters/captureChoiceFormatter-frontmatter.test.tssrc/formatters/captureChoiceFormatter.ts
src/**/*.{ts,tsx,svelte}
📄 CodeRabbit inference engine (AGENTS.md)
Use PascalCase for classes and Svelte components
Files:
src/gui/ChoiceBuilder/captureChoiceBuilder.tssrc/formatters/captureChoiceFormatter-frontmatter.test.tssrc/formatters/captureChoiceFormatter.ts
docs/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Keep user-facing docs in
docs/directory
Files:
docs/docs/Choices/CaptureChoice.md
🧠 Learnings (1)
📚 Learning: 2025-12-09T21:20:52.425Z
Learnt from: CR
Repo: chhoumann/quickadd PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-09T21:20:52.425Z
Learning: Applies to tests/**/*.{ts,tsx} : Add regression coverage for bug fixes
Applied to files:
src/formatters/captureChoiceFormatter-frontmatter.test.ts
🧬 Code graph analysis (1)
src/formatters/captureChoiceFormatter-frontmatter.test.ts (3)
src/formatters/captureChoiceFormatter.ts (1)
CaptureChoiceFormatter(16-399)src/types/choices/ICaptureChoice.ts (1)
ICaptureChoice(5-46)src/services/choiceService.ts (1)
createChoice(30-34)
🔇 Additional comments (3)
src/gui/ChoiceBuilder/captureChoiceBuilder.ts (1)
410-413: LGTM: Clear user-facing guidance.The updated description accurately explains the blank-line-preservation behavior and provides helpful context about using headings as targets.
src/formatters/captureChoiceFormatter.ts (2)
201-224: LGTM: Well-implemented blank-line-scanning logic.The helper correctly:
- Scans forward from the matched line to find contiguous blank lines
- Handles EOF edge cases by excluding the trailing empty string from
split("\n")when the body ends with a newline- Preserves existing behavior when no blank lines follow
259-265: LGTM: Correct integration of blank-line handling.The helper is correctly called only when
!insertAtEnd, preserving the existing section-end logic wheninsertAtEndis enabled.
# [2.10.0](2.9.4...2.10.0) (2026-01-28) ### Bug Fixes * add insert-after blank-line mode ([#1056](#1056)) ([231e908](231e908)) * backfill file opening defaults for legacy choices ([bfffd46](bfffd46)) * default update announcements to major ([#1042](#1042)) ([4e5659b](4e5659b)) * handle template overwrite with case-mismatched paths ([#1049](#1049)) ([0140556](0140556)) * harden suggester display items ([5460657](5460657)) * harden suggester filtering on Android ([4560f22](4560f22)), closes [#1078](#1078) * normalize leading slashes in capture/template paths ([#1050](#1050)) ([1c7def1](1c7def1)) * normalize unicode in file suggestions ([#1046](#1046)) ([10c0402](10c0402)) * pin obsidian types to 1.11.4 for SecretStorage API ([ddbf6f6](ddbf6f6)) * prefill macro rename input ([#1043](#1043)) ([06c4a25](06c4a25)) * preserve blank lines for insert after ([#1054](#1054)) ([818c036](818c036)) * preserve variables for VALUE templating ([36d43ba](36d43ba)) * reduce bundle size below sync limit ([1e1a632](1e1a632)) * restore compatibility with Templater 2.18.0 ([716f2d9](716f2d9)), closes [#1085](#1085) [#1086](#1086) ### Features * add back class to choice suggester ([#1047](#1047)) ([4c8cfe9](4c8cfe9)) * add capture selection-as-value controls ([#1055](#1055)) ([250768a](250768a)) * add inline insert-after capture mode ([b2e1ef5](b2e1ef5)) * add macro selection helper ([786b53c](786b53c)), closes [#483](#483) * add native date picker prompt ([2811c5a](2811c5a)) * add per-token multiline VALUE inputs ([98fa7db](98fa7db)), closes [#339](#339) * add versioned documentation with Docusaurus ([03c2d3e](03c2d3e)) * adopt obsidian 1.11 settings APIs ([#1041](#1041)) ([15c4b34](15c4b34)) * default multi placeholder to name ([fcd058f](fcd058f)) * enhance template folder chooser ([f1e2a9f](f1e2a9f)), closes [#1011](#1011) [#1012](#1012) * improve prompt labeling for VALUE/MACRO and multi choices ([78fd184](78fd184)) * persist input prompt drafts on cancel/escape ([#1044](#1044)) ([62a67f4](62a67f4)) * store AI provider keys in SecretStorage ([4559013](4559013)) * support short-form date aliases ([e04a3f6](e04a3f6))
|
🎉 This PR is included in version 2.10.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Testing