Skip to content

fix: add newline when appending tasks#1102

Merged
chhoumann merged 1 commit intomasterfrom
codex/fix-issue-124-with-tests
Feb 6, 2026
Merged

fix: add newline when appending tasks#1102
chhoumann merged 1 commit intomasterfrom
codex/fix-issue-124-with-tests

Conversation

@chhoumann
Copy link
Owner

@chhoumann chhoumann commented Feb 6, 2026

Fixes #124.

This addresses a missing newline when appending a task capture to the bottom of a note that does not end with a trailing newline.

Repro

  • Existing note ends without a final newline
  • Capture appends a task to bottom
  • Before: - [ ] Old task- [ ] New task (same line)
  • After: tasks land on separate lines

Changes

  • Ensure a separator newline is inserted when needed in the CaptureChoiceFormatter append-to-bottom path.
  • Add a regression test for the no-trailing-newline case.

Verification

  • bun run test
  • bun run build-with-lint

Open with Devin

Summary by CodeRabbit

  • Bug Fixes

    • Improved newline handling when appending tasks to files, ensuring proper separation between existing content and newly formatted content, particularly for files without trailing newlines.
  • Tests

    • Added test suite validating correct newline formatting behavior when appending tasks to existing file content.

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quickadd Ready Ready Preview Feb 6, 2026 2:45pm

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

The changes add a test suite for CaptureChoiceFormatter's newline handling and refine the prepend logic to intelligently calculate newline separation based on file state and content characteristics, fixing improper task concatenation when appending new tasks.

Changes

Cohort / File(s) Summary
CaptureChoiceFormatter Newline Handling
src/formatters/captureChoiceFormatter.ts, src/formatters/captureChoiceFormatter-frontmatter.test.ts
Refines newline separation logic in the prepend path by considering trailing newlines, formatted content prefixes, and task presence. Adds test suite validating correct newline separation between existing and appended tasks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A carriage return hops into place,
Tasks now line up with proper space,
Old and new no longer embrace,
Each on their line—what perfect grace!
Tests confirm the newline's case. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the specific fix addressing the core issue: ensuring proper newline insertion when appending tasks to files lacking trailing newlines.
Linked Issues check ✅ Passed The changes successfully address issue #124 by fixing newline separation logic in CaptureChoiceFormatter and adding regression test coverage for the no-trailing-newline case.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the newline handling issue: modifications to the prepend logic and a targeted test case validating the fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/fix-issue-124-with-tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5338e9a
Status: ✅  Deploy successful!
Preview URL: https://6f52231c.quickadd.pages.dev
Branch Preview URL: https://codex-fix-issue-124-with-tes.quickadd.pages.dev

View logs

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@chhoumann chhoumann merged commit a4b4e4a into master Feb 6, 2026
5 checks passed
@chhoumann chhoumann deleted the codex/fix-issue-124-with-tests branch February 6, 2026 14:51
github-actions bot pushed a commit that referenced this pull request Feb 8, 2026
# [2.11.0](2.10.0...2.11.0) (2026-02-08)

### Bug Fixes

* add newline when appending tasks ([#1102](#1102)) ([a4b4e4a](a4b4e4a))
* clarify split direction labels to match actual behavior ([#1089](#1089)) ([ea97045](ea97045)), closes [#1081](#1081)
* correct end-of-section line detection ([#1096](#1096)) ([0eeedb3](0eeedb3)), closes [#593](#593)
* **docs:** explain how to add user scripts to macros ([c6e2448](c6e2448))
* encode spaces in advanced uri docs ([0c24cd0](0c24cd0))
* handle alias frontmatter case and commas ([cc6aec6](cc6aec6))
* improve capture target resolution ([1bd7520](1bd7520))
* improve choice rename UX ([bccc331](bccc331)), closes [#683](#683)
* **settings:** hide .md extension in settings suggesters ([#1104](#1104)) ([2e6056e](2e6056e)), closes [#102](#102)

### Features

* **format:** add case transforms for VALUE/NAME ([#1103](#1103)) ([1a962c2](1a962c2)), closes [#90](#90)
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

🎉 This PR is included in version 2.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Adding a new task at the bottom of the note does not add carriage return

1 participant