Skip to content

fix(site-import): upload and re-point imported video sources - #661

Draft
rodrigoc-neu-Lab wants to merge 1 commit into
CoreBunch:mainfrom
rodrigoc-neu-Lab:fix/site-import-video-urls
Draft

rodrigoc-neu-Lab wants to merge 1 commit into
CoreBunch:mainfrom
rodrigoc-neu-Lab:fix/site-import-video-urls

Conversation

@rodrigoc-neu-Lab

Copy link
Copy Markdown

Summary

Importing a static site that contains <video src> or <video><source src> left the video pointing at its original relative path (for example videos/bg.mp4). The file was never uploaded, so the published page requested a URL that does not exist.

The HTML importer stores a video's URL in the base.video node's videoUrl prop. The site-import asset pipeline only normalised and rewrote src, href and srcset, so videoUrl was skipped at both steps: buildAssetPlan never recorded the file as an asset, and applyAssetRewrites never swapped in the uploaded media URL.

This PR:

  • adds videoUrl to the URL-bearing node props;
  • makes assetPlan.ts the single owner of that list, which applyAssetRewrites.ts now imports. Before, each file declared its own copy, which is how the two could drift apart;
  • updates the doc comments, PagePlan.nodeFragment docs and docs/features/site-import.md.

Found while importing a Webflow export: its background videos (<video><source src="videos/…mp4">) came through as broken links.

Verification

  • bun run build
  • bun test (8 failures in toolbar.test.ts / selectorStability.test.ts also occur on a clean origin/main checkout. Those tests build paths with new URL(…).pathname, which percent-encodes a space in the checkout path. They are unrelated to this PR.)
  • bun run lint
  • Docker/deployment check, if relevant (not relevant)

Added two regression tests, both of which fail without the fix:

  • assetPlan.test.ts: a page in a subfolder with <video><source src="../videos/bg.mp4">. The test checks that videoUrl normalises to the FileMap key and that the file is recorded as an asset.
  • applyAssetRewrites.test.ts: videoUrl is rewritten to the uploaded media URL.

Checklist

  • Tests cover behavior changes.
  • Docs were updated when behavior, config, deployment, or public surfaces changed.
  • No compatibility shim was added for old pre-release behavior.
  • No secrets, local databases, uploads, or generated artifacts are included.

🤖 Generated with Claude Code

The HTML importer stores a <video>/<source> URL in base.video's
`videoUrl` prop, but the site-import asset pipeline only normalised and
rewrote `src`, `href` and `srcset`. Imported videos kept their relative
path and the file was never uploaded.

Add `videoUrl` to the URL-bearing props and make assetPlan.ts the single
owner of that list so applyAssetRewrites can no longer drift from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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