Repository navigation
Avatars show two initials for a one-word user name, as the other UVCS clients do - #166
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… clients do Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…extra spaces Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ames with extra spaces Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What does this pull request do?
An avatar shown as initials now shows two letters for a one-word user name (
jdoe→ JD), as the other UVCS clients show it. This applies to the Branch Explorer and every list or panel with an avatar.Current behavior
The initials were the first letters of the first two words of the name (split on
.,_and-before the@). A one-word name such asjdoe@example.comgave a single letter ("J"). People used to the other clients, which show the first two letters, read that as a change. The rule has been the same since the app's first version, so this isn't a regression.Behavior with this pull request
jane.doe→ JD.jdoe→ JD,builder→ BU.How it was implemented
initials(src/renderer/src/lib/userName.ts) is the one place both the Branch Explorer canvas (drawAvatar) andui/Avatartake initials from, so the fix lives there:Array.from), so a letter outside the BMP isn't split in half.No
cmcommands change.Behavior changes
None beyond the goal.
Checklist
npm run typecheckandnpm testpass. The new tests cover two-word names (.,-,_), one-word names, a one-letter name, an empty name, letters beyond ASCII and outside the BMP, an accent written as a separate mark, and names with extra spaces.Seen working in the app: the Changesets list, the details panel and the Branch Explorer, in production and development builds, with no renderer errors. The change affects only which letters are drawn, not their color or size, and two-letter initials already showed for every two-word name. No screenshot: the change is two letters in a circle.
npm run e2e: not needed, since this doesn't touch startup or navigation.Other areas the change reaches:
initialshas two callers,ui/AvataranddrawAvatar, and both only render the string.Reviewed in a clean context. It found:
Declined for now:
serverInitialswithinitials: the inputs differ (a host and a user), so that belongs in its own change;DOMAIN\userowners: they gave one letter before as well, and it isn't clearcmreports them.docs/ARCHITECTURE.md"Profile pictures (Gravatar)" names the rule.Fixed issues
None.
🤖 Generated with Claude Code