Fix artifact title generation on client side#251
Open
Dev10-sys wants to merge 2 commits intodbpedia:masterfrom
Open
Fix artifact title generation on client side#251Dev10-sys wants to merge 2 commits intodbpedia:masterfrom
Dev10-sys wants to merge 2 commits intodbpedia:masterfrom
Conversation
📝 WalkthroughWalkthroughAdds runtime normalization to ensure fetched documents have a title. For docs missing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@public/js/search/search-adapter.js`:
- Around line 35-44: The loop in the SearchAdapter response handler (where
docs.forEach and d.id splitting occurs) incorrectly assumes d.id.split("/")[1]
exists; update the logic to guard against absolute URIs and short IDs by: check
that d.id is a non-empty string, ignore URL schemes (e.g., startsWith("http://")
or "https://") or treat them by taking the last path segment, split on "/" and
use the last non-empty segment only if present, and if that still yields nothing
fall back to using the full d.id (or a safe decoded form) as the title so titles
are never left undefined; apply this change inside the docs.forEach callback in
the SearchAdapter response processing.
Author
|
Good catch. Updated the title derivation to safely handle absolute URIs and short IDs by normalizing path segments with a fallback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #243
Normalize artifact titles on the client side so that version and content variant strings are not unintentionally included in the displayed title.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.