fix: default new recipe path to current folder#341
Conversation
Clicking "+ New Recipe" while browsing a directory now pre-populates the filename input with that directory path so users can immediately type the recipe name instead of retyping the folder.
Code Review — PR #341: fix: default new recipe path to current folderOverview: A small, focused fix that pre-populates the "+ New Recipe" link with the current directory path when browsing a folder. Three files changed, 13 net lines. Verdict: Approve with minor notesCode QualityThe implementation is clean and idiomatic:
Minor nit: The format string Template SafetyAskama HTML-escapes Potential Edge CaseIf Test PlanThe PR's manual test plan covers the important cases (root vs. subdirectory, form submission creating the file in the correct folder). Given the project has no automated test suite (noted in CLAUDE.md), this is the appropriate level of verification. Summary: Well-scoped fix with correct URL encoding, no security concerns, and minimal blast radius. The nits above are truly minor. Ready to merge. |
Code Review — PR #341OverviewPre-populates the new-recipe filename input with the current directory when the "+ New Recipe" button is clicked from inside a folder. Root listing keeps the existing plain Code Quality
Potential Issues
VerdictLooks good. Correct, safe, and minimal. The hardcoded |
Summary
/newlinkFixes #332
Test plan
cargo fmt,cargo clippy,cargo testpass/, the button links to/new(no prefill)/directory/Breakfast, the button links to/new?filename=Breakfast%2Fand the form input renders withvalue="Breakfast/"