Commit Graph
100 Commits
Author SHA1 Message Date
ephraimduncan 2662329455 Merge remote-tracking branch 'origin/main' into pr-2853
# Conflicts:
#	apps/remix/app/components/general/envelope-editor/envelope-editor-fields-page.tsx
2026-07-02 06:48:23 +00:00
ephraimduncan 26f8a56248 fix(pdf): address AcroForm import review feedback 2026-05-27 07:10:42 +00:00
ephraimduncan 5e11db2444 refactor(pdf): simplify AcroForm import code 2026-05-27 01:02:43 +00:00
ephraimduncan 88e836ddbc refactor(pdf): deslop AcroForm import cleanup 2026-05-27 00:39:43 +00:00
ephraimduncan 874243700f fix(pdf): stabilize AcroForm imports 2026-05-27 00:16:03 +00:00
ephraimduncan 824117d47e refactor(pdf): move AcroForm import from upload to editor button
Per-product direction: AcroForm widget to Documenso field creation
should not happen automatically on upload. It must be a deliberate,
opt-in action on a draft envelope.

- Revert AcroForm extraction from create-envelope (route) and
  create-envelope-items upload paths. They no longer thread
  acroFormFields into envelope items or run the extractor.

- Stop flattening on upload (flattenForm: false) so widgets survive
  in the stored PDF until the user opts in.

- New tRPC mutation envelope.field.importFromPdf is the single entry
  point. It loads each item's stored PDF, extracts widgets, creates
  Field rows assigned to the first signable recipient (creating a
  placeholder Recipient 1 SIGNER when none exist), flattens the PDF
  in place, swaps documentDataId, and emits FIELD_CREATED audit log
  entries on DOCUMENT envelopes.

- Editor fields panel gains an "Import from PDF form" button next to
  "Detect with AI", gated to DRAFT envelopes. Success toasts the
  count and revalidates the editor.

- Rewrite acroform-import.spec.ts e2e to the new flow: upload
  preserves widgets and creates zero fields; service call creates
  fields, flattens PDF, audits, and cleans up old DocumentData.

- Invert four DOCUMENT-upload assertions in form-flattening.spec.ts
  to match the new preserve-widgets, no-auto-flatten contract.
  Template and template-to-doc flatten behavior is unchanged.
2026-05-22 18:48:08 +00:00
ephraimduncan d33714a4e5 refactor(pdf): rename Documenteno typo to Documenso in acroform extractor 2026-05-21 13:34:05 +00:00
ephraimduncan b620a8c6d7 fix(pdf): repair acroform extractor heuristic + xfa detection + skip-don't-throw
Eight findings from PR review of feat/acroform-field-import, all verified
against actual source in plan mode before fixing.

P1.1 — getTextFieldFormatHint never produced a hint in practice. PdfDict.get()
returns PdfRef for indirect entries (Adobe almost always emits /AA and /F as
indirect), and String(js) returned "[object Object]" because PdfString and
PdfStream don't override toString. Now we thread a RefResolver via
PDF.context.resolve through every dict lookup, use PdfDict.getDict(key,
resolver) so refs are auto-deref'd, and decode JS bodies via asString() (for
strings) or TextDecoder + getDecodedData() (for streams). The MaxLen probe had
the same bug — also fixed via getNumber(key, resolver). Branch ordering is
restructured so format actions take precedence over every name token, not
just within their own type bucket.

P1.2 — Signed-signature path had no test. Added a stub-based mock test that
drives extractAcroFormFieldsFromPDF against a SignatureField whose isSigned()
returns true and asserts hasSignedSignature: true, fields: [], and an
unsupported entry with reason: 'signed-signature'. Mirrored with a negative
control where isSigned() returns false.

P2.1 — hasXfa reached into PDFForm._acroForm (private readonly) via a cast.
Replaced with public catalog access: pdf.context.catalog.getDict() →
getDict('AcroForm', resolver) → has('XFA'). Removed the
fields.length === 0 short-circuit so pure-XFA docs with no /Fields surface
as xfa-hybrid instead of falling through.

P2.2 — When no signable recipient resolved, the AcroForm branch threw
AppError(NOT_FOUND) inside prisma.$transaction and tore down the entire
envelope creation. Replaced with logger.warn + early skip from the AcroForm
branch only. Matches UNSAFE_createEnvelopeItems' silent-skip behaviour.

P2.6 — Coverage gaps closed with 9 new test cases: encrypted (mock), xfa-
hybrid (mock), signed signature (mock + negative control), listbox unsupported
(mock), no-page-match (mock), format-action precedence (extends fixture),
/TU label fallback (extends fixture), required CHECKBOX (extends fixture
with Ff bit 2), hidden + off-page widgets (extends fixture).

P2.3 / P2.4 / P2.5 — Plan doc updated to match shipped implementation: rot=180
y formula corrected from `top` to `bottom`, heuristic regexes documented as
the lenient substring patterns actually shipped (with explicit false-positive
acknowledgements), signed-signature detection mechanism updated from raw /V
probe to SignatureField.isSigned().

Verification: 26/26 unit tests pass (was 17, +9). lib + trpc + remix
typecheck clean (lib retains 5 pre-existing unrelated errors). biome clean.
2026-05-21 13:23:12 +00:00
ephraimduncan b8a11df768 feat(pdf): import AcroForm widgets as Documenso fields on upload
Detect AcroForm widgets (text, checkbox, radio, dropdown, signature) at upload
time and reuse their geometry as Documenso fields instead of stripping them via
form.flatten(). Imported fields land in the editor as ordinary Field rows
assigned to the first signable recipient, removing the manual re-placement step
users hit when preparing PDFs in Adobe Acrobat.

Extraction runs before normalizePdf so widget geometry is still readable.
Text fields go through a name+format heuristic that maps DATE/NUMBER/EMAIL/
NAME/INITIALS/TEXT, with AcroForm /AA format actions taking precedence over
name tokens. Coordinates are converted via per-rotation transforms (0/90/180/
270) against the rendered page dimensions; widgets fully off-page are
dropped, partial overlap is clamped. Signed signatures (SignatureField.
isSigned()) are detected and skip both the import and the form flatten so
the signature stays valid. Encrypted PDFs, XFA hybrids, malformed PDFs, and
internal extractor errors all return an empty result with skipReason set so
the upload proceeds untouched.

Every imported field carries fieldMeta.source = 'acroform' (new optional on
ZBaseFieldMeta) for future provenance queries. DOCUMENT envelopes emit a
per-field FIELD_CREATED audit entry matching create-envelope-fields.ts.
Recipient assignment picks the first Recipient with role SIGNER or APPROVER
sorted by (signingOrder asc nulls last, id asc); when no signable recipient
exists, a placeholder Recipient 1 SIGNER is created mirroring the
placeholder-pipeline behaviour.
2026-05-21 04:05:12 +00:00
Ephraim Atta-Duncan 51ad6a6ff8 fix: direct links for teams are generated wrong 2024-06-25 16:09:19 +00:00
Ephraim Atta-Duncan 7e065764ec chore: use luxon for dates 2024-06-25 15:10:58 +00:00
Ephraim Atta-Duncan 3356934590 fix: carousel on mobile screen 2024-06-13 08:09:06 +00:00
Ephraim Atta-Duncan 1bbfd9d0f3 fix: remove redundant cards 2024-06-13 05:46:34 +00:00
Ephraim Atta-Duncan 2bf0d42fbd chore: rename to slide 2024-06-10 13:44:43 +00:00
Ephraim Atta-Duncan 1fda9ed2a6 chore: show each slide based on video time 2024-06-10 13:43:50 +00:00
Ephraim Atta-Duncan a278cd6b58 chore: show video on dark theme and light theme 2024-06-06 23:43:51 +00:00
Ephraim Atta-Duncan 3b2d184f05 chore: custom tooltip since it's hiding values under other charts 2024-05-29 08:26:58 +00:00
Ephraim Atta-Duncan 25f870ccc0 feat: dark mode 2024-05-23 14:39:43 +00:00
Ephraim Atta-Duncan c86edbefb7 fix: reset autoplay timer when you manually click on a new slide 2024-05-23 13:10:42 +00:00
Ephraim Atta-Duncan 76e6adcf59 fix: progres slide count 2024-05-23 11:44:03 +00:00
Ephraim Atta-Duncan 7fa3069d8c chore: classname typo 2024-05-23 11:20:13 +00:00
Ephraim Atta-Duncan 4e6e4a0016 feat: add progress at the bottom of the slide 2024-05-23 11:18:21 +00:00
Ephraim Atta-Duncan 907cc3a74e chore: add what's new label 2024-05-23 10:33:47 +00:00
Ephraim Atta-Duncan c14cd2dcc5 fix: show slide content based on image or video 2024-05-23 10:21:29 +00:00
Ephraim Atta-Duncan 7fdda0a840 feat: replace signup widget with carousel 2024-05-23 10:09:36 +00:00
Ephraim Atta-Duncan 72d0a1b69c chore: custom tooltip 2024-05-21 22:53:31 +00:00
Ephraim Atta-Duncan 39e7eb0568 fix: remove cummulative 2024-05-21 22:45:32 +00:00
Ephraim Atta-Duncan 95a94d4fc1 chore: use single chart graphs 2024-05-21 09:28:23 +00:00
Ephraim Atta-Duncan f363dee761 fix: downloaded files should have _signed 2024-05-07 10:19:09 +00:00
Ephraim Atta-Duncan 50b57d5aa5 fix: minor changes based on review 2024-05-07 09:35:59 +00:00
Ephraim Atta-Duncan 32348dd6f1 fix: pr review changes 2024-04-08 17:26:25 +00:00
Ephraim Atta-Duncan fdf4d03c14 fix: grid on mobile 2024-04-05 17:54:36 +00:00
Ephraim Atta-Duncan 7615c9d2fa feat: add chat to admin dashboard 2024-04-05 17:49:32 +00:00
Ephraim Atta-Duncan ea64ccae29 fix: unnecesary requests 2024-04-05 12:02:05 +00:00
Ephraim Atta-Duncan 81ab220f1e fix: wrap use with suspense
skill issue
2024-03-29 11:14:44 +00:00
Ephraim Atta-Duncan cc60437dcd fix: correct slug 2024-03-29 10:20:09 +00:00
Ephraim Atta-Duncanandmxkaske 171b8008f8 chore: credit
Co-authored-by: mxkaske <maximilian@kaske.org>
2024-03-29 10:15:12 +00:00
Ephraim Atta-Duncan 5c00b82894 chore: add status widget 2024-03-29 10:10:35 +00:00
Ephraim Atta-Duncan f5a1d9a625 fix: monthly count instead of cummulative 2024-03-22 08:08:37 +00:00
Ephraim Atta-Duncan 5289ae2fbc Merge branch 'main' into test/sign-redirect-url 2024-03-21 16:36:48 +00:00
Ephraim Atta-Duncan c4c6e67249 chore: prod playwright config 2024-03-21 16:36:10 +00:00
Ephraim Atta-Duncan 5377d27c6a chore: test for redirect url 2024-03-21 16:28:42 +00:00
Ephraim Atta-Duncan 1cd7dd236b chore: test signing a document 2024-03-21 16:15:29 +00:00
Ephraim Atta-Duncan facafe0997 feat: place card titles in the box 2024-03-21 01:44:32 +00:00
Ephraim Atta-Duncan 8c1686f113 feat: add total signed documents 2024-03-21 01:25:23 +00:00
Ephraim Atta-Duncan a8752098f6 fix: invalid datetime on graph 2024-03-21 00:48:49 +00:00
Ephraim Atta-Duncan 48858cfdd0 chore: restructure open page 2024-03-20 10:31:19 +00:00
Ephraim Atta-Duncan 2facc0e331 feat: add completed documents per month graph 2024-03-20 10:17:31 +00:00
Ephraim Atta-Duncan 0d41c6babf Merge branch 'main' into test/sign-redirect-url 2024-03-08 15:03:21 +00:00
Ephraim Atta-Duncan 9b5346efef chore: add test for multiple recipient 2024-03-08 14:54:18 +00:00
Ephraim Atta-Duncan ff3b49656c chore: remove unused function 2024-03-08 00:07:11 +00:00
Ephraim Atta-Duncan e47ca1d6b6 chore: add e2e test for deleting a user 2024-03-08 00:04:27 +00:00
Ephraim Atta-Duncan 59cdf3203e fix: add seed script to dx setup 2024-03-07 20:09:29 +00:00
Ephraim Atta-Duncan c436559787 feat: create a banner with custom text by admin 2024-02-22 20:20:49 +00:00
Ephraim Atta-Duncan 6ee896048e feat: dialog to enter custom recipients for creating document from template 2024-02-20 19:11:12 +00:00
Ephraim Atta-Duncan 11299d3f92 feat: add custom text to singleplayer 2024-02-17 11:24:47 +00:00
Ephraim Atta-Duncan 9301b8ef4d fix: multiple text fields sharing the same text value 2024-02-17 10:50:19 +00:00
Ephraim Atta-Duncan ad6fad1182 fix: custom text with multiline throwing an error
took me hours
2024-02-17 10:43:22 +00:00
Ephraim Atta-Duncan 5687503dfc feat: sign document with a custom text 2024-02-17 08:26:30 +00:00
Ephraim Atta-Duncan f98567ea87 feat: request usee to disable 2fa before deleting account 2024-02-17 07:34:21 +00:00
Ephraim Atta-Duncan 918e9ddc0b chore: use token input on enable 2fa 2024-02-16 21:20:16 +00:00
Ephraim Atta-Duncan 94eee8b913 chore: change font family 2024-02-16 20:49:52 +00:00
Ephraim Atta-Duncan 345c4b8b14 feat: use pin-input on sign in 2024-02-15 16:00:13 +00:00
Ephraim Atta-Duncan 897f0dabde feat: 2fa pin input component 2024-02-15 14:21:40 +00:00
Ephraim Atta-Duncan fddd860d15 chore: code refactor to avoid repetitions 2024-02-15 11:33:43 +00:00
Ephraim Atta-Duncan 769eaa0ed9 feat: add roles to templates recipients 2024-02-15 07:01:41 +00:00
Ephraim Atta-Duncan 49cddfab38 chore: lint with oxc 2024-02-15 06:11:50 +00:00
Ephraim Atta-Duncan c680cfc24f chore: update pr based on review 2024-02-14 14:55:46 +00:00
Ephraim Atta-Duncan cab875f68a fix: update create delete user sql script 2024-02-14 14:55:46 +00:00
Ephraim Atta-Duncan 30752815e7 feat: soft-delete transfered documents 2024-02-05 13:06:36 +00:00
Ephraim Atta-Duncan 4c09867b55 feat: transfer completed and pending documents to deleted email 2024-02-05 12:47:22 +00:00
Ephraim Atta-Duncan 4d93ed60c5 feat: add deleted account migration 2024-02-05 12:12:02 +00:00
Ephraim Atta-Duncan d598677dc5 feat: add transparent background to fields 2024-02-02 08:36:54 +00:00
Ephraim Atta-Duncan f8125aec54 feat: show fields on other sections 2024-01-30 00:09:22 +00:00
Ephraim Atta-Duncan 4af5ce3a6b chore: remove border color for field item 2024-01-29 01:38:44 +00:00
Ephraim Atta-Duncan 4ae19a9e63 chore: tidy code 2024-01-29 00:59:08 +00:00
Ephraim Atta-Duncan 6d5fe4eea3 fix: show the fields on the document at the subject selection page 2024-01-29 00:47:11 +00:00
Ephraim Atta-Duncan 014c09bd91 fix: account deletion error for users without two factor authentication 2024-01-28 18:43:20 +00:00
Ephraim Atta-Duncan 9e433af112 feat: require 2fa code before account is deleted 2024-01-21 15:38:32 +00:00
Ephraim Atta-Duncan 7762b1db65 feat: add loading to button 2024-01-21 09:47:50 +00:00
Ephraim Atta-Duncan a3e560899a feat: delete user from db and unsubscribe from stripe 2024-01-20 23:30:56 +00:00
Ephraim Atta-Duncan f652ca9b73 feat: account deletion confirmation dialog 2024-01-20 19:07:47 +00:00
Ephraim Atta-Duncan d731532fbf chore: hide empty accordion for documents without date field 2024-01-02 04:58:35 +00:00
Ephraim Atta-Duncan 6a26ab4b2b fix: toast import errors 2024-01-02 04:52:15 +00:00
Ephraim Atta-Duncan b76d2cea3b fix: changes from code review 2024-01-02 04:38:35 +00:00
Ephraim Atta-Duncan 8d1b960aa8 feat: add templates to command menu 2023-12-25 23:16:56 +00:00
Ephraim Atta-Duncan 31a9127c9e feat: templates 2023-12-14 12:24:56 +11:00
Ephraim Atta-Duncan 38ad3a1922 refactor: download function to be reusable 2023-12-07 14:52:12 +00:00
Ephraim Atta-Duncan 0baa2696b4 fix: removed unused code 2023-12-05 10:13:24 +00:00
Ephraim Atta-Duncan 741201822a fix: use useSession instead of prop drilling 2023-12-05 10:12:28 +00:00
Ephraim Atta-Duncan 0e40658201 feat: track when the signing of a document has completed 2023-11-26 19:33:45 +00:00
Ephraim Atta-Duncan d347359d2f chore: changes from code review 2023-11-25 22:09:52 +00:00
Ephraim Atta-Duncan fdf5b3908d feat: add more posthog analytics to the application 2023-11-24 23:50:51 +00:00
Ephraim Atta-Duncan b4f1a5abce feat: handle download file error with toast 2023-11-16 07:11:23 +00:00
Ephraim Atta-Duncan e556db0386 docs: add render one click deploy for refresh 2023-11-06 13:02:18 +11:00
Ephraim Atta-Duncan 0aaf65266e docs: clearer readme? maybe? 2023-11-06 13:01:46 +11:00
Ephraim Atta-Duncan e14f96485c fix: update for code review 2023-11-06 13:01:45 +11:00
Ephraim Atta-Duncan c107608aeb chore: remove undefined check 2023-11-06 13:01:45 +11:00
Ephraim Atta-Duncan 34ce0d084e chore: refactor function 2023-11-06 13:01:45 +11:00
Ephraim Atta-Duncan 127dc42dc5 feat: add dropdown to tweet or copy signing link 2023-11-06 13:01:45 +11:00