+ {/* Error display */}
+ {/* (errors handled by react-query + toast) */}
+
+ {/* Desktop: three-pane layout with resizable panels */}
+
+ {/* Left: Folder tree — resizable */}
+
+
+
+
+
+
+ {/* Middle: Contact list — resizable */}
+
+ {/* Toolbar */}
+
+ handleSearch(e.target.value)}
+ placeholder={t('contacts.searchPlaceholder')}
+ aria-label={t('common.search')}
+ className="flex-1"
+ />
+ setViewMode(e.target.value as ContactViewMode)}
+ options={viewModeOptions}
+ aria-label={t('contacts.viewMode')}
+ className="w-auto"
+ />
+ { setSortBy(e.target.value); setPage(1); }}
+ options={sortOptions}
+ aria-label={t('common.filter')}
+ className="w-auto"
+ />
+
+ {t('contacts.create')}
+
+
+
+ {/* List */}
+
+
+
+
+
+ {/* Right: Detail panel — flex-1, not resizable */}
+
+
+
-
-
setSearch(e.target.value)}
- placeholder={t('common.search')}
- aria-label={t('common.search')}
- />
+ {/* Mobile: single-pane view switching */}
+
+ {/* View 1: Folder tree */}
+ {activeView === 'folders' && (
+
+ )}
+
+ {/* View 2: Contact list */}
+ {activeView === 'list' && (
+
+
+
setActiveView('folders')}
+ className="inline-flex items-center gap-1 px-2 py-1 rounded text-sm text-secondary-700 hover:bg-secondary-100 min-h-touch"
+ aria-label={t('common.back')}
+ data-testid="mobile-back-to-folders"
+ >
+
+
+
+ {t('contacts.allContacts')}
+
+
+
+ handleSearch(e.target.value)}
+ placeholder={t('contacts.searchPlaceholder')}
+ aria-label={t('common.search')}
+ />
+
+
+
+ )}
+
+ {/* View 3: Contact detail */}
+ {activeView === 'detail' && (
+
+
+
setActiveView('list')}
+ className="inline-flex items-center gap-1 px-2 py-1 rounded text-sm text-secondary-700 hover:bg-secondary-100 min-h-touch"
+ aria-label={t('common.back')}
+ data-testid="mobile-back-to-list"
+ >
+
+
+
+ {t('common.back')}
+
+
+
+
+ )}
-
navigate(`/contacts/${row.id}`)}
- loading={isLoading}
- emptyMessage={t('common.noResults')}
- testId="contacts-grid"
- />
-
- setDeleteTarget(null)}
+ {/* Edit/Create Modal */}
+ setEditModalOpen(false)}
+ contact={editingContact}
+ onSaved={handleSaved}
/>
);
diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx
index bda9c22..3d65479 100644
--- a/frontend/src/pages/Dashboard.tsx
+++ b/frontend/src/pages/Dashboard.tsx
@@ -2,12 +2,12 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { StatCard } from '@/components/shared/StatCard';
import { ActivityFeed, ActivityItem } from '@/components/shared/ActivityFeed';
-import { useCompanies, useContacts, useAuditLog } from '@/api/hooks';
+import { useUnifiedContacts, useAuditLog } from '@/api/hooks';
export function DashboardPage() {
const { t } = useTranslation();
- const { data: companiesData } = useCompanies(1, 1);
- const { data: contactsData } = useContacts(1, 1);
+ const { data: companiesData } = useUnifiedContacts(1, 1, undefined, 'company');
+ const { data: contactsData } = useUnifiedContacts(1, 1, undefined, 'person');
const { data: auditData, isError: auditError } = useAuditLog(1, 5);
const totalCompanies = companiesData?.total ?? 0;
diff --git a/frontend/src/routes/index.tsx b/frontend/src/routes/index.tsx
index f115b9e..4c70406 100644
--- a/frontend/src/routes/index.tsx
+++ b/frontend/src/routes/index.tsx
@@ -6,12 +6,7 @@ import { LoginPage } from '@/pages/Login';
import { PasswordResetRequestPage } from '@/pages/PasswordResetRequest';
import { PasswordResetConfirmPage } from '@/pages/PasswordResetConfirm';
import { DashboardPage } from '@/pages/Dashboard';
-import { CompaniesListPage } from '@/pages/CompaniesList';
-import { CompanyDetailPage } from '@/pages/CompanyDetail';
-import { CompanyFormPage } from '@/pages/CompanyForm';
import { ContactsListPage } from '@/pages/ContactsList';
-import { ContactDetailPage } from '@/pages/ContactDetail';
-import { ContactFormPage } from '@/pages/ContactForm';
import { AuditLogPage } from '@/pages/AuditLog';
import { GlobalSearchResultsPage } from '@/pages/GlobalSearchResults';
import { SettingsPage } from '@/pages/Settings';
@@ -57,14 +52,7 @@ const router = createBrowserRouter([
children: [
{ path: '/', element:
},
{ path: '/dashboard', element:
},
- { path: '/companies', element:
},
- { path: '/companies/new', element:
},
- { path: '/companies/:id', element:
},
- { path: '/companies/:id/edit', element:
},
{ path: '/contacts', element:
},
- { path: '/contacts/new', element:
},
- { path: '/contacts/:id', element:
},
- { path: '/contacts/:id/edit', element:
},
{ path: '/audit-log', element:
},
{ path: '/search', element:
},
{ path: '/calendar', element:
},