Skip to content

fix(content): Export's link row as Before you publish reads it, its checks memoized, and the team named in the page's language (#1427 follow-up) - #1445

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/export-dialog-followups
Oct 24, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/export-dialog-followups

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups noted in my reply on #1427. Web only.

  1. Export's links row.
    • Before, it called every unread link "still being read" while any link read was pending.
    • It now counts as feat(content): check the page before Export, with a Ready to paste row (CE-057) #1426 made Before you publish count: the reads still coming cover the unread links at most, and the rest couldn't be read.
    • With both at once it says "1 of 3 links still being read, 1 couldn't be read". When reads alone are pending it says "2 of 3 links still being read", in the same form.
  2. Export's paste checks are memoized. pasteChecks(exportOpen.html, linkChecks) ran on every editor render while Export was open. It is now a useMemo on the open page and the link reads.
  3. The team's name is in the page's language. The page fields' author fallback "{brand} Team" came from the app's English strings. It goes to the CMS's author field, so it is now in the page's language:
    • teamName(language, brand) reads the same BYLINES table as the byline line, giving "Acme Ekibi", "Acme-Team", "Équipe Acme" and so on;
    • a language not in the table gets the brand alone; no brand read yet gives none;
    • Before you publish ("The page goes out as …") and the Quality to-do line use it too, through QualityRead.team;
    • the editor-only Page info strip stays in the app's language.

A pre-push review agent checked the diff. Its four low findings are in:

  • the two lines above;
  • one message form for the links row;
  • a test for more reads pending than links unread;
  • import order.

Follow-up: the Send to CMS dialog (#1438) and the Library's cmsSource (#1439) still pass the English team name. I'll switch them to teamName once this and they are on main.

Related issue

Follow-up to #1427 and #1426.

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. Run cd web && npx vitest run src/lib/content/ready-to-publish.test.ts "src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.test.tsx". The tests cover the links row's four states and teamName per language.
  2. In the editor page test, a Turkish brand's Export shows "Author: Acme Ekibi → your CMS author field".
  3. With NEXT_PUBLIC_CONTENT_QUALITY_PHASE=1, open Export on a page with links while their reads are pending. The row splits "still being read" from "couldn't be read".

I didn't open it in the browser this time: the Mac had just run out of memory and rebooted during the checks. The change is copy and counting, covered by the tests above.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): 0 errors, 6 existing warnings in files this PR doesn't touch
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run: yarn test (362 files / 3282 tests) and yarn build with CI's placeholder env.

🤖 Generated with Claude Code

…hecks memoized, and the team named in the page's language (ansvisor#1427 follow-up)

- Export's links row no longer calls every unread link "still being
  read" while a read is pending: the reads coming count for the unread
  links at most, the rest couldn't be read (as Before you publish since
  ansvisor#1426), with a message for both at once
- Export's paste checks are read again only when Export opens or a link
  read lands, not on every editor render
- the brand's team, which goes to a CMS's author field when the page has
  no author, is named in the page's language (teamName: "Acme Ekibi",
  "Acme-Team"…), in Export's page fields and in Before you publish and
  Quality's lines that say how the page goes out

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@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.

Checked

  • Links row: it counts the way Before you publish's readyRow does. Reads still coming cover the unread links at most, and the rest couldn't be read. Broken links still take precedence, as before. The tests cover both splits.

  • Memo: linkChecks is useLinkChecks' state Map, so its identity changes only when a read lands. exportOpen changes only when Export opens. The hook sits before the component's only return.

  • Team name:

    • teamName reads the page's language the same way the byline line does: the Language rule, else the brand's.
    • A code or a language name resolves through languageCode, as it does for the byline line. A language not in the table gets the brand alone.
    • QualityRead.team is set at the one place a QualityRead is built.
    • Neither the stack nor main uses the old checks.links.reading form anywhere else.
  • Follow-up from the body: with #1438–#1440 merged, three places still pass the English "{brand} Team":

    • the Send dialog's teamByline in _draft-editor.tsx;
    • library/page.tsx;
    • library/_bulk-send-dialog.tsx.

    cmsSource's teamByline(brand) callback will need the page's language for teamName.

@gkhngyk
gkhngyk merged commit 0112ff8 into ansvisor:main Oct 24, 2026
6 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