Skip to content

feat: support RedirectUrl countdown & auto-redirect after document decline#2221

Open
ahmdjunaid wants to merge 1 commit into
OpenSignLabs:stagingfrom
ahmdjunaid:feature/redirect-after-decline
Open

feat: support RedirectUrl countdown & auto-redirect after document decline#2221
ahmdjunaid wants to merge 1 commit into
OpenSignLabs:stagingfrom
ahmdjunaid:feature/redirect-after-decline

Conversation

@ahmdjunaid

Copy link
Copy Markdown

Summary of Changes

This PR extends the RedirectUrl functionality so that signers are automatically redirected to the configured RedirectUrl after declining a document, matching the existing post-signing redirect behavior.

1. Post-Decline Auto Redirect & Countdown Timer
Updated declineDoc() in PdfRequestFiles.jsx to trigger the 5-second countdown timer when a document has a RedirectUrl configured.
Inlined the live countdown notice box (RedirectNotice) inside PdfDeclineModal so signers see a real-time countdown ("Redirecting you in 5 seconds...") with a Cancel option.
Formatted RedirectUrl to automatically prepend https:// if protocol prefix is missing.
Used window.location.href for direct navigation to prevent browser popup blockers from blocking the delayed redirect.
2. Decline Modal UI Refinements
Formatted header title to display Decline "Document Name" dynamically during decline prompt, and Document declined after completion.
Maintained standard OpenSign theme styling (op-btn-primary, op-btn-ghost, clean theme typography).
Formatted container to a compact max-w-[440px] modal box for optimal visual balance across all screen sizes.

Files Changed
apps/OpenSign/src/pages/PdfRequestFiles.jsx: Trigger redirect countdown timer upon decline API success; render live countdown box in decline modal; format protocol prefix.
apps/OpenSign/src/primitives/PdfDeclineModal.jsx: Refine modal box width, title typography, and standard theme button hierarchy.

How to Test
Create a document with a RedirectUrl set (e.g. https://google.com).
Open the recipient signing link.
Click Decline and enter a reason.
Verify:
Header title shows Decline "".
Modal displays live countdown notice: "Redirecting you in 5 seconds...".
Timer counts down (5 → 4 → 3 → 2 → 1 → 0) and redirects to https://google.com.
Clicking Cancel halts the redirect.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@ahmdjunaid is attempting to deploy a commit to the prafull 's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant