Skip to content

fix: improve field signing - #2830

Merged
dguyen merged 2 commits into
mainfrom
fix/various-signing-page-improvements
Jun 1, 2026
Merged

dguyen merged 2 commits into
mainfrom
fix/various-signing-page-improvements

Conversation

@dguyen

@dguyen dguyen commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Resolves some issues to make the signing process smoother:

  1. Fix issue where overflowing text covers another field, preventing users from signing
  2. Fix spinner not showing for signatures
  3. Fix spinner disappearing when another field is signed

Signature Fields

Before

signatures-before.mov

After

signatures-after.mov

Text Fields

Before

before-normal-fields.mov

After

sig-final.mov

Copilot AI review requested due to automatic review settings May 18, 2026 07:05
@vercel

vercel Bot commented May 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stg-docs Ready Ready Preview, Comment Jun 1, 2026 8:19am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
prd-docs Ignored Ignored Jun 1, 2026 8:19am
prd-openpage-api Ignored Ignored Jun 1, 2026 8:19am

Request Review

@coderabbitai

coderabbitai Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7c0c14b-4c24-4197-b43d-9a3b2417c0c2

📥 Commits

Reviewing files that changed from the base of the PR and between 1aa3ba7 and 6b30470.

📒 Files selected for processing (1)
  • apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx
💤 Files with no reviewable changes (1)
  • apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx

📝 Walkthrough

Walkthrough

Envelope signing component syncs fullName/email/signature into refs for Konva handlers, modernizes multiple field click handlers, refactors signature auth/update flow, caches rendered fields with conditional re-renders and hit-detection rules, and disables event listening on specific Konva nodes.

Changes

Konva Event Handling and Field Rendering

Layer / File(s) Summary
Ref-based state synchronization
apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx
Adds useRef mirrors for fullName, email, and signature, keeps them in sync via effect, and switches Konva handler reads and placeholder resolution to use the refs.
Field click handler modernization
apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx
Checkbox, number, text, email, initials, name, and dropdown click handlers now call their helpers with void to avoid awaiting in event handlers.
Signature handler and auth flow
apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx
Signature click flow now receives fullName.current and signature.current; executeActionAuthProcedure and spinner teardown were reordered so reauth signing runs before setting signature state when a value payload is returned.
Render caching and hit-detection
apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx
renderFields() is cache-aware (re-renders only missing/changed fields), updates cachedRenderFields, disables hit detection for other recipients' display-only fieldGroups, and clears cache when pending-tooltip toggles or selected assistant recipient changes.
Konva event listening isolation
packages/lib/universal/field-renderer/field-generic-items.ts, packages/lib/universal/field-renderer/render-dropdown-field.ts, packages/lib/universal/field-renderer/render-generic-text-field.ts, packages/lib/universal/field-renderer/render-signature-field.ts
Set listening: false on spinner group, dropdown text/arrow, generic text nodes, and signature image/label nodes to prevent those shapes from intercepting pointer events.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • Mythie
  • catalinpit
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: improve field signing' is concise and directly summarizes the main objective—improving the field signing process through multiple bug fixes related to text overflow, spinner visibility, and state management.
Description check ✅ Passed The description clearly relates to the changeset by outlining three specific issues being resolved (text overflow blocking signing, spinner visibility for signatures, spinner persistence) and provides before/after visual evidence of the fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/various-signing-page-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the apps: web Issues related to the webapp label May 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions for pull request titles! 💚🚀

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes several UX issues in the envelope signing flow: overflowing field text intercepts pointer events on neighboring fields, signature spinner not displaying due to a fire-and-forget auth procedure, and concurrent signing wiping out in-progress spinners because every field on the page was re-rendered on every state change.

Changes:

  • Mark text/image/spinner Konva nodes (and other-recipient field groups) as non-listening so they don't intercept clicks meant for adjacent fields.
  • In the signature click handler, await executeActionAuthProcedure so the spinner remains visible until auth + signing complete (and use void to silence floating-promise lint).
  • Cache rendered fields by inserted/customText and switch state values (fullName/email/signature) to refs so unrelated state changes don't re-render every field (which was destroying spinners attached to in-flight signing operations).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx Refs for signing state, per-field render cache, await auth procedure for spinner visibility, disable listening on other-recipient fields.
packages/lib/universal/field-renderer/render-signature-field.ts Set listening: false on signature image and label text nodes.
packages/lib/universal/field-renderer/render-generic-text-field.ts Set listening: false on the field text node.
packages/lib/universal/field-renderer/render-dropdown-field.ts Set listening: false on dropdown selected-text and arrow nodes.
packages/lib/universal/field-renderer/field-generic-items.ts Set listening: false on the loading spinner group.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx (2)

448-474: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Cache or guard the other-recipient render loop too.

renderFields() now skips unchanged active-recipient fields, but this branch still re-renders every display-only field on every local sign/update. On pages with many completed fields, that keeps the read-only Konva work on the hot path. Guard these groups with findOne() or a second cache before calling renderField().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx`
around lines 448 - 474, The loop over localPageOtherRecipientFields re-renders
every other-recipient field each update; add a cache or guard using Konva group
lookup (e.g., pageLayer.current.findOne()) before calling renderField to skip
creating a new group for fields that already exist. Specifically, in the block
iterating localPageOtherRecipientFields, check for an existing rendered node by
a stable selector (renderId or field.id) via pageLayer.current.findOne(...) or
maintain a simple Map cache keyed by field.id; if found, update only
hit-detection (call listening(false) on the existing group) and continue,
otherwise call renderField(...) and then set listening(false) on the newly
created fieldGroup and store it in the cache.

222-231: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add .catch() to handle rejections from signField() in these promise chains.

signField() rethrows after showing the error toast (line 497), so these discarded promise chains without a terminal .catch() will surface unhandled rejections. The .finally() alone does not suppress the rejection.

Update all async branches in this match to include .catch(() => undefined) before .finally(). Also note the DROPDOWN field (lines 345–372) calls destroy() both inside .then() and in .finally()—verify this double cleanup is intentional.

Applies to: 222–231, 249–254, 260–269, 275–284, 290–303, 311–320, 326–339, 345–372, 375–407

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx`
around lines 222 - 231, The promise chains that call async handlers like
handleCheckboxFieldClick(...) then call signField(field.id, payload) currently
end with .finally() but no .catch(), which allows rethrown errors from
signField() to become unhandled rejections; update each chain (e.g. the chain
starting at handleCheckboxFieldClick(...) that adds/loadingSpinnerGroup and
calls signField) to insert a terminal .catch(() => undefined) before .finally()
so rejections are swallowed after signField already handled UI toasts. Do the
same for every branch mentioned (the chains handling DROPDOWN and other field
types between lines noted) and while updating the DROPDOWN branch verify/remove
the duplicate cleanup so loadingSpinnerGroup.destroy()/any group.destroy() is
only called once (avoid destroying the same group both inside .then() and again
in .finally()).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx`:
- Around line 448-474: The loop over localPageOtherRecipientFields re-renders
every other-recipient field each update; add a cache or guard using Konva group
lookup (e.g., pageLayer.current.findOne()) before calling renderField to skip
creating a new group for fields that already exist. Specifically, in the block
iterating localPageOtherRecipientFields, check for an existing rendered node by
a stable selector (renderId or field.id) via pageLayer.current.findOne(...) or
maintain a simple Map cache keyed by field.id; if found, update only
hit-detection (call listening(false) on the existing group) and continue,
otherwise call renderField(...) and then set listening(false) on the newly
created fieldGroup and store it in the cache.
- Around line 222-231: The promise chains that call async handlers like
handleCheckboxFieldClick(...) then call signField(field.id, payload) currently
end with .finally() but no .catch(), which allows rethrown errors from
signField() to become unhandled rejections; update each chain (e.g. the chain
starting at handleCheckboxFieldClick(...) that adds/loadingSpinnerGroup and
calls signField) to insert a terminal .catch(() => undefined) before .finally()
so rejections are swallowed after signField already handled UI toasts. Do the
same for every branch mentioned (the chains handling DROPDOWN and other field
types between lines noted) and while updating the DROPDOWN branch verify/remove
the duplicate cleanup so loadingSpinnerGroup.destroy()/any group.destroy() is
only called once (avoid destroying the same group both inside .then() and again
in .finally()).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e3bfdef0-3587-4663-aa17-619a6302834c

📥 Commits

Reviewing files that changed from the base of the PR and between 8f6be47 and 1aa3ba7.

📒 Files selected for processing (5)
  • apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx
  • packages/lib/universal/field-renderer/field-generic-items.ts
  • packages/lib/universal/field-renderer/render-dropdown-field.ts
  • packages/lib/universal/field-renderer/render-generic-text-field.ts
  • packages/lib/universal/field-renderer/render-signature-field.ts

@roshboi roshboi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dguyen
dguyen merged commit c50a01d into main Jun 1, 2026
9 checks passed
@dguyen
dguyen deleted the fix/various-signing-page-improvements branch June 1, 2026 09:48

This branch was successfully deployed

1 active deployment
Preview – stg-docs — 6b304709 Deployed Jun 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps: web Issues related to the webapp coderabbit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants