refactor(creator-studio): pick the cover from the toolbar image dialog

The cover row carried its own hidden file input and upload call, so authors
had two different image flows in one page.

- 添加封面 now opens window.JioSubmitMedia with type=image, the same dialog
  the toolbar's 图片 button uses (mine / upload / external link).
- The picked image is stored as the full-size URL plus its attachment id,
  matching FrontSubmitFeatured's image branch, which re-checks ownership
  and sets the post thumbnail.
- Removes the now-unused uploadCover path, apiUpload/nonce imports, and the
  .jio-creator__cover-input rule.

Contract added; 887 widget-system tests pass.
This commit is contained in:
kate522 committed 2026-11-09 15:57:30 +08:00
1 parent f97fd72bd0
commit 4cd296c066
6 files changed
+58 -61

No files matched your search

@@ -412,6 +412,20 @@ test('TinyMCE media buttons reuse Jio uploads and preserve bookmarks', () => {
assert.match(appSource, /<PublishSettings/);
});
// 封面复用工具栏「图片」按钮的媒体弹窗,不再自带一套上传 input。
test('cover picker reuses the toolbar image media dialog', () => {
const settings = read('assets/creator-studio/src/components/publish-settings.tsx');
const styles = read('assets/creator-studio/src/styles/studio.scss');
assert.match(settings, /JioSubmitMedia/);
assert.match(settings, /type: 'image'/);
assert.match(settings, /onFeaturedChange\(\{ type: 'image'/);
// 旧的本地上传链路已经移除,不再有两套上传 UI。
assert.doesNotMatch(settings, /<input[^>]*type="file"/);
assert.doesNotMatch(settings, /apiUpload/);
assert.doesNotMatch(styles, /jio-creator__cover-input/);
});
test('writing surface is a centered paper card with a publish settings card below', () => {
const styles = read('assets/creator-studio/src/styles/studio.scss');
const settings = read('assets/creator-studio/src/components/publish-settings.tsx');