fix: warn when atomize blocks missing from highlight template#90
fix: warn when atomize blocks missing from highlight template#90TyceHerrman wants to merge 1 commit into
Conversation
When users enable atomic highlights but don't add atomize blocks to their highlight template, the plugin silently creates an empty Highlight/ folder. This adds warnings in both settings UI and at sync time, updates the default highlight template to include atomize blocks for new users, and hardens the atomizer against non-string basename values. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
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 (5)
📝 WalkthroughWalkthroughThis pull request implements template validation and user-facing warnings for atomic highlights. It updates the default highlight template to include atomize blocks, adds a utility function to detect atomize syntax, performs preflight validation during sync, displays UI warnings when atomize blocks are missing despite enabled settings, and improves basename coercion safety in the atomizer service. Changes
Sequence DiagramsequenceDiagram
participant User
participant Settings as Settings UI
participant Main as Main Plugin
participant Atomizer as Atomizer Service
User->>Settings: Enable atomic highlights toggle
Settings->>Main: saveSettings() + display()
Settings->>Settings: Check hasAtomizeBlocks() on template
alt Atomize blocks detected
Settings->>Settings: Show normal description
else Atomize blocks missing
Settings->>Settings: Display warning with code example
end
Note over User,Settings: Later during sync...
User->>Main: Trigger sync/update
Main->>Main: Check if atomicHighlights enabled
Main->>Main: Check hasAtomizeBlocks(highlightTemplate)
alt Blocks found
Main->>Atomizer: Execute atomization
Atomizer->>Atomizer: Process with atomize blocks
else Blocks NOT found
Main->>User: Show notice: "atomic highlights enabled but no atomize blocks found"
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 Tip You can get early access to new features in CodeRabbit.Enable the |
Summary
Closes #88
{% atomize %}blocks for new installationsbasenamehandling to coerce non-string values and fall back to highlight IDTest plan
basename=id(numeric) doesn't throw in FIRST or SECOND pass🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Improvements