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. 提示词导演

修正发布快照中分离其他任务改动的行位置

MigenAIecfea62f0d42
diff --git a/i18n.js b/i18n.js
index df278ad..04f63ed 100644
--- a/i18n.js
+++ b/i18n.js
@@ -1015,6 +1015,11 @@ const EN = Object.freeze({
"采集已由用户停止。": "Capture was stopped by the user.",
"已按当前列表可识别结果结束。": "Capture ended with the results recognized from the current list.",
"扫描不会自动保存。请确认正文、图片或视频,未勾选的内容不会进入案例库。": "Scanning never saves automatically. Confirm the text, images, or videos you want; unchecked content will not enter the library.",
+ "网页": "Webpage",
+ "待保存内容没有更新": "The capture draft was not updated",
+ "引用帖 · {count} 张图": "Quoted post · {count} images",
+ "已撤销上次调整": "Last change undone",
+ "加入这组": "Add this group",
"正文": "Text",
"原网页选区": "Page selection",
"智能正文": "Reader article",
@@ -1038,11 +1043,6 @@ const EN = Object.freeze({
"CSS 背景图": "CSS background image",
"公开原图失败时,将使用当前网页已有登录状态读取所选图片;不会读取或保存登录信息。": "If public originals fail, the selected images will be read through the current page session. Sign-in information is never read or saved.",
"公开原图失败时,只会使用当前网页已有登录状态读取已确认主体内的相关媒体;不会读取或保存登录信息。": "If public originals fail, only related media inside the confirmed subject may be read through the current page session. Sign-in information is never read or saved.",
- "网页": "Webpage",
- "待保存内容没有更新": "The capture draft was not updated",
- "引用帖 · {count} 张图": "Quoted post · {count} images",
- "已撤销上次调整": "Last change undone",
- "加入这组": "Add this group",
"正在停止整页扫描": "Stopping full-page scan",
"文章": "Article",
"作品": "Work",
diff --git a/library.js b/library.js
index 9234739..465d91d 100644
--- a/library.js
+++ b/library.js
@@ -4986,7 +4986,6 @@ function bindDetailSidebarResize() {
elements.detailResizer.classList.add("is-resizing");
event.preventDefault();
});
- const presentation = usesArticleReader(entry) ? "article" : usesPostReader(entry) ? "post" : "case";
elements.detailResizer.addEventListener("pointermove", (event) => {
if (event.pointerId !== pointerId) return;
const width = detailSidebarRuntimeWidth(startWidth + startX - event.clientX);
@@ -5026,14 +5025,12 @@ function clearFilters() {
renderGallery();
}
- body.dataset.presentation = presentation;
function openUnassignedView() {
selectedCollectionId = "";
unassignedViewActive = true;
caseOrderManagementActive = false;
projectOrderManagementActive = false;
selectedContentId = "";
- elements.detailContent.classList.toggle("is-article-detail", presentation !== "case" && !entry.compoundCase);
selectedFacets.clear();
elements.pendingFilter.checked = false;
elements.searchInput.value = "";
@@ -5110,6 +5107,7 @@ async function renderDetail({ resetScroll = false } = {}) {
if (!entry) return closeDetail();
const mediaIdentity = JSON.stringify(entryMediaAssets(entry).filter(asset => asset.usage !== "poster").map(({ id, kind, usage, storageMode, contentHash, sourceUrl, reference, recordType }) =>
({ id, kind, usage, storageMode, contentHash, sourceUrl, reference, recordType })));
+ const presentation = usesArticleReader(entry) ? "article" : usesPostReader(entry) ? "post" : "case";
const mountedBody = elements.detailContent.querySelector(".detail-primary > .detail-body");
const mountedArticle = mountedBody?.querySelector(":scope > .article-document-reader");
if (!resetScroll && usesArticleReader(entry) && elements.detailDrawer.dataset.entryId === entry.id
@@ -5149,12 +5147,14 @@ async function renderDetail({ resetScroll = false } = {}) {
const content = document.createDocumentFragment();
const body = el("div", "detail-body");
body.dataset.mediaIdentity = mediaIdentity;
+ body.dataset.presentation = presentation;
const hasPrimaryMedia = entryHasMedia(entry);
const capturedPost = usesPostReader(entry);
const hasArticleDocument = !capturedPost && usesArticleReader(entry);
const usesStageNavigation = !capturedPost && !hasArticleDocument && (entryHasMedia(entry, "image") || entryHasMedia(entry, "video"));
elements.detailContent.classList.toggle("has-primary-media", hasPrimaryMedia && !hasArticleDocument && !capturedPost);
elements.detailContent.classList.toggle("is-compound-detail", Boolean(entry.compoundCase));
+ elements.detailContent.classList.toggle("is-article-detail", presentation !== "case" && !entry.compoundCase);
elements.drawerToolbar.classList.toggle("has-document-navigation", Boolean(entry.compoundCase) || !usesStageNavigation);
if (entry.compoundCase) {
elements.drawerToolbar.prepend(elements.detailNavigation);
@@ -5432,7 +5432,6 @@ function createCompoundOrganizer(entry) {
renderOrder();
const actions = el("div", "compound-organizer-actions");
const save = textEl("button", "", "保存整理");
- link.classList.add("has-poster");
save.addEventListener("click", async () => {
const response = await perform(save, {
type: "UPDATE_COMPOUND_CASE",
@@ -5464,7 +5463,6 @@ async function createCapturedPostView(entryValue) {
heading.append(textEl("h3", "", "帖子文字"), rawTextEl("small", "", facts));
section.append(heading);
if (promptEditState?.entryId === entry.id && !promptEditState.assetId) {
- renderArticleBlockText(node, block);
const textarea = document.createElement("textarea");
textarea.className = "captured-post-editor";
textarea.value = promptEditState.draftText;
@@ -5513,9 +5511,6 @@ async function createCapturedPostView(entryValue) {
renderDetail();
});
actions.append(copy, edit);
- contextParts: [entry.sourceFacts?.author, entry.sourceFacts?.handle ? `@${entry.sourceFacts.handle}` : "",
- entry.sourceFacts?.publishedAt ? formatDate(entry.sourceFacts.publishedAt) : ""].filter(Boolean),
- onCopy: button => copyTextWithFeedback(button, entry.text, "已复制", "浏览器未允许复制,请选中文字后复制"),
section.append(actions);
}
const media = entry.mediaAssets.filter((asset) => asset.usage !== "poster");
@@ -5558,6 +5553,7 @@ async function createCompactCapturedMedia(entry, asset, { post = false } = {}) {
link.target = "_blank";
link.rel = "noopener noreferrer";
if (posterBlob) {
+ link.classList.add("has-poster");
const image = document.createElement("img");
image.src = rememberDetailBlobUrl(posterBlob);
image.alt = `${entry.title} 视频封面`;
@@ -5589,6 +5585,7 @@ async function createArticleDocumentReader(entryValue) {
if (["paragraph", "list", "quote", "code", "table"].includes(block.kind)) {
const tagName = block.kind === "quote" ? "blockquote" : block.kind === "list" ? "div" : block.kind === "code" || block.kind === "table" ? "pre" : "p";
const node = rawTextEl(tagName, block.kind === "table" ? "article-table-text" : "", block.text);
+ renderArticleBlockText(node, block);
node.dataset.articleBlockId = block.id;
reader.append(node);
continue;
@@ -5637,6 +5634,9 @@ async function createArticleDocumentReader(entryValue) {
}
attachArticleEditor(reader, entry, {
t, onError: error => showFeedback(error.message, true),
+ contextParts: [entry.sourceFacts?.author, entry.sourceFacts?.handle ? `@${entry.sourceFacts.handle}` : "",
+ entry.sourceFacts?.publishedAt ? formatDate(entry.sourceFacts.publishedAt) : ""].filter(Boolean),
+ onCopy: button => copyTextWithFeedback(button, entry.text, "已复制", "浏览器未允许复制,请选中文字后复制"),
onSave: async patches => {
const response = await chrome.runtime.sendMessage({ type: "UPDATE_ENTRY_ARTICLE_TEXT", entryId: entry.id,
textRevision: entryTextRevision(entry), patches });
diff --git a/test/run_e2e.py b/test/run_e2e.py
index c32a051..9587d9a 100644
--- a/test/run_e2e.py
+++ b/test/run_e2e.py
@@ -51,10 +51,10 @@ SCRIPTS = [
"region_and_smart_picker_e2e.py",
"smart_visual_picker_e2e.py",
"page_capture_e2e.py",
- "higgsfield_capture_e2e.py",
"page_capture_sidebar_e2e.py",
"capture_additions_e2e.py",
"x_capture_extraction_e2e.py",
+ "higgsfield_capture_e2e.py",
"libtv_capture_e2e.py",
"jimeng_capture_e2e.py",
"ai_provider_registry_e2e.py",