Add escape route and resend-link CTA to all /sign/[token] error states#2
Open
keywise-app wants to merge 1 commit into
Open
Add escape route and resend-link CTA to all /sign/[token] error states#2keywise-app wants to merge 1 commit into
keywise-app wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal: Add escape route and resend-link CTA to all /sign/[token] error states
Severity: high · Route: /sign/[token]
Friction
app/sign/[token]/page.tsxhandles three terminal error states —expired,error(invalid link), andalready_signed. Theexpiredstate reads: "This signing link has expired. Please contact your landlord to request a new link." Theerrorstate reads the rawerrorMsgstring. 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:expired— Add a teal "Request a new link" button thatmailto:s the landlord's email (if available fromdocData) with a pre-filled subject line: "Please resend my signing link for [document_name]." Fall back tomailto:hello@keywise.appif no landlord email. Add a secondary← Go to tenant portallink pointing to/tenant.error— Replace rawerrorMsgdump with: "Something went wrong with this link. [raw message in a smaller muted line below]" + same two actions as above.already_signed— This state is benign but currently offers no next step. Add a← Go to tenant portallink 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 portallink. Updated body copy to "Your landlord can send you a new one." (more direct than the previous passive phrasing).error: Replaced the rawerrorMsgdump with a plain-English headline ("Something went wrong") + a smaller muted line for the technical message below it. Added the same two CTAs asexpired.already_signed: Added← Go to tenant portallink so tenants have somewhere to go after confirming their signature.Also:
landlord_email?: stringto thedocDatatype (the field isn't returned by the current API, so it gracefully falls back tohello@keywise.app— a future API change can populate it without touching the page).landlordEmail,documentName, andresendMailtoas 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 statesNotes
app/api/sign-document/route.tsGET handler doesn't currently returnlandlord_emailin its response. The fallback tohello@keywise.appis intentional per the proposal spec. Populatinglandlord_emailfrom the API would require a DB join ondocuments.user_id → profiles.emailin the GET path — a separate, small follow-up that doesn't require a migration.already_signedstate doesn't have docData populated (it's set beforesetDocDatais called), so the resend mailto for that state would always use the fallback. Sincealready_signedis benign (not an error), a portal link is sufficient — matching the proposal's spec for that state exactly.