feat(documents-hub): NewDocumentMenu dropdown + FolderDropZone drag-drop

Replaces the bare "+ New document" Button on the documents hub with a
NewDocumentMenu dropdown so reps explicitly pick between:
- "Upload file" → opens a Dialog with FileUploadZone scoped to the
  current folder + entity context. No signing flow attached.
- "Generate document for signing" → navigates to /documents/new wizard.

Avoids the prior ambiguity where reps clicked "+ New document" intending
to attach a file and were dropped into the Documenso signer wizard.

Also adds FolderDropZone wrapping FlatFolderListing and EntityFolderView.
Dragging files from the OS over the current folder shows a drop overlay;
drop fires N parallel uploads carrying the folder + entity context.
Mirrors the per-entity Files tab UX but works in-place on the hub.

Both surfaces hit /api/v1/files/upload with folderId + entityType/Id +
the legacy clientId/companyId/yachtId FKs so files land on the right
entity AND inside the correct folder.

Also includes the in-flight prettier reformat from lint-staged on a
few previously-touched files (create-document-wizard, file-upload-zone,
admin/documenso/page) and adds the standalone prod-readiness audit
report to docs/superpowers/audits/ for permanent reference.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 17:59:34 +02:00
parent 979eadae48
commit 1bdc856589
7 changed files with 761 additions and 48 deletions

View File

@@ -265,8 +265,8 @@ export function CreateDocumentWizard({ portSlug }: CreateDocumentWizardProps) {
/>
)}
<p className="text-xs text-muted-foreground">
Drop a PDF or click to browse. The file is stored, then the wizard wires it as
the source for signing.
Drop a PDF or click to browse. The file is stored, then the wizard wires it as the
source for signing.
</p>
</div>
)}