Skip to content

MBTI-PDF-RESULT-SNAPSHOT-VISUAL-PAGINATION: polish MBTI print snapshot pagination#1506

Merged
fermatmind merged 4 commits into
mainfrom
codex/mbti-pdf-result-snapshot-visual-pagination
Jul 1, 2026
Merged

MBTI-PDF-RESULT-SNAPSHOT-VISUAL-PAGINATION: polish MBTI print snapshot pagination#1506
fermatmind merged 4 commits into
mainfrom
codex/mbti-pdf-result-snapshot-visual-pagination

Conversation

@fermatmind

Copy link
Copy Markdown
Owner

What changed

  • Added the MBTI-PDF-RESULT-SNAPSHOT-VISUAL-PAGINATION PR-train entry and reconciled merged PR-D state.
  • Marked the v3 private result /print route with data-pdf-layout="a4-report-dense" and data-pdf-visual-version="mbti-result-snapshot-a4-v1".
  • Added scoped A4 print setup plus print-only MBTI clone density, hero, card, typography, and page-break guards.
  • Added a focused visual-pagination contract and updated scope helper coverage.
  • Made the prior PR-D smoke scope contract branch-aware so it remains strict on the PR-D branch but does not block later PR-train branches.

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.tsx
  • pnpm test:contract
  • pnpm typecheck
  • NEXT_PUBLIC_API_URL=https://api.fermatmind.com pnpm build
  • ruby -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/null
  • git diff --check
  • changed-file scope validation

Intentionally deferred

  • No backend / fap-api changes.
  • No deploy, server reload, cache clear, DB/CMS/search/queue writes, or env changes.
  • No content import or content asset edits.
  • No live production PDF smoke required; PR-D operator smoke remains optional.
  • No final pixel-perfect PDF review or checked-in PDF artifacts/screenshots.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +1844 to +1846
.pageGrid {
display: block;
margin-top: 7mm;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@fermatmind fermatmind merged commit 002cf62 into main Jul 1, 2026
6 checks passed
@fermatmind fermatmind deleted the codex/mbti-pdf-result-snapshot-visual-pagination branch July 1, 2026 04:19
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