From 56664068f81cff02ab83d4210009f32c35efe8db Mon Sep 17 00:00:00 2001 From: lorentz Date: Wed, 8 Apr 2026 10:10:39 +0000 Subject: [PATCH] refactor: client detail page layout - notes collapsible near top, assignment tab - Notes moved to collapsible panel just below header - Auto-expanded if client has notes, collapsed if empty - Shows preview snippet when collapsed - Claims Advocate, Designations, Team Members, Related Companies consolidated into new 'Assignment' tab - Removed 4 standalone cards from main scroll area --- .../src/components/clients/client-detail.tsx | 430 +++++++++--------- 1 file changed, 221 insertions(+), 209 deletions(-) diff --git a/ondeck/src/components/clients/client-detail.tsx b/ondeck/src/components/clients/client-detail.tsx index 0ca5377..94bbacb 100644 --- a/ondeck/src/components/clients/client-detail.tsx +++ b/ondeck/src/components/clients/client-detail.tsx @@ -14,7 +14,7 @@ import { SelectValue, } from '@/components/ui/select' import { Textarea } from '@/components/ui/textarea' -import { Building2, MapPin, Phone, Mail, FileText, CheckSquare, CalendarRange, Users, X, Plus, UserCheck, StickyNote, Pencil, Trash2 } from 'lucide-react' +import { Building2, MapPin, Phone, Mail, FileText, CheckSquare, CalendarRange, Users, X, Plus, UserCheck, StickyNote, Pencil, Trash2, ChevronDown, ChevronUp } from 'lucide-react' import { Combobox } from '@/components/ui/combobox' import { formatDate, formatRenewalDate } from '@/lib/utils' import { PolicyGroupManager } from '@/components/clients/policy-group-manager' @@ -53,6 +53,7 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic const [parentOptions, setParentOptions] = useState<{id:string;name:string}[]>([]) const [parentLinking, setParentLinking] = useState(false) const [showArchivedTasks, setShowArchivedTasks] = useState(false) + const [notesExpanded, setNotesExpanded] = useState(!!(client.notes)) const [additionalServiceOpen, setAdditionalServiceOpen] = useState(false) const [sessionUserId, setSessionUserId] = useState('') @@ -318,220 +319,43 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic - {/* Claims Assignments */} - - - - - Claims Assignment - - - - {/* Advocate */} -
- -
- ({ value: u.id, label: u.displayName || u.email }))} - value={advocateId} - onChange={setAdvocateId} - placeholder="Select advocate (Claims dept)" - emptyText="No Claims staff found" - /> - -
-
- - {/* Team Members */} -
- -
- {members.length === 0 && ( -

No members assigned

- )} - {members.map((m: any) => ( -
-
- - {m.user?.displayName || m.user?.email} -
- -
- ))} -
- !members.some((m: any) => m.userId === u.id)) - .map((u) => ({ value: u.id, label: u.displayName || u.email }))} - value={addMemberId} - onChange={setAddMemberId} - placeholder="Add member..." - /> - -
-
-
-
-
- - {/* Related Companies */} - - - - - Related Companies - - - - {/* Parent Company */} -
-

Parent Company

- {parentClient ? ( -
- - {parentClient.name} - - -
- ) : ( -
-
- setParentSearch(e.target.value)} - /> -
- {parentOptions.length > 0 && ( -
- {parentOptions.map((opt) => ( - - ))} -
- )} -
+ {/* Client Notes — collapsible */} +
+