Conversation
Adds a new option to insert capture content at the top of the active file (after frontmatter) instead of at the cursor position. This addresses the feature request in issue #248. Changes: - Add new 'activeFileTop' capture action type - Add 'activeFileWritePosition' field to capture choice types - Update UI to show separate 'At cursor' vs 'Top of file' options - Update engine and formatter to handle the new action - Add tests for the new functionality - Ensure backward compatibility for existing choices Closes #248
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR adds a "write to top of file" feature by introducing a new capture action type "activeFileTop" and a configurable Changes
Sequence DiagramsequenceDiagram
participant User
participant Builder as Choice Builder
participant Engine as Capture Engine
participant Action as Action Resolver
participant Formatter as Content Formatter
User->>Builder: Select "Top of file" option
Builder->>Builder: Set activeFileWritePosition = "top"
User->>Engine: Trigger capture
Engine->>Action: getCaptureAction(choice)
alt activeFileWritePosition = "top"
Action->>Action: Check: captureToActiveFile && !prepend<br/>&& !insertAfter.enabled
Action-->>Engine: return "activeFileTop"
else activeFileWritePosition = "cursor"
Action-->>Engine: return "currentLine" or other
end
Engine->>Formatter: shouldRunTemplater(action)
alt action = "activeFileTop"
Formatter->>Formatter: Trigger templating
end
Engine->>Engine: Insert content at top<br/>with success notice
Engine-->>User: Capture complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
🧰 Additional context used🧬 Code graph analysis (2)src/engine/CaptureChoiceEngine.ts (1)
src/engine/captureAction.test.ts (1)
🔇 Additional comments (14)
Comment |
# [2.8.0](2.7.0...2.8.0) (2025-11-14) ### Bug Fixes * restore Insert After matching for table separator rows ([#983](#983)) ([1393e6a](1393e6a)), closes [#970](#970) * support frontmatter tags in getFieldValues filtering ([#980](#980)) ([c9de468](c9de468)), closes [#927](#927) ### Features * Add embed replacement option for link placement ([#984](#984)) ([06a77a3](06a77a3)), closes [#893](#893) * add provider-native model discovery ([#982](#982)) ([f195c06](f195c06)) * add textarea type for advanced script settings ([#981](#981)) ([dc9a650](dc9a650)) * add update modal settings for major releases only ([#985](#985)) ([d63f8c9](d63f8c9)), closes [#447](#447) * add write to top of file switch for capture to active file ([#986](#986)) ([5361e6c](5361e6c)), closes [#248](#248) [#248](#248)
|
🎉 This PR is included in version 2.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🚀 Release has been published: v2.8.0 |
Description
This PR adds a new option to insert capture content at the top of the active file (after frontmatter) instead of at the cursor position, addressing the feature request in #248.
Changes
activeFileTopcapture action typeactiveFileWritePositionfield to capture choice types ("cursor"|"top")Testing
activeFileTopactionRelated Issue
Closes #248
Summary by CodeRabbit
Release Notes