feat(serve): match command palette search on template paths - #1839
Conversation
Include the raw path in the searchable text so slash-style queries like "marketing/headers" or "marketing/headers/4.with-avatar" list the matching templates, alongside the existing space-split filename/dir matching. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe command palette now matches templates by raw slash-separated paths, filenames, and space-separated path segments. Hidden command-item search text includes both raw and space-separated path forms. ChangesTemplate search
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This localized change adds slash-style template path matching while preserving existing search behavior. No actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
What
The command palette can now be searched by path. Slash-style queries match the template hierarchy, which is what you'd expect when hunting through a large project:
marketing/headers→ lists all templates undermarketing/headersmarketing/headers/4.with-avatar→ lists the templates in that folderPreviously these returned nothing, because the searchable text only had the path segments joined by spaces — so a query containing a
/never matched.How
Include the raw path in the searchable text, alongside the existing space-split form:
templateResultshaystack (decides which templates render).sr-onlytext (reka filters each item by itstextContent, so both layers need it to agree).Whitespace tokens still work as before, so
marketing headersandheaders avatarbehave the same as the slash form.Verified
Against a large real project:
marketing/headers→ 25 resultsmarketing/headers/4.with-avatar→ 2 resultswith-avatar→ 2,marketing headers(space) → 25,headers avatar→ 2 — unchanged.Summary by CodeRabbit