diff --git a/app/(main)/[locale]/contacts/page.tsx b/app/(main)/[locale]/contacts/page.tsx
index aac399b4..6deb6a47 100644
--- a/app/(main)/[locale]/contacts/page.tsx
+++ b/app/(main)/[locale]/contacts/page.tsx
@@ -173,12 +173,13 @@ export default function ContactsPage() {
const addEmail = searchParams.get('addEmail');
const addName = searchParams.get('addName');
const from = searchParams.get('from');
+ const viewParam = searchParams.get('view');
if (!contactId && !addEmail && !from) return;
intentAppliedRef.current = true;
if (from === 'email') setReturnToEmail(true);
if (contactId) {
setSelectedContact(contactId);
- setView('detail');
+ setView(viewParam === 'edit' ? 'edit' : 'detail');
} else if (addEmail) {
setCreatePrefill({ email: addEmail, name: addName ?? undefined });
setSelectedContact(null);
diff --git a/components/email/__tests__/contact-sidebar-edit.test.tsx b/components/email/__tests__/contact-sidebar-edit.test.tsx
new file mode 100644
index 00000000..d8433779
--- /dev/null
+++ b/components/email/__tests__/contact-sidebar-edit.test.tsx
@@ -0,0 +1,106 @@
+import { render, screen, fireEvent } from '@testing-library/react';
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { ContactSidebarPanel } from '../email-viewer';
+import type { ContactCard } from '@/lib/jmap/types';
+
+const contact: ContactCard = {
+ id: 'c1',
+ addressBookIds: {},
+ name: {
+ components: [
+ { kind: 'given', value: 'Alice' },
+ { kind: 'surname', value: 'Smith' },
+ ],
+ isOrdered: true,
+ },
+ emails: { e0: { address: 'alice@example.com' } },
+};
+
+const unknownEmail = 'unknown@example.com';
+
+describe('ContactSidebarPanel', () => {
+ beforeEach(() => {
+ Object.assign(navigator, {
+ clipboard: { writeText: vi.fn().mockResolvedValue(undefined) },
+ });
+ });
+
+ it('shows Edit button when contact is known and onEditContact is provided', () => {
+ render(
+