Skip to content

docs(storage): describe the video-thumbnail pipeline that runs - #866

Merged
sydevs-bot merged 2 commits into
mainfrom
claude/docs-864-video-thumbnails
Sep 29, 2026
Merged

sydevs-bot merged 2 commits into
mainfrom
claude/docs-864-video-thumbnails

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • docs/rules/storage.md's ## Video thumbnails described generation at upload time by ffmpeg-static and Sharp. Implement Cloudflare-Native Storage Migration #88 deleted that pipeline on 2025-12-06 and left the paragraph.
  • Rewritten to what runs: previewUrlField composes a Cloudflare Stream or Images URL on read, and this repo generates no thumbnail at all.
  • src/plugins/storage/urlFields.ts carried the same wrong attribution one line above the Cell it wires — comment-only change, no behaviour.

Preview

Nothing in this PR is visible in a deploy. These two links are for checking the claim the rewrite makes about the two display surfaces:

  • Frames list — the previewUrl column, rendered by PreviewUrlThumbnailCell
  • Meditations — open any one; its Frames editor is the grid where FrameThumbnail has the <video> fallback

Test results

  • Lean gate: ✓ pnpm lint, tsc --noEmit (src + tests), 2237 unit tests in 165 files
  • Targeted specs: none run — the source diff is comment-only, verified mechanically (every +/- line in src/ is a // comment), so no behaviour changed
  • Build: N/A — CI does not build; Railway builds the preview

Manual verification

The rewrite's factual claims were each checked against source, but two are about rendered behaviour and are cheap to confirm by eye:

  1. Frames list: a video Frame with no Stream thumbnail shows Payload's placeholder, not an inline <video>.
  2. A meditation's Frames editor: a Frame with no previewUrl but with hlsUrl/mp4Url shows the inline <video>; one with neither shows an empty box.

Notes for reviewer

The ticket specified the rewrite in full, so the judgement calls here were about what to add beyond it. Three additions came out of the review pass and are worth a look:

  • previewUrlField is not frames-only. videos and files mount it with the same defaults and carry previewUrl in defaultColumns. The ticket's spec was frames-shaped; documenting it that way would have hidden that a change here moves three list views.
  • The third MIME branch. Anything neither image/ nor video/ gets the local Payload URL, which serves the whole file — a PDF in files has a previewUrl that is the PDF. Two of three branches invited the wrong inference about the third.
  • The <video> fallback is conditional, on isVideo && (mp4Url || hlsUrl). My first draft's table implied it was unconditional, which is the same shape of over-confident claim this ticket exists to remove.
Detail — dismissed findings, and what was verified

Dismissed review findings

  • Collapse the urlFields.ts comment to one line, dropping the component names. The coupling argument is real — naming two admin components inside a generic factory in src/plugins/storage/ does rot if a third surface appears. Rejected anyway: docs(storage): the video-thumbnail section documents a deleted pipeline #864's acceptance criteria and its verification checklist both require git grep -n 'FrameThumbnail' src/plugins/storage/urlFields.ts to print a line, and the vague word "components" was the defect being fixed. Tightened the wording instead and kept both names.
  • Switch the bullet lead-ins from **Video** — to **Video.** to match the file. The premise is wrong: docs/rules/storage.md:149 already uses the **bold** — form.
  • Document that width is ignored for video (the Stream helper takes height only). True and a genuine trap, but the section is already the heaviest in the file for its size, and the ?height=320 vs width=320,height=320 contrast is visible in the text. Left out to hold the length.
  • Document Videos' separate editor-uploaded thumbnail field. Different collection, different concern. The headline claim is about generation, which stays true.

Security review: the path gate in .claude/workflow.json matched on src/plugins/storage/, so it ran. No findings — the match was on path, not content, and the diff in that path changes no executable line.

Verification performed: all 13 factual claims in the new section were checked against source before the first commit, plus the ticket's own three-item checklist (no banned term in the section; every src/… path it cites resolves; FrameThumbnail named in urlFields.ts). comment-lint.mjs --base origin/main is clean. docs/architecture.md:12 already described the Stream thumbnail URL correctly and agrees with the rewrite, so no docs-sync was needed elsewhere.

Note on #862: this unblocks its phase-2 guard. src/lib/videoThumbnailUtils.ts was the one cited path in storage.md that did not resolve.

Closes #864

🤖 Written by the sydevs autonomous loop — see what this is

The `## Video thumbnails` section described generation at upload time by
`ffmpeg-static` and Sharp, written into `req.payloadUploadSizes.small` and read
back from `sizes.small.url`. #88 deleted that pipeline with `src/lib/fileUtils.ts`
on 2025-12-06 and left the paragraph, which then survived three doc moves. Its
`Implementation:` path, `src/lib/videoThumbnailUtils.ts`, has never been a
tracked file at all.

None of it was a stale path. It was a paragraph of specific, confident detail
for machinery that does not exist, in a rule file that loads on every storage
change — so a reader looking for the seam went hunting for a module, a size and
a hook that are all absent, and found no signal that the section was wrong.

What runs instead is `previewUrlField`, a virtual text field with an `afterRead`
hook only: Cloudflare Stream renders the video still and Cloudflare Images the
image variant, and this repo generates nothing. The rewrite states the readiness
gap that follows from composing the URL from the uid — nothing consults
`readyToStream`, so the URL exists before transcoding finishes — because that is
the property a reader cannot re-derive from the hook's four lines.

It also separates the two display surfaces the old sentence conflated. The
`<video>` fallback belongs to `FrameThumbnail`; `PreviewUrlThumbnailCell` has
none and renders Payload's placeholder. `urlFields.ts` carried the same wrong
attribution one line above the Cell it wires, telling the reader that
"components" fall back when the Cell this factory installs is the one that does
not.

Closes #864

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RewarM72mwntsKDMxQ1Nw2
…uard

The review pass found four things the first draft got wrong or left out.

`previewUrlField` is not frames-only — `videos` and `files` mount it with the
same defaults, and `previewUrl` sits in all three `defaultColumns`, so someone
tuning it would have moved three list views without knowing.

The hook has a third MIME branch. Anything neither `image/` nor `video/` gets
the local Payload URL, which serves the whole file: a PDF in `files` has a
`previewUrl` that is the PDF. Documenting two of three branches invited the
reader to assume the third thumbnails too.

`FrameThumbnail`'s `<video>` fallback is guarded on `isVideo && (mp4Url ||
hlsUrl)` and renders an empty box otherwise. The table read as though the
fallback were unconditional, which is the same shape of over-confident claim
this ticket exists to remove.

The readiness point named MP4 downloads, which this file already states twice —
in the module table and in the webhook section's opening sentence — against its
own instruction at the preview-isolation paragraph to cite rather than restate.
MP4 readiness is also not a property of the thumbnail URL, so the clause
imported a neighbouring subsystem into a point that stands alone.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RewarM72mwntsKDMxQ1Nw2
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-866 September 29, 2026 04:35 Destroyed
@railway-app

railway-app Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-866 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Sep 29, 2026 at 4:38 am UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adversarial review skipped: 2 file(s), 18 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-bot
sydevs-bot added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 53e4569 Sep 29, 2026
22 checks passed
@sydevs-bot
sydevs-bot deleted the claude/docs-864-video-thumbnails branch September 29, 2026 13:45
sydevs-bot pushed a commit that referenced this pull request Sep 29, 2026
…nothing

#862's phase 1 corrected four stale references by hand. This is the scanner
that would have caught them, with the fixture proving it is not vacuous.

Three scope rules, each measured against this repo rather than chosen. A
fenced block writes a path as a sample argument or a code comment, and a
`://` run makes the path the tail of an upstream URL — both cite somebody
else's tree. Symlinks are dropped by git mode, because every `CLAUDE.md` is
a symlink to the `AGENTS.md` beside it and reading both reports every
finding twice.

The citation pattern is `\.tsx?`. Written `\.(ts|tsx)` the alternation stops
at `ts`, which both truncates the row and reports live `.tsx` components as
missing — the fixture pins a case that fails either way round.

The assertion over the live tree is phase 2b, not an omission. It reports one
row today, `docs/rules/storage.md:169` citing the pipeline #88 deleted, which
is #864 and is fixed by the open #866. Landing the assertion now lands a red
spec, and the only early alternative is allowlisting `storage.md` — the one
outcome that would make the guard worthless.

Refs #862

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DZJmVZdzC4UJtcZvxzbJMS
sydevs-bot pushed a commit that referenced this pull request Sep 29, 2026
…oups

#866 landed the `docs/rules/storage.md` rewrite, so the one citation that did
not resolve is gone and the guard can assert over the real tree rather than
the fixture alone. It reports nothing today, and the ticket's own check —
appending a `RulesEditor.tsx` citation to `docs/rules/admin-ui.md` — turns it
red on that line.

Parentheses join the citation class, for Next.js route groups. Without them
`src/app/(payload)/api/openapi.json/route.ts` and the Cloudflare Stream
webhook handler matched nothing at all, so a whole route tree was cited and
never checked. A glob keeps its `*` out of the class and so still matches
nothing, which is what we want of a pattern rather than a path.

One `git ls-files` per scan instead of two: `inScopeDocs` now takes the map
its caller already holds, which also rules out two disagreeing snapshots of
one index.

Refs #862

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01DZJmVZdzC4UJtcZvxzbJMS

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-866 — e8e8d480 Deployed Sep 29, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

docs(storage): the video-thumbnail section documents a deleted pipeline

3 participants