feat: show content section badge in search results#85
Conversation
Derive section from URL's first segment matched against content/API config entries. Returns label (e.g. "Docs", "Petstore") per result. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Display content folder label (e.g. "Docs", "Petstore") as a badge on the right side of each search result. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR extends the search feature with section labeling. Backend code computes section identifiers from configured content paths and API spec names, stores them in the search index, and returns them in API responses. The UI imports a Badge component and renders section labels as right-aligned badges alongside search suggestions and results. ChangesSearch Results Section Labeling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Compute section label once during indexing and store in search_docs table. Query handler reads it directly from DB. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Section for docs pages derived from URL + config.content inline. Section for API pages uses spec.name directly. No helper functions needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 `@packages/chronicle/src/server/api/search.ts`:
- Around line 228-238: The map keys created in buildSectionMap use basePath with
only the leading slash removed, so values like "/apis/" become "apis/" and won't
match later lookups; update the basePath normalization in buildSectionMap (the
basePath variable) to strip both leading and trailing slashes (e.g., remove any
trailing "/" after removing the leading "/") before calling map.set so stored
keys match URL-segment extraction.
🪄 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: 8c842fd1-61df-491d-94b6-6c0dbd216e4f
📒 Files selected for processing (3)
packages/chronicle/src/components/ui/search.module.csspackages/chronicle/src/components/ui/search.tsxpackages/chronicle/src/server/api/search.ts
Summary
sectionfield to search API response, derived from URL's first segment matched against content/API config entriesTest plan
🤖 Generated with Claude Code