Add /display Finish footer with co-equal Save Deck/Print + save-before-PDF draft backup (#275) - #306
Merged
Conversation
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.
Summary
Implements issue #275 (proposal-h-display-layout-spec.md ADDENDUM D9/D10): the /display right-rail Finish footer and the save-before-PDF hard constraint ("save deck should come before PDF completes because we have to rely on clients available mem for the PDF").
btn-primarybuttons (Save Deck,Print / Export →) plus the unchangedExport ▾, and a compact "✓ Draft backed up locally" note. Anonymous sessions get a "Sign in to Save" link in place of Save Deck (server save is authenticated-only by construction).localStoragemirror of the working project (indexes/settings only, never image pixels — the governing "we index, we do not store images" premise applied to this browser's own disk). Offers a restore nudge on the empty-project landing when a prior session's draft outlives an emptied project, and fires the D9(2) promotion nudge post-import (reusing the existing Toasts system, no new UI surface).SavedDeckPanel.tsx's own passphrase-setup/unlock/save modal chain so the footer's Save Deck button and the pre-print gate's Save choice reuse it without forking;SavedDeckPanel.tsxitself now rides the same hook, unchanged behavior.FinishedMyProject, mirroringpages/myDecks.tsx./display's own inline PDF export pipeline (Item 2'suseDownloadPDF/useSaveToDrivePDF/ImageFailureConfirmModal/fetch-progress bar) is removed outright — PDF generation now lives solely on this Print page.Deviations from spec (documented, not silently accepted)
pages/print.tsxmountsFinishedMyProjectunchanged. Tracked as its own follow-up in the spec doc./display's own Page Setup controls (paper size/bleed edge/guides — plain component state) don't carry over to the Print page's classicPDFGenerator, which has always had separate settings and doesn't read this page's margin-profile/card-spacing redux slices either. Out of scope for D9/D10 (save-vs-print ordering + route linkage, not settings portability) — documented in the spec doc and inDisplayPage.tsx's own module comment.PDFGenerator.spec.tsalready covers the underlying pipeline mechanics unchanged.PostExportContributionPrompt.spec.ts's "- /display" describe block removed for the same reason; its "classic Print! tab" block is untouched.useProjectDraftBackup.ts/pages/print.tsxnow that both files exist — lint passes naturally.Test plan
tsc --noEmitcleannpx eslintclean on all touched filesnpx prettier@2.7.1 --checkclean on all touched filesuseProjectDraftBackup.test.tsx(8 tests: empty-project no-op, flush writes indexes/settings only, debounced auto-write, restore-nudge surfacing, restore rehydration, dismiss-without-delete, post-import + pre-print promotion nudges) + full existing suite (59 suites / 504 tests, all green, includingSavedDeckPanel.test.tsxunchanged after theuseSaveDeckFlowextraction)DisplayFinishFooter.spec.ts(5 tests covering the full journey — anonymous sign-in-link + direct navigation, authenticated Save Deck button + draft-backed-up note, the full save-gate→unlock→SaveDeckModal→Print-page journey, Skip→Print-page, and the restore-nudge round trip) +PostExportContributionPrompt.spec.ts+DisplayPage.spec.ts+SavedDecks.spec.tsall green (four intermittent failures seen once under 4-worker parallel load —DisplayPage.spec.ts's own pre-existing phone-viewport scroll test plus three others — all confirmed to pass in isolation/on rerun; unrelated to this change, not touched by this PR)Open items
/displayusage documentation (if any exists) needs a note that the finish footer changed — flagging for the merge-time checklist since this is user-visible.🤖 Generated with Claude Code