Skip to content

Turn import jobs on in the example site and click through the admin - #41

Merged
mgilardi merged 2 commits into
mainfrom
example-imports
Nov 12, 2026
Merged

mgilardi merged 2 commits into
mainfrom
example-imports

Conversation

@mgilardi

Copy link
Copy Markdown
Collaborator

What changes

Example site (apps/payload-example)

  • Import jobs are on, over a new sources upload collection that only a curator can read, add to, change or delete, so nobody else can fetch a source file by its address.
  • The seed adds a job waiting to be run and one that failed on purpose, both over made-up files. A job doesn't run when it is made.
  • Uploaded files go in a throwaway folder that is deleted when the site stops.
  • New pnpm click-through: builds the site, opens a Chrome already on the machine with no window and a throwaway profile, signs in as the made-up curator and does a curator's work on all four panels. It installs nothing and fails on any request off the site apart from Payload's code editor.

Payload plugin (unreleased), three things the click-through found in the real admin that jsdom can't see:

  • The panels' paragraphs and lists sat flush against each other: the panel's margin reset outranked its spacing rule. The reset now carries no weight.
  • The form under a panel repeated it. The fields a panel already shows are hidden in the form (admin.hidden), still in its data, the API and the list's columns.
  • The "Made-up example data" tag touched the source's title.

Docs. They said every button asks first. Running an import never did, and they now say so.

Tested

  • 633 unit tests (249 in the plugin, 2 new), typecheck, build, leak check and brand check, locally.
  • Smoke test: 74 checks over HTTP on the built site and on next dev (58 before).
  • Click-through: 40 of 40 in headless Chrome on the built site.
  • Six deliberate breaks, each failing its own check, then restored: source files readable by anyone, jobs running when made, the uploads folder not deleted, the hidden fields disabled instead, the old margin reset, and the panel no longer putting a run's result into the form. The last one first hung the script on the browser's "Leave site?" question; the script now answers it, counts it as a problem and ends.

Not tested

  • The click-through is not in CI: it needs Chrome and the network for Payload's code editor.
  • A screen reader, Safari, Firefox, a phone, Postgres or SQLite, a deployed site.
  • Imports from a URL aren't in the example site.

No new service, no cost, nothing published. Everything runs on this machine on made-up data.

🤖 Generated with Claude Code

mgilardi and others added 2 commits November 11, 2026 19:20
The example left imports off, so the import panel had never run in a real
admin. It now has a curators-only upload collection for source files, two
seeded jobs over made-up files (one waiting, one that fails on purpose),
and smoke checks that visitors and members can't read a source file, a
job, run one or upload, and that running the waiting job gives the
committed fixture's checksum.

Uploaded files go in a throwaway folder that is deleted when the site
stops; the site now waits for the server to exit before taking it away.

Not yet clicked through in a browser: that follows in this branch.

Co-Authored-By: Claude <noreply@anthropic.com>
The example site now has import jobs, so the import panel could run in a
real admin for the first time. scripts/click-through.mjs does a curator's
work on all four panels in a headless Chrome already on the machine, with
a throwaway profile, and fails on any request off the site apart from
Payload's code editor.

It found three things jsdom can't see:

- The panels' paragraphs and lists sat flush against each other, because
  the panel's margin reset outranked its spacing rule. The reset now
  carries no weight, and the script measures the gaps.
- The form under a panel repeated it. The fields a panel already shows are
  now hidden in the form, not disabled, so they stay in its data: the
  import panel puts a run's result there so a later Save doesn't send the
  old one.
- The made-up-data tag touched the source's title.

The docs said every button asks first. Running an import never did, and
they now say so.

Tested: 633 unit tests, 74 smoke checks and the brand check locally; the
click-through passes 40 of 40 on the built site. Six deliberate breaks each
failed their own check. Not in CI: the click-through, which needs Chrome
and the network. Not tested: a screen reader, Safari, Firefox, a phone,
Postgres or SQLite.

Co-Authored-By: Claude <noreply@anthropic.com>
@mgilardi
mgilardi merged commit a17acfb into main Nov 12, 2026
1 check passed
@mgilardi
mgilardi deleted the example-imports branch November 12, 2026 03:05
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.

1 participant