350 Commits

Author SHA1 Message Date
Chandler Copeland
9117dc4c02 initial install 2026-04-08 12:54:58 -06:00
Chandler Copeland
71cef4d7b6 docs(phase-20): complete phase execution 2026-04-06 15:15:43 -06:00
Chandler Copeland
7621007a60 docs(20-02): complete plan — human verified all 12 steps, v1.3 milestone shipped
- 20-02-SUMMARY.md updated with full human verification results (TMPL-10 through TMPL-16)
- STATE.md: phase 20 marked complete, progress 100% (65/65 plans)
- ROADMAP.md: v1.2 and v1.3 milestones marked shipped
2026-04-06 15:02:24 -06:00
Chandler Copeland
81a39c8e59 docs(20-02): complete template hint quick-fill plan
- Task 1 committed: DocumentPageClient fields fetch + selectedFieldHint derivation + PreparePanel hint chip
- Awaiting human-verify checkpoint (Task 2)
2026-04-06 14:55:19 -06:00
Chandler Copeland
eec0bd91c9 feat(20-02): add template hint quick-fill chip to PreparePanel
- DocumentPageClient fetches /api/documents/:docId/fields on mount and aiPlacementKey change
- Derives selectedFieldHint from selected field's hint property
- Passes selectedFieldHint prop to PreparePanel
- PreparePanel renders Template Hint chip in Quick Fill section when hint exists
2026-04-06 14:54:09 -06:00
Chandler Copeland
78d579f965 docs(20-01): complete apply-template plan — My Templates tab + template apply branch
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 14:52:31 -06:00
Chandler Copeland
2947fa558c feat(20-01): add My Templates tab to AddDocumentModal
- Add DocumentTemplateRow type and activeTab/docTemplates/selectedDocTemplate state
- Lazy-fetch /api/templates on first My Templates tab click
- handleSwitchToTemplates lazy-loads on first click only
- handleSelectDocTemplate clears selectedTemplate and customFile (mutual exclusivity)
- handleSelectTemplate now also clears selectedDocTemplate
- handleSubmit: new branch at top sends documentTemplateId to POST /api/documents
- Guard and disabled condition updated to include selectedDocTemplate
- Tab bar renders with underline-style active indicator matching project Tailwind patterns
- Existing Forms Library content and custom upload section wrapped in activeTab === 'forms' conditional
2026-04-06 14:51:23 -06:00
Chandler Copeland
bdf0cb02ff feat(20-01): extend POST /api/documents with documentTemplateId branch
- Parse documentTemplateId from JSON body alongside formTemplateId
- Fetch document template with formTemplate relation for PDF filename
- Copy signatureFields with fresh crypto.randomUUID per field (snapshot independence)
- Map template signer role labels to client email + contacts array
- Return early with inserted doc; existing form-library and upload paths unchanged
2026-04-06 14:50:24 -06:00
Chandler Copeland
af5beaf5cb docs(phase-20): create phase plan — apply template and portal nav 2026-04-06 14:10:38 -06:00
Chandler Copeland
9081342e1b docs(phase-20): add validation strategy 2026-04-06 14:06:37 -06:00
Chandler Copeland
64e5f730df docs(phase-20): research apply-template-and-portal-nav phase 2026-04-06 14:05:44 -06:00
Chandler Copeland
880f374c44 docs(phase-20): gather context for apply-template phase 2026-04-06 13:59:46 -06:00
Chandler Copeland
db7a76defc fix(portal): raise ConfirmDialog z-index to 1000 to clear FieldPlacer overlays and nav stacking context 2026-04-06 13:55:14 -06:00
Chandler Copeland
e6e4dc92a6 docs(phase-19): complete phase execution 2026-04-06 13:55:07 -06:00
Chandler Copeland
687ff48ee7 docs(19-03): complete Phase 19 template editor UI — human verification passed
- SUMMARY.md updated to reflect all 9 verification steps passed
- TMPL-05 through TMPL-09 confirmed by human live browser test
- TMPL-15 and TMPL-16 marked complete in REQUIREMENTS.md
- STATE.md: Phase 19 marked COMPLETE, progress 98%
- ROADMAP.md: Phase 19 all 3 plans complete

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 13:47:54 -06:00
Chandler Copeland
80f6678e48 docs(19-03): complete template editor E2E verification plan
- Created 19-03-SUMMARY.md for human-verify checkpoint
- STATE.md advanced to plan 3/3, progress 98%
- ROADMAP.md phase 19 marked Complete (3/3 plans)
- TMPL-05 through TMPL-09 requirements confirmed complete

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 13:18:37 -06:00
Chandler Copeland
c81e1e2187 docs(19-02): complete template editor UI plan
- SUMMARY.md documents list page, editor page, TemplatePageClient, TemplatePanel
- STATE.md: plan advanced to 2, progress 97%, 2 decisions logged
- ROADMAP.md: phase 19 updated (2/3 plans complete)
- REQUIREMENTS.md: TMPL-05 through TMPL-09 marked complete
2026-04-06 13:17:09 -06:00
Chandler Copeland
10ea48d5ba feat(19-02): template editor page, TemplatePageClient, and TemplatePanel
- Server component at /portal/templates/[id] queries documentTemplates with formTemplate relation
- notFound() for archived/missing templates
- TemplatePageClient: state owner mirroring DocumentPageClient pattern
  - deriveRolesFromFields initializes Buyer/Seller defaults or extracts from existing fields
  - handlePersist merges textFillData hints into f.hint for type='text' fields
  - handleAiAutoPlace POSTs to /api/templates/[id]/ai-prepare and increments aiPlacementKey
  - Role rename/remove re-fetches fields and PATCHes with updated signerEmail values
- TemplatePanel: 280px right panel with inline styles matching portal design system
  - Signers/Roles section with color dots, click-to-rename, remove with ConfirmDialog
  - Add role input with preset chips (Buyer, Co-Buyer, Seller, Co-Seller)
  - AI Auto-place button (navy) with spinner/loading state and error display
  - Save Template button (gold) with success 'Saved' text fading after 3s
2026-04-06 13:15:23 -06:00
Chandler Copeland
4ca0769cf2 feat(19-02): templates list page with create-template modal
- Server component at /portal/templates queries documentTemplates with LEFT JOIN to formTemplates
- TemplatesListClient renders list rows with name, form name, field count, last updated
- Create modal POSTs to /api/templates and navigates to /portal/templates/[id] on success
- Empty state with CTA when no templates exist
- Gold #C9A84C accent, navy #1B2B4B headings, inline styles matching portal patterns
2026-04-06 13:13:29 -06:00
Chandler Copeland
6745c2057c docs(19-01): complete template editor infrastructure plan 2026-04-06 13:11:40 -06:00
Chandler Copeland
275565c933 feat(19-01): create template API routes — file, fields, ai-prepare
- GET /api/templates/[id]/file: streams form PDF from seeds/forms/ with path traversal guard
- GET /api/templates/[id]/fields: returns signatureFields array (or []) from documentTemplates
- POST /api/templates/[id]/ai-prepare: runs AI field placement with null client context, writes to DB
- All routes: auth guard + isNull(archivedAt) soft-delete filter consistent with Phase 18
2026-04-06 13:10:02 -06:00
Chandler Copeland
57efd91fa2 feat(19-01): add onPersist, fieldsUrl, fileUrl props and Templates nav link
- FieldPlacer: add onPersist and fieldsUrl optional props (backwards-compatible)
- FieldPlacer: 4 persistFields call sites now conditionally use onPersist when provided
- FieldPlacer: loadFields useEffect uses fieldsUrl ?? default documents endpoint
- PdfViewer: add onPersist, fieldsUrl, fileUrl props; pass to FieldPlacer; fileUrl ?? default for PDF source
- PdfViewerWrapper: add and pass through onPersist, fieldsUrl, fileUrl to PdfViewer
- PortalNav: insert Templates link between Clients and Profile
2026-04-06 13:09:19 -06:00
Chandler Copeland
8bc3b2dfbe fix(19): revise plan 02 — remove client-text contradiction in handlePersist 2026-04-06 12:52:01 -06:00
Chandler Copeland
c03bff8736 docs(19): create phase plan — 3 plans in 3 waves 2026-04-06 12:46:48 -06:00
Chandler Copeland
a8741f7654 docs(phase-19): add validation strategy 2026-04-06 12:39:52 -06:00
Chandler Copeland
35da140559 docs(19): research phase 19 template editor UI 2026-04-06 12:39:01 -06:00
Chandler Copeland
d941c68f58 docs(19): UI design contract 2026-04-06 12:31:10 -06:00
Chandler Copeland
ff07cd049c docs(phase-19): gather context for template editor UI phase 2026-04-06 12:24:17 -06:00
Chandler Copeland
bb3545e536 docs(phase-18): verification passed — 8/8 must-haves, documentTemplates table + CRUD API complete 2026-04-06 12:20:41 -06:00
Chandler Copeland
6c5722fc61 docs(18-02): complete template CRUD API plan
- 18-02-SUMMARY.md: GET/POST/PATCH/DELETE routes with soft-delete and auth guard
- STATE.md: advanced to plan 2/2, progress 98%, decisions recorded
- ROADMAP.md: Phase 18 marked Complete (2/2 plans)
2026-04-06 12:18:45 -06:00
Chandler Copeland
12a74fcf4a feat(18-02): PATCH and DELETE handlers at /api/templates/[id]
- PATCH accepts name and signatureFields for rename and field save per D-10
- PATCH sets updatedAt: new Date() explicitly per D-05
- PATCH returns 404 for archived or missing templates
- DELETE soft-deletes by setting archivedAt: new Date() per D-07 (no hard delete)
- DELETE sets updatedAt: new Date() per D-05, returns 204 No Content
- Both handlers auth-gated with auth() per D-11
2026-04-06 12:17:39 -06:00
Chandler Copeland
28c7773b40 feat(18-02): GET and POST handlers at /api/templates
- GET lists active templates (archivedAt IS NULL) with LEFT JOIN for formName
- GET computes fieldCount server-side from signatureFields.length per D-12
- POST validates name + formTemplateId, verifies FK exists, returns 201
- Both handlers auth-gated with auth() per D-11
2026-04-06 12:17:18 -06:00
Chandler Copeland
752a6b7509 docs(18-01): complete template schema plan — documentTemplates table + migration 0012
- SUMMARY.md created for phase 18 plan 01
- STATE.md: plan advanced to 18-02, progress 97%, decisions recorded
- ROADMAP.md: phase 18 progress updated (1/2 plans complete)
- REQUIREMENTS.md: TMPL-01 marked complete
2026-04-06 12:16:09 -06:00
Chandler Copeland
c33c4ec075 chore(18-01): generate migration 0012 for document_templates table
- CREATE TABLE document_templates with 7 columns
- FK constraint form_template_id -> form_templates(id) ON DELETE no action
- No alterations to existing tables
2026-04-06 12:15:12 -06:00
Chandler Copeland
9e677f9505 feat(18-01): add documentTemplates table and relation to schema.ts
- Add document_templates pgTable with 7 columns: id, name, formTemplateId, signatureFields, archivedAt, createdAt, updatedAt
- formTemplateId FK references formTemplates.id with no onDelete cascade
- signatureFields typed as SignatureFieldData[] via jsonb, nullable (template starts empty)
- archivedAt nullable timestamp for soft-delete (NULL = active)
- Add documentTemplatesRelations joining to formTemplates
2026-04-06 12:15:01 -06:00
Chandler Copeland
421688f7f7 docs(18): create phase plan — schema + CRUD API for document templates 2026-04-06 12:11:45 -06:00
Chandler Copeland
1afac9df1c docs(phase-18): gather context for template schema and CRUD API 2026-04-06 12:08:26 -06:00
Chandler Copeland
caf9acf0c2 docs: create milestone v1.3 roadmap (3 phases, 16 requirements) 2026-04-06 12:05:21 -06:00
Chandler Copeland
05d531a929 docs: define milestone v1.3 requirements (TMPL-01 through TMPL-16) 2026-04-06 11:55:49 -06:00
Chandler Copeland
f83dba5e69 docs: complete project research 2026-04-06 11:54:40 -06:00
Chandler Copeland
a027b8fbf4 docs: start milestone v1.3 Document Templates 2026-04-06 11:48:07 -06:00
Chandler Copeland
6013dfe89f feat: client-text and client-checkbox field types — signer fills text/checks boxes on signing page 2026-04-06 11:35:30 -06:00
Chandler Copeland
116fa2bdfb chore: add start.sh and seed-forms.sh deployment scripts 2026-04-03 18:36:51 -06:00
Chandler Copeland
e2bda51d91 feat: per-signer status panel with Resend button on sent documents, fix sign page field filter 2026-04-03 18:21:07 -06:00
Chandler Copeland
bc0495dea9 fix(signing): filter fields by signer on sign page — was passing all fields unfiltered 2026-04-03 18:14:46 -06:00
Chandler Copeland
4fe7913d7e fix(email): switch to SMTP port 587 STARTTLS — port 465 SSL blocked in Docker 2026-04-03 18:06:33 -06:00
Chandler Copeland
2d2a43a3c9 fix(docker): polyfill DOMMatrix/ImageData/Path2D for pdfjs-dist in linux/amd64 container via NODE_OPTIONS --require 2026-04-03 18:02:39 -06:00
Chandler Copeland
f15e538f5c fix(ui): uniform card heights, tinted bottom section on client cards 2026-04-03 17:51:44 -06:00
Chandler Copeland
ac42fa1fc7 fix: show additional contacts on client profile page 2026-04-03 17:49:13 -06:00
Chandler Copeland
47bc0f4cfa fix: remove redundant recipients field — signers system handles all email dispatch 2026-04-03 17:46:30 -06:00