Skip to content

feat(admin): add Media Usage setup and indexing progress - #2531

Draft
khoinguyenpham04 wants to merge 4 commits into
chore/media-usage-dev-seed-readinessfrom
feature/media-usage-activation-ui
Draft

feat(admin): add Media Usage setup and indexing progress#2531
khoinguyenpham04 wants to merge 4 commits into
chore/media-usage-dev-seed-readinessfrom
feature/media-usage-activation-ui

Conversation

@khoinguyenpham04

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds an administrator-facing Media Usage setup page so production sites can turn on automatic indexing and see when existing content is ready.

This PR:

  • adds an Admin-only Settings → Media Usage page and a compact Media Library setup notice;
  • explains the required maintenance window and keeps activation behind explicit confirmations;
  • advances activation one collection per deliberate click by using the existing bounded activation API;
  • shows collection-level indexing progress after activation while historical content catches up in the background;
  • maps busy, conflict, version mismatch, permission, and server failures to clear recovery actions;
  • keeps the Media Library usable if the optional activation-status request fails;
  • fixes the Node scheduler so automatic historical reconciliation starts with a fresh maintenance request context;
  • preserves activation fencing, resumability, V1 behavior, provider-media behavior, and logged-out query counts.

Activation still does not index the full site inside an HTTP request. Existing durable background work, leases, retries, and reconciliation remain responsible for completing historical coverage.

This PR is stacked directly on #2472 and should be reviewed relative to chore/media-usage-dev-seed-readiness.

No linked issue.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (targeted tests for this change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). No messages.po changes are included.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: not applicable; this completes the setup surface for the existing Media Usage system

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: OpenAI Codex (GPT-5.6), with GPT-5.6 Terra adversarial review

Screenshots / test output

This is a visual change. The branch preview produced by CI can be used to review the responsive setup page and Media Library notice.

Verified locally at 91eeaefc:

  • 98 focused core tests passed;
  • 72 focused admin tests passed;
  • core and admin typechecks passed;
  • type-aware quick lint reported zero diagnostics;
  • Oxfmt and Prettier checks passed;
  • Changesets validation passed.

The admin browser suite reports a pre-existing local dependency warning because vitest and @vitest/browser resolve to different patch versions, but all selected tests pass.

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 2,240 lines across 32 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 91eeaef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
emdash Minor
@emdash-cms/admin Minor
@emdash-cms/cloudflare Minor
@emdash-cms/sandbox-workerd Patch
@emdash-cms/plugin-mcp-smoke Major
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/auth Minor
@emdash-cms/blocks Minor
@emdash-cms/gutenberg-to-portable-text Minor
@emdash-cms/x402 Minor
create-emdash Minor
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 91eeaef Aug 17 2026, 12:52 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 91eeaef Aug 17 2026, 12:52 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 91eeaef Aug 17 2026, 12:52 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do 91eeaef Aug 17 2026, 12:52 PM

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant