Support application layouts where the holm app is in a subpackage#45
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAppConfig in Changes
Sequence Diagram(s)(omitted — changes are dataclass/initialization refactor and a version bump without multi-component sequential control flow) Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
holm/_model.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-22T23:11:22.422Z
Learnt from: volfpeter
Repo: volfpeter/holm PR: 42
File: examples/forms/page.py:15-15
Timestamp: 2025-12-22T23:11:22.422Z
Learning: In htmy v0.10.0 and later, do not use html tag objects (e.g., html.div, html.form, html.head) as type hints or return types. Replace these with htmy's ComponentType or Component for type annotations in Python code (e.g., def render(...) -> Component or def handler(...) -> ComponentType). Apply this consistently across Python files where htmy HTML tag objects are used in type hints.
Applied to files:
holm/_model.py
🔇 Additional comments (3)
holm/_model.py (3)
31-32: LGTM! Type-safe improvement.The new
app_dir: Pathfield is a good improvement over the previous string-based approach, providing better type safety and clearer semantics.
49-54: LGTM! Clean separation of concerns.The refactored logic correctly separates the computation of
root_dirfromcaller_package_path, which enables the direct assignment ofapp_dirlater. The climbing logic properly handles nested package structures.
59-60: LGTM! Clear and correct instantiation.The direct assignment of
app_dir=caller_package_pathand use of the computedroot_diris straightforward and aligns well with the refactored approach.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
holm/_model.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-22T23:11:22.422Z
Learnt from: volfpeter
Repo: volfpeter/holm PR: 42
File: examples/forms/page.py:15-15
Timestamp: 2025-12-22T23:11:22.422Z
Learning: In htmy v0.10.0 and later, do not use html tag objects (e.g., html.div, html.form, html.head) as type hints or return types. Replace these with htmy's ComponentType or Component for type annotations in Python code (e.g., def render(...) -> Component or def handler(...) -> ComponentType). Apply this consistently across Python files where htmy HTML tag objects are used in type hints.
Applied to files:
holm/_model.py
🔇 Additional comments (1)
holm/_model.py (1)
48-66: LGTM! Well-structured refactoring.The refactoring from
app_dir_name: strtoapp_dir: Pathis a solid improvement that properly supports applications in subpackages. The logic correctly:
- Sets
app_dirto the actual application directory path- Computes
root_dirby walking up the package hierarchy- Maintains consistent URL prefix calculation
refs #41
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.