Skip to content

Spot it. Save it. Free, local-first Chrome extension for images, videos and prompts. Explore 2,000+ curated cases and connect your library to AI Agents via MCP. 提示词导演

Keep curated collections visible when case attribution is unknown

MigenAI5e489eb1bf4b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e75c96..900da14 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,11 @@
了解每个版本带来的功能变化与使用改善。下载请前往 [GitHub Releases](https://github.com/wchao6891/PromptDirector/releases/latest)。
+## 1.22.4
+
+- 修复精选合集包含未署名案例时,插件拒绝显示整包预览的问题;保留已有署名,未知作者保持留空。
+- 网页与插件使用一致的作者可选规则,继续校验案例数量、来源与权利说明及媒体地址。
+
## 1.22.3
- 新入库的 PNG、JPEG、WebP 可读取图片内的生成提示词及参数,保留原图;多分支无法唯一对应时不自动填入。
diff --git a/extension/curated-catalog.js b/extension/curated-catalog.js
index 8ae6ddd..bdd0a62 100644
--- a/extension/curated-catalog.js
+++ b/extension/curated-catalog.js
@@ -93,7 +93,7 @@ export function normalizeCuratedPreview(value, itemValue) {
const videoSha256 = hasVideoAsset ? String(entry?.videoSha256 ?? "").toLocaleLowerCase("en-US") : "";
const videoBytes = hasVideoAsset ? positiveInteger(entry?.videoBytes, "精选视频大小无效") : 0;
const videoMimeType = hasVideoAsset ? clean(entry?.videoMimeType) : "";
- if (!id || !title || !text || !author || !rights || !mediaKind) throw new Error("精选预览案例缺少必填字段");
+ if (!id || !title || !text || !rights || !mediaKind) throw new Error("精选预览案例缺少必填字段");
if (hasVideoAsset && (mediaKind !== "video" || !/^[a-f0-9]{64}$/.test(videoSha256) || videoMimeType !== "video/mp4")) {
throw new Error("精选视频预览字段无效");
}
diff --git a/extension/manifest.json b/extension/manifest.json
index 694270d..078c816 100644
--- a/extension/manifest.json
+++ b/extension/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "__MSG_extensionName__",
- "version": "1.22.3",
+ "version": "1.22.4",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq2m8W9ACXJTkJqPAd36sPrtzonmHhOYU34uS7c+D7DXX6ggWNMwB4xZapGFJ4ScBQJv71PeG9KfsEnhcXFZ9RoX/X3wY+57evL19hf6woNX1xxhKOe1rtx5QmzWCEYIr99TzW50k/N9U6tS9Ri+2DHKYA85ssXTC8B2yRQ5zUXhsAWZe/HDU18UFuvUKXYt3ZdIUi31c2vIlgFFBfsyKbIUMny9LlxL/smb4vJzU/+A3LwJDjjvOtS/lmQ2vHoQGjHJItO18bYI6h67fIEvmWk+HJKtO08Ca+5RLS8TYhI+K7l7S0RyDVNujyVWtvhAULot1H0BvteYL87fKu3SNywIDAQAB",
"homepage_url": "https://github.com/wchao6891/PromptDirector",
"default_locale": "zh_CN",
diff --git a/package-lock.json b/package-lock.json
index e7e0263..61ad350 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "prompt-case-collector",
- "version": "1.22.3",
+ "version": "1.22.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "prompt-case-collector",
- "version": "1.22.3",
+ "version": "1.22.4",
"license": "Apache-2.0",
"dependencies": {
"@jonahschulte/rtf-toolkit": "0.5.0",
diff --git a/package.json b/package.json
index 5fec8f8..8b638ae 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "prompt-case-collector",
- "version": "1.22.3",
+ "version": "1.22.4",
"private": false,
"license": "Apache-2.0",
"repository": "https://github.com/wchao6891/PromptDirector",
diff --git a/store/DISTRIBUTION.md b/store/DISTRIBUTION.md
index 98c52c6..8ef24ec 100644
--- a/store/DISTRIBUTION.md
+++ b/store/DISTRIBUTION.md
@@ -6,7 +6,7 @@ Public distribution formats and the permissions used by PromptDirector.
- Chrome Web Store item public key: stored in the source `manifest.json` for local identity verification only; `package:release` removes `key` from the upload manifest.
- Expected extension ID: `iahakaahijddcjjldidbclicedibgpjm`.
-- Current upload artifact: `dist/store/PromptDirector-1.22.3-Chrome-Web-Store.zip`. Keep this artifact local for Web Store submission. The sole GitHub extension installation package is `PromptDirector-1.22.2.zip`, with stable identity and the local updater.
+- Current upload artifact: `dist/store/PromptDirector-1.22.4-Chrome-Web-Store.zip`. Keep this artifact local for Web Store submission. The sole GitHub extension installation package is `PromptDirector-1.22.2.zip`, with stable identity and the local updater.
- Generate a candidate only with `npm run package:release`; the command verifies the source public key against the expected identity, then removes `key` from the Web Store upload manifest and excludes the local program installer.
## Store listing
diff --git a/test/curated-catalog.test.js b/test/curated-catalog.test.js
index f5ad77e..11769d5 100644
--- a/test/curated-catalog.test.js
+++ b/test/curated-catalog.test.js
@@ -369,3 +369,19 @@ test("source selections can be browsed and saved without inventing authorization
assert.equal(saved.curatedOrigin.license, item.license);
assert.equal(saved.curatedOrigin.rightsReviewUrl, item.rightsReviewUrl);
});
+
+
+test('one unknown case author does not hide the entire published preview or invent attribution', () => {
+ const item = catalogItem();
+ const entry = { id: 'known', title: '案例', text: '原始提示词', author: '原作者', rights: '权利归原作者 · 授权未核验', mediaKind: 'image', sourceUrl: 'https://example.com/source', previewImageUrl: item.coverUrl, width: 100, height: 100 };
+ const value = { format: 'prompt-director-curated-preview', version: 1, catalogId: item.id, packageId: item.packageId, packageVersion: item.packageVersion, entries: [entry, { ...entry, id: 'unknown', author: '' }] };
+ const preview = normalizeCuratedPreview(value, item);
+ assert.equal(preview.entries.length, 2);
+ assert.equal(preview.entries[0].author, '原作者');
+ assert.equal(preview.entries[1].author, '');
+ assert.equal(preview.entries[1].rights, entry.rights);
+ for (const field of ['id', 'title', 'text', 'rights', 'mediaKind']) {
+ assert.throws(() => normalizeCuratedPreview({ ...value, entries: [entry, { ...value.entries[1], [field]: '' }] }, item), /必填字段/);
+ }
+ assert.throws(() => normalizeCuratedPreview({ ...value, entries: [entry, { ...value.entries[1], previewImageUrl: 'https://untrusted.example/a.png' }] }, item), /不受信任/);
+});
diff --git a/test/curated_workflow_e2e.py b/test/curated_workflow_e2e.py
index 24a44e7..9a697a5 100644
--- a/test/curated_workflow_e2e.py
+++ b/test/curated_workflow_e2e.py
@@ -114,7 +114,7 @@ def main() -> None:
"id": "curated-portrait-case",
"title": "竖版工作流案例",
"text": "保留竖版构图和主体比例。",
- "author": "竖版作者",
+ "author": "", # Missing attribution must not hide the whole collection.
"rights": "权利归原作者",
"sourceUrl": "https://example.com/portrait-case",
"mediaKind": "image",