Remove redundant 'Active profile' heading from identity card

This commit is contained in:
Avi 2026-09-01 11:48:43 -05:00
commit 566aa466b9
3 changed files with 4 additions and 10 deletions

View file

@ -77,11 +77,10 @@ export function HomeScreen({ onNavigate, onCreateProfile }: HomeScreenProps) {
</header> </header>
{active && ( {active && (
<section className="card home-identity-card" aria-labelledby="active-identity-title"> <section className="card home-identity-card">
<div className="home-identity-content"> <div className="home-identity-content">
<Avatar npub={active.npub} label={active.label} size="lg" picture={active.picture} /> <Avatar npub={active.npub} label={active.label} size="lg" picture={active.picture} />
<div className="home-identity-copy"> <div className="home-identity-copy">
<h2 id="active-identity-title">Active profile</h2>
<strong className="home-identity-name" aria-label="Active profile name"> <strong className="home-identity-name" aria-label="Active profile name">
{active.label} {active.label}
</strong> </strong>

View file

@ -1488,10 +1488,6 @@ select {
min-width: 0; min-width: 0;
} }
.home-identity-copy h2 {
margin: 0 0 4px;
}
.home-identity-name { .home-identity-name {
margin: 0 0 4px; margin: 0 0 4px;
color: var(--text); color: var(--text);

View file

@ -23,10 +23,9 @@ describe('HomeScreen', () => {
const { onNavigate } = renderHome(backend); const { onNavigate } = renderHome(backend);
renderWithApp(<HomeScreen onNavigate={onNavigate} onCreateProfile={vi.fn()} />); renderWithApp(<HomeScreen onNavigate={onNavigate} onCreateProfile={vi.fn()} />);
// The active profile name appears both in the identity card and in the profile row. // Wait for the identity card to appear after state loads.
const identityCard = (await screen.findByText('Active profile')).closest( const switchBtn = await screen.findByRole('button', { name: 'Switch profile' });
'.home-identity-card', const identityCard = switchBtn.closest('.home-identity-card') as HTMLElement;
) as HTMLElement;
expect(within(identityCard).getByText('Alice')).toBeInTheDocument(); expect(within(identityCard).getByText('Alice')).toBeInTheDocument();
expect(within(identityCard).getByText(/npub1alice\.\.\./)).toBeInTheDocument(); expect(within(identityCard).getByText(/npub1alice\.\.\./)).toBeInTheDocument();