Repository navigation
fix(content): go straight to Send when Before you publish has nothing to ask, and fold the JSON-LD away - #1622
Conversation
…nothing to ask, and fold its code away there Sending a page took three steps: the paper plane, Before you publish with a block of JSON-LD code, Continue to send, and only then the Send dialog. The code is for pasting into a page; a page sent to a CMS goes there whole, and the code only matters for a CMS that doesn't write it. - On Send to CMS, Before you publish opens only when it has something to ask about: Trust under 60, a row missing (an author, a disclosure, a product's price, placeholders, alt text, broken links), or links, claims or the page still being read. Otherwise the Send dialog opens at once. Mark ready and Export open it as before. - There, its JSON-LD is folded behind "Show the JSON-LD, for a CMS that doesn't add it"; Copy JSON-LD stays. The send-to-cms guide says so. Folding Before you publish into the Send dialog itself is a larger change, left for its own PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fold its code with one button, and continue once Review fixes for going straight to the Send dialog: - The skip waited for nothing to be missing, but a row not read yet isn't missing: Trust not read (its inputs still loading), the authors not read (E-E-A-T null) or a category's products still being read skipped too. It now goes straight on only once Trust, the authors and the products are read, as well as the links, claims and page. A Trust read with no score (no figure or dated source to score) has nothing to ask. - The skip calls onContinue once: StrictMode runs the effect twice, and the Send dialog opened twice. - "Show the JSON-LD…" opens and folds the code (aria-expanded, aria-controls) and takes the focus to the code it opens. - The headline/name left out warning stays outside the folded code: the code that goes or is copied still leaves it out. - Tests for each; the page test reads the brand's domains so Trust is read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good, with follow-ups.
The skip is decided once when the dialog mounts and runs once under StrictMode. It waits for Trust, the authors, a category's products, links still being read, claims and the page read. The JSON-LD fold gets aria-expanded/aria-controls, moves focus to the code, and keeps the headline warning outside the fold. Mark ready and Export are unchanged. With _before-publish.tsx put back to main's, 5 of the new tests fail. The main merge (d8331bbf) adds the shopping-links wait and its test, and nothing else.
Follow-ups:
-
(medium) Some unknown states still skip. The PR says it never skips on unknown state, but three cases go straight to Send without the row the dialog would show:
- The shopping check's first read is still out.
_draft-editor.tsx:3181maps a check that is still'reading'(never read yet) toshopping = null. So clicking Send on a shop draft right after it opens skips the sold-out check thatopenBeforePublishasks for fresh. - The check failed.
shopping === 'failed'is a "check" row, notmissing, so it doesn't stop the skip. - A category's products are unknown, or some links couldn't be read.
category.status === 'unknown', andpaste.linksUnread > 0oncelinksPendingis 0, are also "check" rows.
Fix: in the
skippedcondition (_before-publish.tsx:377), also ask onshopping === 'failed',category?.status === 'unknown'andpaste.linksUnread > 0. Have the editor pass'reading'while the first check is out, notnull. - The shopping check's first read is still out.
-
(low) A test for the first case: a shop draft whose check hasn't come back, where Send opens Before you publish first.
Tests: _before-publish.test.tsx (35) and the editor's Send/Before you publish tests pass. "takes one click while it saves" timed out once in a run under load and passes on its own, as on main.
Before the API deploy: web only, works on merge.
Summary
Sending took three steps, and the JSON-LD code block sat in the way on the send path.
In send mode, Before you publish opens only when it has something to ask:
The JSON-LD:
aria-expanded; focus moves to the code when it opens. Copy JSON-LD stays.Mark ready and Export are unchanged. Merged with main (
d8331bbf) for #1610's shopping row; the merge adds the shopping-links wait.Related issue
None. From Ansvisor’s production test of the Content Editor and Send to CMS (2026-10-27).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run "src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx"Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Checked together with the other PRs from the same test (one integration tree of all eleven on main 3f6a4d4):
server/:npm run format,npm run lintandnpm test(3,349 tests).web/:yarn format,yarn lint(0 errors, the 7 earlier warnings),yarn typecheck,yarn test(4,385 tests) andyarn build.Follow-up: merging Before you publish and Send into one dialog is a larger change, left out on purpose.
🤖 Generated with Claude Code