fix: restore public page share thumbnails from SVG sidecars

Serve missing *.thumbnail.png requests when the SVG sidecar exists, and schedule async PNG rasterization after public HTML is materialized so WeChat og:image URLs stop 404ing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-04 00:11:40 +08:00
parent 553af7ca7a
commit 702871a98c
5 changed files with 78 additions and 1 deletions
+2
View File
@@ -3,6 +3,7 @@ import path from 'node:path';
import { extractStaticPageLinks } from './mindspace-chat-save.mjs';
import { DOWNLOADABLE_FILE_PATTERN } from './mindspace-html-download-links.mjs';
import { scheduleWorkspaceHtmlThumbnailSidecars } from './mindspace-workspace-thumbnails.mjs';
/**
* Public HTML finish-sync invariants (regression guard — do not simplify away).
@@ -398,6 +399,7 @@ export function materializeMissingPublicHtmlWrites({ messages, publishDir }) {
fs.mkdirSync(path.dirname(destination), { recursive: true });
fs.writeFileSync(destination, artifact.content, 'utf8');
materialized.push(artifact.relativePath);
scheduleWorkspaceHtmlThumbnailSidecars(root, artifact.relativePath);
} catch {
skipped.push(artifact.relativePath);
}