MBTI-PDF-RESULT-SNAPSHOT-VISUAL-PAGINATION: polish MBTI print snapshot pagination#1506
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ab41016f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "components/result/mbti/clone/MbtiDesktopCloneShell.tsx", | ||
| "components/layout/SiteHeader.tsx", | ||
| ]) { | ||
| expect(isMbtiResultPagePdfVisualPaginationAllowedFile(file), file).toBe(false); |
There was a problem hiding this comment.
Make visual scope check branch-aware
In CI on main or any branch other than codex/mbti-pdf-result-snapshot-visual-pagination, isMbtiResultPagePdfVisualPaginationAllowedFile returns true for every file, so this new assertion expects false but receives true after the PR is merged; running this test with GITHUB_REF_NAME=main reproduces the failure, which will break the contract suite on main. Mirror the branch-aware expectation used in the updated smoke gate test or change the helper semantics.
Useful? React with 👍 / 👎.
| .pageGrid { | ||
| display: block; | ||
| margin-top: 7mm; |
There was a problem hiding this comment.
Move print rules after mobile overrides
For A4 print output the later @media (max-width: 860px) rules in this same stylesheet still match and come after this new print block, so they override key dense-report settings such as .pageGrid { display: block; } back to the mobile flex-column layout, along with hero sizing/padding. In the PDF snapshot route this means the intended A4 pagination styles are not the final computed styles; put the print block after the responsive rules or limit the mobile query to screen media.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 103f369e8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| data-private-result-print-root="true" | ||
| data-gotenberg-result-print-root="true" | ||
| data-pdf-mode="true" | ||
| data-pdf-layout="a4-report-dense" |
There was a problem hiding this comment.
Forward the dense PDF marker to the DOM
On the private print route, this marker is applied to Container, but components/layout/Container.tsx destructures only as, className, and children and never spreads other props onto the rendered element. As a result no data-pdf-layout/data-pdf-mode attributes reach the <main>, so the new global rules in app/globals.css keyed by [data-pdf-mode][data-pdf-layout] never match in Gotenberg/browser print output; the A4 page setup and visual version contract are only present in source text. Render a real element or forward the data props before relying on these selectors.
Useful? React with 👍 / 👎.
What changed
MBTI-PDF-RESULT-SNAPSHOT-VISUAL-PAGINATIONPR-train entry and reconciled merged PR-D state./printroute withdata-pdf-layout="a4-report-dense"anddata-pdf-visual-version="mbti-result-snapshot-a4-v1".Why
PR-A/B/C/D made the v3 MBTI result-page PDF route correct, content-real, pollutant-free, and smoke-gated. This PR starts the visual/report layer: A4 sizing, dense formal report spacing, and print pagination guards without changing backend routing, content authority, runtime shell cleanup, or live PDF smoke automation.
Validation
pnpm exec vitest run tests/contracts/mbti-result-page-pdf-visual-pagination.contract.test.ts tests/contracts/mbti-result-page-pdf-smoke-quality-gate.contract.test.ts tests/contracts/result-private-print-chrome.contract.test.ts tests/contracts/mbti-desktop-shell-cta.contract.test.tsxpnpm test:contractpnpm typecheckNEXT_PUBLIC_API_URL=https://api.fermatmind.com pnpm buildruby -e "require 'yaml'; YAML.load_file('docs/codex/pr-train.yaml'); puts 'yaml ok'"python3 -m json.tool docs/codex/pr-train-state.json >/dev/nullgit diff --checkIntentionally deferred
Repository rule impact
This is frontend product-code-only print rendering work for a private result snapshot route. It does not move content authority into fap-web, does not add frontend editorial fallback content, and does not affect CMS-backed public content enumeration.