Repository navigation
Conversation
Avatar took name?.[0], which is a single UTF-16 code unit. Names starting with an emoji rendered a lone high surrogate, and names with a leading space rendered a blank initial instead of the "A" fallback. Trim the name and take the first code point instead.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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
The dashboard avatar initial used
name?.[0], which takes one UTF-16 code unit. Names starting with an emoji rendered a lone high surrogate, and names with a leading space rendered a blank initial instead of the "A" fallback.This trims the name and takes the first code point with
Array.from.Changes
apps/web/app/(org)/dashboard/_components/Avatar.tsx: trim, then take the first code point; color index usescodePointAt.apps/web/__tests__/unit/dashboard-avatar.test.ts: new tests for emoji names, leading whitespace, and empty/null fallback.Verification
bunx vitest run __tests__/unit/dashboard-avatar.test.ts). The emoji and whitespace cases fail on the base commit.Known limits
Array.fromsplits by code point, not grapheme. Flags, skin-tone modifiers and ZWJ sequences still show only their first code point.Intl.Segmenterwould cover them; left out to keep the change small.Screenshots
Not attached. Visible change: emoji-led names now show the emoji instead of a broken box.


Confidence Score: 5/5
The PR appears safe to merge.Summary
Updates the dashboard avatar helper to trim names and select the first Unicode code point before uppercasing it.
Reviews (1) · Last reviewed commit: "fix(web): use first whole character for ..." · Reviewed by Greptile