Skip to content

feat(content-editor): confirm the author the site names for E-E-A-T, instead of picking one (00271) - #1473

Merged
gkhngyk merged 5 commits into
ansvisor:mainfrom
cihan-gyk:feature/eeat-author-confirm
Oct 25, 2026
Merged

gkhngyk merged 5 commits into
ansvisor:mainfrom
cihan-gyk:feature/eeat-author-confirm

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

In Quality, E-E-A-T came only from an author picked from Settings › Authors. A page under the team byline ("Acme Team") scored E-E-A-T 0, and Quality's average dropped with it, even when the site already shows the real author through its CMS. The user asked for tick boxes instead.

Now, with no author picked, the person can confirm the author their site names, page by page:

  • "The author is a real person, named on your site": the byline's points (+60);
  • "Their profile on your site has a short bio and profile links": the profile's points (+40). It shows once the first is ticked and counts only with it.

Picking an author still works and takes precedence; the ticks don't add to a picked author.

Where it shows

  • Instructions › Quality › Your to-dos: the box sits under "Pick the page's author" ("…Or, if your site names the author, confirm it") and, once ticked, under the profile to-do. A ticked to-do is checked and says what was confirmed.
  • The score changes at once. The tick is saved behind; a failed save puts that box back and says so.
  • Before you publish: "Author named on your site · check it — Check your CMS sets them as the author." The Article JSON-LD leaves author out rather than naming the brand's Organization.
  • For brands with Add byline to content, no "By {Brand} Team" line goes in once a real author is confirmed.

Who and when (00271)

  • content_drafts.author_real_at/by and author_profile_at/by.
  • A trigger stamps by = the session's user and at = now. A request can't confirm in another's name or date it; a change to by alone is undone.
  • Unticking clears the box, and unticking the author clears the profile too. A deleted profile's on delete set null is kept.
  • Applied on the dev DB and tested there: a forged by/at is stamped, a by-only change is undone, a cleared key stays cleared, and unticking clears the profile. All in a rolled-back transaction.

Migration order: 00271 follows 00270 in #1467. If this merges first, I'll renumber whichever lands second, so migrations stay in order.

Related issue

User report (tested on app.ansvisor.com): "Is the author check required for E-E-A-T? Our sites may already have this field. A tick box instead: is the author real, does their profile have these?"

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. Apply 00271.
  2. Open a draft with no author (the team byline). Quality shows E-E-A-T 0.
  3. Tick "The author is a real person, named on your site". E-E-A-T goes to 60, and the profile box appears. Tick it: E-E-A-T 100.
  4. Reload: both stay ticked. Untick the first: both clear.
  5. Before you publish names the author as confirmed, and its JSON-LD has no Organization author.

The browser check (both themes, 1024 px) is still owed, batched with the other editor fixes.

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

Web: yarn test (CHECK_TESTS) and yarn build pass. supabase/schema.sql rebuilt.

🤖 Generated with Claude Code

…instead of picking one (00271)

E-E-A-T came only from an author picked in Settings › Authors: a page
under the team byline scored 0, though many sites show their author
through the CMS. With no author picked, the person can now tick "The
author is a real person, named on your site" (the byline's points) and
then "Their profile on your site has a short bio and profile links"
(the profile's), page by page. Picking an author still takes precedence.

00271 keeps who and when on content_drafts; a trigger stamps them from
the session (no confirming in another's name), clears the profile with
the author, and keeps a deleted profile's set-null. Before you publish
names the author as confirmed and leaves the JSON-LD author out; no
"By {Brand} Team" line goes in for a confirmed author.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 24, 2026

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

A few fixes before merge:

  1. Export and Send to CMS still give the team as the author after an author is confirmed. _draft-editor.tsx:2699 and :2721 pass teamByline={authorsRead ? teamName(language, brandName) : ''} to both dialogs whether or not an author is confirmed. As a result, pageFields fills the CMS's author field with "{Brand} Team", and Send to CMS sends that as the page's author. Before you publish says the opposite: "Check your CMS sets them as the author". The Library's bulk send has the same gap and also keeps the "By {Brand} Team" line. cmsSource (web/src/lib/content/cms-send.ts:140) doesn't know about the confirmation, and getContentDraftPages (web/src/lib/actions/content-drafts.ts:311) doesn't read it. Fix:

    • with no author picked and authorConfirmed.real, pass teamByline='' to both dialogs, so the send goes out with author: null and the CMS keeps its own author;
    • read author_real_at into DraftPage, and have cmsSource drop the byline line and the team name in the same case;
    • add a test on cmsSource and one on the author the Send dialog sends.
  2. 00271_content_draft_author_confirmed.sql:47 and :57: a request can still set author_real_by / author_profile_by to null while the tick stays. Only the profiles FK's on delete set null needs to clear it, and that runs as the table's owner. Keep old.*_by on any change to who alone, unless the role bypasses RLS ((select rolbypassrls from pg_catalog.pg_roles where rolname = current_user), as guard_content_draft_archive does).

  3. _draft-editor.tsx:553–565: unticking the author clears both boxes optimistically. If that save fails, the catch restores real only, so the profile box stays unticked and E-E-A-T shows 60, while the database still has the profile ticked (100 after a reload). Keep the pair from before the change and restore it on failure.

Dry-run on prod, rolled back, with 00270 then 00271:

  • On a tick or an insert, a forged by or at is replaced by the session's user and now. A change to by alone that names another member is undone.
  • Unticking the author clears the profile.
  • Another organization's member and anon update no rows.
  • The service role stamps by as null and can't set it.

The ticks count only when no author is picked. The to-dos keep their ids (byline, authorProfile), so they don't clash with the proof or brand-facts to-dos.

cihan-gyk and others added 3 commits October 24, 2026 23:58
…uard who confirmed

Review fixes on the E-E-A-T author confirmation (00271):
- with no author picked and the one the site names confirmed, Export and
  Send to CMS name no team (the CMS keeps its own author); the Library's
  bulk send reads author_real_at and drops the team and its byline line
- 00271: a change to who confirmed alone is undone for every role that
  doesn't bypass RLS, clearing it too; the profiles FK's set null, run as
  the owner, still clears it
- unticking the author restores both boxes when its save fails

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…med one, one confirmation save at a time

Pre-push review fixes:
- Export's Before you publish line doesn't say "no author yet" for an
  author the site names, and its Author row says the CMS keeps its own
- the confirmation boxes wait while one is being saved, so a failed save
  puts back the pair as it was saved

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

Copy link
Copy Markdown
Collaborator Author

Thanks! Fixed in 915ab7e and 35e551d (main merged forward first, schema.sql rebuilt):

  1. Export and Send to CMS don't name the team for a confirmed author. With no author picked and authorConfirmed.real, the editor passes teamByline='' to both dialogs. Send then goes with author: null, and the CMS keeps its own author. Export shows no author row.
    • getContentDraftPages reads author_real_at into DraftPage.authorConfirmed.
    • cmsSource drops both the team name and the "By {Brand} Team" line in that case, so the Library's bulk send matches the editor.
    • Tests:
      • cmsSource: no team or byline for a confirmed author with none picked, and a picked author's byline either way;
      • getContentDraftPages: reads the flag;
      • an editor page test: Send to CMS sends author: null, and no byline line, for a confirmed author.
  2. 00271: *_by changes are undone for everyone but a role that bypasses RLS. That covers a change to who alone, including clearing it while the tick stays. The bypass check is (select rolbypassrls from pg_catalog.pg_roles where rolname = current_user), as in guard_content_draft_archive, so the profiles FK's on delete set null, run as the owner, still clears it. On insert, OLD is null, so nothing but the session's stamp goes in.
    • Re-applied on the dev DB and tested in a rolled-back transaction:
      • as a member, a tick stamps both bys, and setting them to null afterwards is undone while the ticks stay;
      • as the owner (rolbypassrls = true), the same update clears them.
  3. Unticking restores the pair on failure. The editor keeps the pair from before the change. If unticking the author (which unticks the profile too) fails to save, both boxes go back. A box changed on its own still goes back alone.
    • The page test now ticks the profile, fails the author's untick, and finds both ticked.

Pre-push review found three more, fixed in 35e551d:

  • Export (the Before you publish line came in from fix(content-editor): open Export on its options, Before you publish a Review away #1471) said "no author yet" for a confirmed author. noAuthor now leaves the confirmed case out.
  • Export's Author row said "Not read yet: set it in your CMS" for a confirmed author. It now reads "Your site's own: your CMS keeps it" (siteAuthor). There's a page test for both.
  • The pair kept from before could be stale if a second change went out before the first save failed (server actions run in order). The boxes now wait while a confirmation is being saved, so a failed save always puts back the pair as saved. There's a test for this.

Checks: yarn format, lint (0 errors), typecheck, test (3,622 passed) and build pass on 915ab7e. After 35e551d, I re-ran lint, typecheck, build and the editor's page, Export, Quality and Before you publish tests (235 passed).

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

All items done. Looks good.

  1. Export and Send to CMS no longer name the team when no author is picked and the site's author is confirmed. Send goes with author: null, Export shows "Your site's own", and cmsSource drops the team and the byline line, so the Library's bulk send matches. Each case has a test.
  2. 00271: a change to *_by alone, including clearing it, is now undone unless the role bypasses RLS.
  3. Unticking puts back the pair as it was saved. The boxes also wait while a confirmation is saving.

Dry-run on prod, rolled back, with 00271 on top of 00270:

  • A member's tick with a forged at and by is stamped with now and the member's id. The tick stays when by is cleared, set to another organization's user, or claimed by a second member; each of those changes is undone. The profile box behaves the same way.
  • Unticking the author clears all four columns.
  • Another organization's member and anon update no rows.
  • A member's insert with a forged by and no tick stores no by. With the ticks, it stores the session's id and now.
  • The service role stamps by as null. The table's owner (the FK's on delete set null) can clear by and keep the tick.

@gkhngyk
gkhngyk merged commit b7d54c8 into ansvisor:main Oct 25, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-migration Adds or edits a migration — apply it to the hosted database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants