Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
fix(webui): derive the account avatar initial by code point
Sergey Kozyrenkobc80aac9852b
diff --git a/frontend/src/pages/settings/settings-account.test.tsx b/frontend/src/pages/settings/settings-account.test.tsxindex deceba31..f2ffd274 100644--- a/frontend/src/pages/settings/settings-account.test.tsx+++ b/frontend/src/pages/settings/settings-account.test.tsx@@ -32,6 +32,18 @@ describe('SettingsAccount gating', () => {expect(screen.getAllByRole('button', { name: 'Change' })).toHaveLength(3);});+ it.each([+ ['π Team', 'π'],+ ['δΈζ η¨ζ·', 'δΈ'],+ ['νκ΅ μ¬μ©μ', 'ν'],+ ['π Lin', 'π '],+ ])('uses the first whole code point of %s as the avatar initial', (name, expected) => {+ authState.value = { user: { mail: '[email protected]', name, type: 'local' } };+ render(<SettingsAccount />);++ expect(screen.getByText(expected)).toBeInTheDocument();+ });+it('hides password and email editing for an OAuth account but keeps the name editable', () => {authState.value = { user: githubUser };render(<SettingsAccount />);diff --git a/frontend/src/pages/settings/settings-account.tsx b/frontend/src/pages/settings/settings-account.tsxindex 973b3b3b..d65a92da 100644--- a/frontend/src/pages/settings/settings-account.tsx+++ b/frontend/src/pages/settings/settings-account.tsx@@ -31,7 +31,7 @@ function SettingsAccount() {const stopEditing = () => setEditing(null);const displayName = user.name?.trim() || user.mail;- const initial = (displayName || '?').charAt(0).toUpperCase();+ const initial = ([...(displayName || '?')][0] ?? '?').toUpperCase();const createdAt = user.created_at ? new Date(user.created_at) : null;const memberSince =createdAt && !Number.isNaN(createdAt.getTime()) ? format(createdAt, 'MMMM yyyy', { locale: enUS }) : null;