MBTI-PDF-RESULT-SNAPSHOT-CONTENT-06: inject snapshot desktop clone content#1503
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5aa588f8a1
ℹ️ 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".
| if (normalized === "en" || normalized === "en-us") { | ||
| return "en"; | ||
| } |
There was a problem hiding this comment.
Scope English CMS fetch to updated contracts
This new English branch makes fetchPersonalityDesktopCloneContent("INFJ-A", "en") hit /desktop-clone?locale=en, but the existing API contract still requires non-zh locales to return null without any network call and normalizeDesktopCloneApiLocale("en") to stay null. I verified this with ./node_modules/.bin/vitest run tests/contracts/personality-desktop-clone-api.contract.test.ts tests/contracts/mbti-desktop-storage-cutover.contract.test.ts, which fails at tests/contracts/personality-desktop-clone-api.contract.test.ts:623 and :717; because pnpm test:contract runs the whole contracts directory, CI remains broken unless these contracts are updated or English fetching is isolated from the existing public adapter contract.
Useful? React with 👍 / 👎.
| const isZh = locale === "zh"; | ||
| const language = isZh ? "zh" : "en"; | ||
| const content = isZh ? storageContent : null; | ||
| const content = storageContent; |
There was a problem hiding this comment.
Preserve normal English resolver fallback
Dropping the zh-only guard here means any normal resolver call with locale: "en" and storageContent now returns meta.contentSource === "storage" and renders authored desktop-clone slots, even though the existing storage-cutover contract still asserts English remains on the placeholder/null path outside the snapshot flow. The same verified contract run fails at tests/contracts/mbti-desktop-storage-cutover.contract.test.ts:482, so pnpm test:contract/verify:pr will fail unless this storage adoption is made snapshot-only or the cutover contract is deliberately updated.
Useful? React with 👍 / 👎.
5aa588f to
0cf87e4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0cf87e485e
ℹ️ 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".
| zhTitle: "你可能会喜欢的职业选择", | ||
| source: null, | ||
| fallback: MBTI_DESKTOP_CLONE_PLACEHOLDER_SLOTS_ZH.chapters.career.lockedBlocks[0], | ||
| fallback: slots.chapters.career.lockedBlocks[0], |
There was a problem hiding this comment.
Keep locked teaser fallbacks redacted outside snapshots
For a locked zh result after desktop-clone storage loads through the normal MbtiResultShell path, this now feeds CMS lockedBlocks into MbtiClonePremiumTeaserBlock; that component renders each blurredItems title/body into the DOM and only applies CSS blur, so any non-redacted locked preview items returned by the API become extractable to users who have not unlocked the report. Before this change the locked chapter teasers always used the local placeholder blocks, so the storage-backed locked copy was not exposed on ordinary /result pages; keep these fallbacks placeholder/redacted unless the render is the strict snapshot path.
Useful? React with 👍 / 👎.
Summary
/printbootstrap and pass it into the snapshot render tree./result/{id}behavior on the existing client-side desktop clone fetch path.Contract Answers
/api/v0.5/personality/{type}/desktop-clone./printroute server-prefetches desktop clone content: yes, after report-access/report bootstrap derives the MBTI fullCode.PDF_READY.data-pdf-content-ready="true".DESKTOP_CLONE_CONTENT_MISSING; no zh-CN or placeholder fallback./resultpage behavior should remain unchanged.Validation
./node_modules/.bin/vitest run tests/contracts/mbti-desktop-clone-snapshot-content.contract.test.ts tests/contracts/result-client-view-state.contract.test.tsx tests/contracts/result-gotenberg-print-route.contract.test.ts./node_modules/.bin/vitest run tests/contracts/mbti-desktop-storage-cutover.contract.test.ts tests/contracts/personality-desktop-clone-api.contract.test.tspnpm test:contractpnpm typecheckgit diff --checkDeferred