Skip to content

design: track media URLs in custom Portable Text blocks - #4240

Open
danielmlr wants to merge 2 commits into
mainfrom
daniel/design-media-usage-custom-block-urls
Open

danielmlr wants to merge 2 commits into
mainfrom
daniel/design-media-usage-custom-block-urls

Conversation

@danielmlr

@danielmlr danielmlr commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Design proposal

Proposal: proposals/media-usage-custom-block-urls.md

This plan counts an image or video from the library as used when a custom Portable Text block holds exactly that file's URL: the internal file route that the media_picker element stores, or the URL the configured storage returns for it. Used in shows No tracked references found for such a file, so an editor who trusts that result can delete it while a published page still shows it. A string matches only as a whole, and only when its storage key is in the media table. Matches use the existing portable_text_image and portable_text_video types, so the usage API and index tables stay the same. The lookup runs only while content is indexed, so logged-out pages gain no query.

After the upgrade, existing indexes read as stale until a repair call rebuilds them, as after the gallery fix.

No public API, plugin surface or stored format changes, so this is a feature plan. The open questions name the one gap that would need a public API option.

Proposal type

  • Feature plan
  • RFC
  • Amendment, supersession, or withdrawal

Related work

Discussion: none. This is the remaining part of #3208; #3413 covered the site settings part.

Readiness

  • The proposal identifies its author and, for an RFC, its champion and Maintainer sponsor
  • The proposal describes observable behavior, compatibility, failure handling, and verification in proportion to its risk
  • Conflicting accepted or pending proposals are reconciled in this pull request (none found)
  • This pull request contains no implementation code
  • The proposal status is accepted (check only when ready to merge)

AI assistance

  • This proposal used AI assistance — model/tool: Claude Opus 5.5 (Claude Code)

Feature plan for the remaining part of #3208: count a custom Portable Text
block string that is exactly the internal or public URL of a library image
or video as a media usage reference.
@changeset-bot

changeset-bot Bot commented Oct 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7def59f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 17, 2026 •

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 7def59f Oct 17 2026, 10:21 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://daniel-design-media-usage-custom-block-urls.try.emdashcms.com, https://daniel-design-media-usage-custom-block-urls-emdash-playground.emdash-cms.workers.dev (commit 7def59f)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://591aaac7.try.emdashcms.com, https://591aaac7-emdash-playground.emdash-cms.workers.dev 7def59f 2026-10-17T22:23:00.428Z Visit the dashboard ↗

@bimsonz bimsonz mentioned this pull request Oct 18, 2026
6 of 9 tasks
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