Skip to content

Add escape route and resend-link CTA to all /sign/[token] error states#2

Open
keywise-app wants to merge 1 commit into
mainfrom
cpo/proposal-22443ada
Open

Add escape route and resend-link CTA to all /sign/[token] error states#2
keywise-app wants to merge 1 commit into
mainfrom
cpo/proposal-22443ada

Conversation

@keywise-app
Copy link
Copy Markdown
Owner

Proposal: Add escape route and resend-link CTA to all /sign/[token] error states
Severity: high · Route: /sign/[token]


Friction
app/sign/[token]/page.tsx handles three terminal error states — expired, error (invalid link), and already_signed. The expired state reads: "This signing link has expired. Please contact your landlord to request a new link." The error state reads the raw errorMsg string. Neither state provides a navigation link. The tenant is stranded on a dead-end screen with no path forward inside the product. Buildium's rent_renewal stub shows "undo button on every step" and "escape route" as baseline expectations; our signing failure states offer neither. This happens every time a magic-link email is opened after expiry or forwarded — a common real-world case.

Proposed change
In app/sign/[token]/page.tsx, update the three error state cards:

  1. expired — Add a teal "Request a new link" button that mailto:s the landlord's email (if available from docData) with a pre-filled subject line: "Please resend my signing link for [document_name]." Fall back to mailto:hello@keywise.app if no landlord email. Add a secondary ← Go to tenant portal link pointing to /tenant.

  2. error — Replace raw errorMsg dump with: "Something went wrong with this link. [raw message in a smaller muted line below]" + same two actions as above.

  3. already_signed — This state is benign but currently offers no next step. Add a ← Go to tenant portal link so the tenant can navigate to their portal rather than closing the browser.

Why this matters
Sharpens Principle 5 — Error Recovery: when things fail, the user is never stuck — plain-English error + clear next step + escape route to a known-good screen. Current implementation fails all three sub-criteria. Estimated impact: eliminates a complete dead-end for every tenant with an expired or invalid signing link — a flow that generates support tickets and erodes tenant confidence in the landlord's tooling.


What I changed

Updated the three error state cards in app/sign/[token]/page.tsx:

  • expired: Replaced the dead-end message with a teal "Request a new link" mailto: button (pre-filled subject line using document name) + a secondary ← Go to tenant portal link. Updated body copy to "Your landlord can send you a new one." (more direct than the previous passive phrasing).
  • error: Replaced the raw errorMsg dump with a plain-English headline ("Something went wrong") + a smaller muted line for the technical message below it. Added the same two CTAs as expired.
  • already_signed: Added ← Go to tenant portal link so tenants have somewhere to go after confirming their signature.

Also:

  • Added landlord_email?: string to the docData type (the field isn't returned by the current API, so it gracefully falls back to hello@keywise.app — a future API change can populate it without touching the page).
  • Extracted landlordEmail, documentName, and resendMailto as shared constants above the JSX so the two error cards share identical CTA behavior.

Files touched

  • app/sign/[token]/page.tsx — added escape routes and resend CTAs to all three error states

Notes

  • The app/api/sign-document/route.ts GET handler doesn't currently return landlord_email in its response. The fallback to hello@keywise.app is intentional per the proposal spec. Populating landlord_email from the API would require a DB join on documents.user_id → profiles.email in the GET path — a separate, small follow-up that doesn't require a migration.
  • The already_signed state doesn't have docData populated (it's set before setDocData is called), so the resend mailto for that state would always use the fallback. Since already_signed is benign (not an error), a portal link is sufficient — matching the proposal's spec for that state exactly.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

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

Project Deployment Actions Updated (UTC)
keywise Ready Ready Preview, Comment May 16, 2026 9:23pm

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