Skip to content

fix(content): go straight to Send when Before you publish has nothing to ask, and fold the JSON-LD away - #1622

Merged
gkhngyk merged 3 commits into
ansvisor:mainfrom
cihan-gyk:fix/send-skip-clear-checks
Oct 28, 2026
Merged

gkhngyk merged 3 commits into
ansvisor:mainfrom
cihan-gyk:fix/send-skip-clear-checks

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

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:

  • It's behind "Show the JSON-LD…", a disclosure with aria-expanded; focus moves to the code when it opens. Copy JSON-LD stays.
  • The "headline left out" warning stays visible outside the fold.

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 feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. cd web && yarn vitest run "src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx"
  2. On a page with nothing to fix and Trust read, Send to CMS opens Send directly; on one with Trust under 60, Before you publish opens first.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

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 lint and npm test (3,349 tests).
  • web/: yarn format, yarn lint (0 errors, the 7 earlier warnings), yarn typecheck, yarn test (4,385 tests) and yarn build.
  • This branch's own tests were also run on it alone.

Follow-up: merging Before you publish and Send into one dialog is a larger change, left out on purpose.

🤖 Generated with Claude Code

cihan-gyk and others added 3 commits October 27, 2026 23:43
…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]>
@mintlify

mintlify Bot commented Oct 28, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit d8331bb.

Approve preview

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:

  1. (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:3181 maps a check that is still 'reading' (never read yet) to shopping = null. So clicking Send on a shop draft right after it opens skips the sold-out check that openBeforePublish asks for fresh.
    • The check failed. shopping === 'failed' is a "check" row, not missing, so it doesn't stop the skip.
    • A category's products are unknown, or some links couldn't be read. category.status === 'unknown', and paste.linksUnread > 0 once linksPending is 0, are also "check" rows.

    Fix: in the skipped condition (_before-publish.tsx:377), also ask on shopping === 'failed', category?.status === 'unknown' and paste.linksUnread > 0. Have the editor pass 'reading' while the first check is out, not null.

  2. (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.

@gkhngyk
gkhngyk merged commit b7cffa4 into ansvisor:main Oct 28, 2026
7 checks passed
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.

2 participants