Flatten multi-line note content into single-line next actions#60
Conversation
Note inbox items keep their full raw file content as the item's original text. When processed without editing the action field, that multi-line content was written verbatim as a next action, embedding newlines and breaking the one-action-per-line invariant. The bug only appeared alongside a (source) link because both originate from note-type items. Collapse each resolved next action to a single line at the point all write paths read from, so the invariant holds everywhere. Claude-Session: https://claude.ai/code/session_01L6PM2wwRPN7BDUDcB3N6kw
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a ChangesMulti-line next-action normalization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Problem
Processing a note inbox item to a next action could write the action across multiple lines, breaking the one-action-per-line invariant. It only showed up when the item had a
(source)link.Root cause
The
(source)link was a co-symptom, not the cause. Both come from the inbox item being a note rather than a line:getNoteItemsstores a note's entire raw file content as the item content (line items are trimmed to a single line; notes are not).EditableItem.original.deleteInboxItemreturns a[[...|source]]wikilink only for note items — hence the correlation with the source link.resolveFinalNextActionsfalls back to[item.original], and the multi-line content is written verbatim as- [ ] <multi-line text> (source).Fix
resolveFinalNextActionsnow collapses each resolved action to a single line via aflattenToSingleLinehelper (split on newlines, trim each line, drop blanks, join with a space). This is the single chokepoint every write path (next-actions-file, create-project, add-to-project, someday-file) reads actions from, so the invariant holds everywhere.Testing
https://claude.ai/code/session_01L6PM2wwRPN7BDUDcB3N6kw
Summary by CodeRabbit
Bug Fixes
Tests