fix(plaza): use hero-generated thumbnails and portal cover URLs

Plaza posts now resolve cover_url to /u/{slug}/pages/{urlSlug}.thumbnail.png
instead of MindSpace workspace paths that fail on plaza.tkmind.cn. Public-html
and chat quick-plaza flows regenerate workspace thumbnails with force:true
after hero images are on disk so feed cards embed the generated art.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-29 16:00:00 +08:00
parent 9610bd56cf
commit c446ae0db4
5 changed files with 173 additions and 16 deletions
+41
View File
@@ -53,6 +53,47 @@ test('resolvePlazaCoverUrl prefers explicit cover urls and falls back to publica
plazaInternals.resolvePlazaCoverUrl('', '/u/john/pages/demo'),
'/u/john/pages/demo.thumbnail.png',
);
assert.equal(
plazaInternals.defaultPlazaCoverUrl('/MindSpace/user/public/page.html'),
'/MindSpace/user/public/page.thumbnail.png',
);
assert.equal(
plazaInternals.resolvePlazaCoverUrl(
'https://m.tkmind.cn/MindSpace/u/public/demo.html.thumbnail.png',
'/u/john/pages/demo',
),
'https://m.tkmind.cn/MindSpace/u/public/demo.thumbnail.png',
);
});
test('resolvePlazaPublicationCoverUrl prefers portal publication thumbnail over MindSpace cover', () => {
assert.equal(
plazaInternals.resolvePlazaPublicationCoverUrl({
inputCoverUrl: '',
publicUrl: 'https://m.tkmind.cn/MindSpace/wx_ul610et8/public/demo.html',
publicationUrlSlug: 'plaza-batch-001',
userSlug: 'wx_ul610et8',
}),
'/u/wx_ul610et8/pages/plaza-batch-001.thumbnail.png',
);
assert.equal(
plazaInternals.resolvePlazaPublicationCoverUrl({
inputCoverUrl: 'https://m.tkmind.cn/MindSpace/wx_ul610et8/public/demo.html.thumbnail.png',
publicUrl: 'https://m.tkmind.cn/MindSpace/wx_ul610et8/public/demo.html',
publicationUrlSlug: 'plaza-batch-001',
userSlug: 'wx_ul610et8',
}),
'/u/wx_ul610et8/pages/plaza-batch-001.thumbnail.png',
);
assert.equal(
plazaInternals.resolvePlazaPublicationCoverUrl({
inputCoverUrl: 'https://cdn.example.com/cover.png',
publicUrl: '/u/john/pages/demo',
publicationUrlSlug: 'demo',
userSlug: 'john',
}),
'https://cdn.example.com/cover.png',
);
});
test('mapPlazaError maps documented API codes', () => {