Make jinja default slot rendering opt-in and customizable - #115
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesJinja default-slot rendering
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant JinjaTemplate
participant RenderingContext
participant JinjaEngine
JinjaTemplate->>RenderingContext: Look up default slots
RenderingContext-->>JinjaTemplate: Return slot components
JinjaTemplate->>JinjaTemplate: Render enabled slots and merge explicit slots
JinjaTemplate->>JinjaEngine: Render template with slots context
Possibly related PRs
🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@htmy/jinja.py`:
- Around line 173-175: Update the default-slot loop in the rendering method to
skip any name already present in self._slots before calling renderer.render.
Preserve rendering for non-overridden default slots and the existing assignment
behavior for those slots.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5cd49b5c-afc1-40b1-8199-ef6e1fcd0c59
📒 Files selected for processing (2)
htmy/jinja.pytests/test_jinja.py
Closes #114
Summary by CodeRabbit
use_default_slotsoption to control whether default slots are rendered in Jinja templates.