Remove identity card from HomeScreen — redundant with subtitle and profile list

This commit is contained in:
Avi 2026-09-01 11:58:15 -05:00
commit 269f0c0230
3 changed files with 4 additions and 79 deletions

View file

@ -76,29 +76,6 @@ export function HomeScreen({ onNavigate, onCreateProfile }: HomeScreenProps) {
</Button> </Button>
</header> </header>
{active && (
<section className="card home-identity-card">
<div className="home-identity-content">
<Avatar npub={active.npub} label={active.label} size="lg" picture={active.picture} />
<div className="home-identity-copy">
<strong className="home-identity-name" aria-label="Active profile name">
{active.label}
</strong>
<code className="mono" title={active.npub}>
{shortenNpub(active.npub, shorten)}
</code>
<p className="hint">
Notes will be signed as this profile. Private keys never leave this computer.
</p>
</div>
</div>
<Button variant="secondary" onClick={() => onNavigate('profiles')}>
<Icon name="users" size={16} />
Switch profile
</Button>
</section>
)}
<div className="home-grid"> <div className="home-grid">
<section className="card"> <section className="card">
<header className="card-header"> <header className="card-header">

View file

@ -1468,57 +1468,6 @@ select {
gap: 10px; gap: 10px;
} }
.home-identity-card {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
border-color: var(--success);
background: var(--surface);
}
.home-identity-content {
display: flex;
align-items: center;
gap: 16px;
min-width: 0;
}
.home-identity-copy {
min-width: 0;
}
.home-identity-name {
margin: 0 0 4px;
color: var(--text);
font-size: 16px;
font-weight: 650;
}
.home-identity-copy .mono {
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: bottom;
}
.home-identity-copy .hint {
max-width: 58ch;
margin: 8px 0 0;
}
@media (max-width: 620px) {
.home-identity-card {
align-items: stretch;
flex-direction: column;
}
.home-identity-card .btn {
width: 100%;
}
}
.home-profile-row { .home-profile-row {
display: flex; display: flex;
align-items: center; align-items: center;

View file

@ -23,11 +23,10 @@ describe('HomeScreen', () => {
const { onNavigate } = renderHome(backend); const { onNavigate } = renderHome(backend);
renderWithApp(<HomeScreen onNavigate={onNavigate} onCreateProfile={vi.fn()} />); renderWithApp(<HomeScreen onNavigate={onNavigate} onCreateProfile={vi.fn()} />);
// Wait for the identity card to appear after state loads. // The active profile appears in the profile list with its shortened npub.
const switchBtn = await screen.findByRole('button', { name: 'Switch profile' }); const profileList = await screen.findByRole('listbox');
const identityCard = switchBtn.closest('.home-identity-card') as HTMLElement; expect(within(profileList).getByText('Alice')).toBeInTheDocument();
expect(within(identityCard).getByText('Alice')).toBeInTheDocument(); expect(within(profileList).getByText(/npub1alice\.\.\./)).toBeInTheDocument();
expect(within(identityCard).getByText(/npub1alice\.\.\./)).toBeInTheDocument();
const compose = screen.getByRole('button', { name: 'Compose' }); const compose = screen.getByRole('button', { name: 'Compose' });
await userEvent.setup().click(compose); await userEvent.setup().click(compose);