From 9da2cc67fdad2eda6d84b83305206cdea5523e13 Mon Sep 17 00:00:00 2001 From: Chandler Copeland Date: Fri, 3 Apr 2026 16:21:20 -0600 Subject: [PATCH] feat(16-01): thread signers and unassignedFieldIds through PdfViewer chain to FieldPlacer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PdfViewerWrapper accepts and passes signers/unassignedFieldIds to PdfViewer - PdfViewer accepts and passes both props to FieldPlacer - FieldPlacer adds signers/unassignedFieldIds to FieldPlacerProps (optional, defaulted to []/ new Set()) - No rendering changes — prop tunnel only for Wave 2 consumers Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../documents/[docId]/_components/FieldPlacer.tsx | 6 ++++-- .../documents/[docId]/_components/PdfViewer.tsx | 7 +++++++ .../documents/[docId]/_components/PdfViewerWrapper.tsx | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx index aeb766d..89d4172 100644 --- a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx +++ b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx @@ -13,7 +13,7 @@ import { } from '@dnd-kit/core'; import { CSS } from '@dnd-kit/utilities'; import { getFieldType, type SignatureFieldType } from '@/lib/db/schema'; -import type { SignatureFieldData } from '@/lib/db/schema'; +import type { SignatureFieldData, DocumentSigner } from '@/lib/db/schema'; interface PageInfo { originalWidth: number; @@ -164,9 +164,11 @@ interface FieldPlacerProps { onFieldSelect?: (fieldId: string | null) => void; onFieldValueChange?: (fieldId: string, value: string) => void; aiPlacementKey?: number; + signers?: DocumentSigner[]; + unassignedFieldIds?: Set; } -export function FieldPlacer({ docId, pageInfo, currentPage, children, readOnly = false, onFieldsChanged, selectedFieldId, textFillData, onFieldSelect, onFieldValueChange, aiPlacementKey = 0 }: FieldPlacerProps) { +export function FieldPlacer({ docId, pageInfo, currentPage, children, readOnly = false, onFieldsChanged, selectedFieldId, textFillData, onFieldSelect, onFieldValueChange, aiPlacementKey = 0, signers = [], unassignedFieldIds = new Set() }: FieldPlacerProps) { const [fields, setFields] = useState([]); const [isDraggingToken, setIsDraggingToken] = useState(null); const containerRef = useRef(null); diff --git a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx index c3dceb9..37f3005 100644 --- a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx +++ b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx @@ -4,6 +4,7 @@ import { Document, Page, pdfjs } from 'react-pdf'; import 'react-pdf/dist/Page/AnnotationLayer.css'; import 'react-pdf/dist/Page/TextLayer.css'; import { FieldPlacer } from './FieldPlacer'; +import type { DocumentSigner } from '@/lib/db/schema'; // Worker setup — must use import.meta.url for local/Docker environments (no CDN) pdfjs.GlobalWorkerOptions.workerSrc = new URL( @@ -28,6 +29,8 @@ export function PdfViewer({ onFieldSelect, onFieldValueChange, aiPlacementKey, + signers, + unassignedFieldIds, }: { docId: string; docStatus?: string; @@ -37,6 +40,8 @@ export function PdfViewer({ onFieldSelect?: (fieldId: string | null) => void; onFieldValueChange?: (fieldId: string, value: string) => void; aiPlacementKey?: number; + signers?: DocumentSigner[]; + unassignedFieldIds?: Set; }) { const [numPages, setNumPages] = useState(0); const [pageNumber, setPageNumber] = useState(1); @@ -98,6 +103,8 @@ export function PdfViewer({ onFieldSelect={onFieldSelect} onFieldValueChange={onFieldValueChange} aiPlacementKey={aiPlacementKey} + signers={signers} + unassignedFieldIds={unassignedFieldIds} > import('./PdfViewer').then(m => m.PdfViewer), { ssr: false }); @@ -12,6 +13,8 @@ export function PdfViewerWrapper({ onFieldSelect, onFieldValueChange, aiPlacementKey, + signers, + unassignedFieldIds, }: { docId: string; docStatus?: string; @@ -21,6 +24,8 @@ export function PdfViewerWrapper({ onFieldSelect?: (fieldId: string | null) => void; onFieldValueChange?: (fieldId: string, value: string) => void; aiPlacementKey?: number; + signers?: DocumentSigner[]; + unassignedFieldIds?: Set; }) { return ( ); }