Repository navigation
fix: render both initials for multi-word names in RAGFlowAvatar - #17320
Merged
Merged
Conversation
Contributor
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe avatar initials generator now uses the first and last characters of a single-word name, uppercased, instead of only the first character. ChangesAvatar initials
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
tryeverything24
force-pushed
the
fix-avatar-initials
branch
from
July 23, 2026 17:39
ac675c6 to
d237a0a
Compare
cike8899
approved these changes
Aug 20, 2026
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.
Summary
RAGFlowAvatarrenders a name-based fallback avatar (initials) when no image isavailable. The
getInitialshelper was meant to produce a single initial forone-word names and two initials (first + last word) for multi-word names, but a
copy-paste slip made both branches identical:
As a result the
parts.length === 1check is dead code and every name — includingmulti-word names like "John Doe" — renders just the first letter ("J" instead of
"JD"). The surrounding SVG already sizes its
viewBoxoninitials.length - 1,so it was written to accommodate multi-character initials; the layout branch was
simply never reachable.
This PR makes the multi-word branch return the first and last word initials, which
is the intended (and standard) avatar behavior:
One-word names are unchanged.
nameis already guarded as a non-empty string andtrim().split(/\s+/)yields non-empty word segments, so the new access is safe.Type of change