Repository navigation
Preview shows the agreement as drafted, and saves it as a PDF - #4
Merged
Merged
Conversation
Design v2's preview drawer (the Preview button on the Text and Data steps) opened onto an empty page, and its PDF button did nothing: upstream left both as placeholders. It now shows the store's agreementHtml -- the text, model and data drafted, rebuilt on every edit, sanitized as the legacy layout's preview is -- or, while the template does not draft, why not; and PDF saves that page (html2pdf, loaded on first use), as the legacy layout's download does. Tests: PreviewDrawer's three states (drafted and sanitized, not drafted with the reason and no PDF, drafting); e2e opens the pay request's preview and downloads agreement.pdf. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
The Preview button on the Text and Data steps opened a drawer with an empty page, and its ↓ PDF button did nothing. Upstream's design-v2 left both as placeholders: the drawer body was an empty
<div className="nd-preview-page" />.Now:
agreementHtml: the text, model and data merged, and rebuilt on every edit, so the preview is live. It's sanitized with DOMPurify, as the legacy layout's preview is.agreement.pdf(A4), the same way the legacy layout's download does.html2pdfis loaded on first use.Tests:
PreviewDrawer.test.tsxcovers its three states:agreement.pdf.This is independent of #3; either can merge first.
🤖 Generated with Claude Code