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

@@ -250,11 +250,12 @@ export default function DocumensoSettingsPage() {
/>
<span>
<strong>Envelope CRUD endpoints.</strong> <code>GET</code>, <code>DELETE</code>,
<code>POST /envelope/create</code> (multipart), <code>POST /envelope/distribute</code>,{' '}
<code>POST /envelope/redistribute</code>, <code>GET /envelope/{'{id}'}/download</code>{' '}
all routed through <code>/api/v2/envelope/...</code> when v2 is selected. The
template-generate path is intentionally still v1 (relies on Documenso 2.x&apos;s
backward-compat window see the deferred-roadmap below).
<code>POST /envelope/create</code> (multipart),{' '}
<code>POST /envelope/distribute</code>, <code>POST /envelope/redistribute</code>,{' '}
<code>GET /envelope/{'{id}'}/download</code> all routed through{' '}
<code>/api/v2/envelope/...</code> when v2 is selected. The template-generate path
is intentionally still v1 (relies on Documenso 2.x&apos;s backward-compat window
see the deferred-roadmap below).
</span>
</li>
<li className="flex items-start gap-2">
@@ -263,8 +264,8 @@ export default function DocumensoSettingsPage() {
aria-hidden="true"
/>
<span>
<strong>One-call send.</strong> v2&apos;s <code>/envelope/distribute</code> returns
per-recipient <code>signingUrl</code> in the same response v1 requires a
<strong>One-call send.</strong> v2&apos;s <code>/envelope/distribute</code>{' '}
returns per-recipient <code>signingUrl</code> in the same response v1 requires a
separate GET to fetch them. Faster send flow on the rep side.
</span>
</li>
@@ -288,10 +289,9 @@ export default function DocumensoSettingsPage() {
<span>
<strong>Post-signing redirect URL.</strong> Set in the &quot;v2 signing
behaviour&quot; card; Documenso redirects the signer to that URL after they
complete signing. Use to land clients on the marketing site&apos;s success page
or back in the portal instead of Documenso&apos;s default thank-you page. (v1
honours this too listed here because the admin setting was added with the v2
work.)
complete signing. Use to land clients on the marketing site&apos;s success page or
back in the portal instead of Documenso&apos;s default thank-you page. (v1 honours
this too listed here because the admin setting was added with the v2 work.)
</span>
</li>
</ul>
@@ -320,14 +320,14 @@ export default function DocumensoSettingsPage() {
re-generating.
</li>
<li>
<strong>Non-SIGNER recipient roles (CC / VIEWER)</strong> APPROVER role is
already used by the EOI template; CC + VIEWER not yet exposed in the recipient
builder. Useful for sales managers who want a copy without a signature slot.
<strong>Non-SIGNER recipient roles (CC / VIEWER)</strong> APPROVER role is already
used by the EOI template; CC + VIEWER not yet exposed in the recipient builder.
Useful for sales managers who want a copy without a signature slot.
</li>
</ul>
<p className="mt-2 text-xs text-muted-foreground">
Sequential signing and post-signing redirect URL <strong>are now wired</strong>
see the new &quot;v2 signing behaviour&quot; card below to configure them.
Sequential signing and post-signing redirect URL <strong>are now wired</strong> see
the new &quot;v2 signing behaviour&quot; card below to configure them.
</p>
</div>
</CardContent>