An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Improve database collection management https://github.com/siyuan-note/siyuan/issues/20664
Danield2c5a1051295
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 612f0d32bc..6e8ebf8a17 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "إدارة التجميع",+ "automationCollectionRules": "مطابقات القواعد",+ "automationCollectionEntries": "إدخالات قاعدة البيانات",+ "automationCollectionNotCollected": "غير مجمّع",+ "automationCollectionRemove": "إزالة",+ "automationCollectionRemoveConfirm": "إزالة هذا الإدخال وقيم حقوله. سيُحتفظ بالمحتوى الأصلي. يمكن التراجع عن هذا الإجراء.",+ "automationCollectionReasonInvalidItem": "معلومات ربط الإدخال غير مكتملة",+ "automationCollectionReasonDetached": "الإدخال غير مرتبط بالكتلة الأصلية",+ "automationCollectionReasonNoRules": "لا توجد قواعد مفعّلة لتجميع الكتل",+ "automationCollectionReasonInvalidRule": "إحدى قواعد التجميع المفعّلة غير صالحة",+ "automationCollectionReasonUnavailable": "الكتلة الأصلية غير متاحة",+ "automationCollectionReasonUnreadable": "تعذّرت قراءة المحتوى الأصلي","menuMouseScroll": "تمرير القوائم مع حركة الماوس","menuMouseScrollTip": "حرّك الماوس لأعلى أو لأسفل داخل القائمة لتمرير محتواها عندما يتجاوز الارتفاع المتاح","aiWebSearchExaTip": "البحث في صفحات الويب باستخدام Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "مشترك بين Search وFetch؛ تُرسل الاستعلامات وعناوين URL المستهدفة إلى DeepSeek وتُحسب الرسوم لكل طلب","automationCollectionReview": "مراجعة الإدخالات المجمعة","automationCollectionCleanup": "إزالة الإدخالات غير المطابقة في هذه الصفحة",- "automationCollectionReviewTip": "تُفحص جميع قواعد جمع الكتل المفعّلة؛ تكفي مطابقة قاعدة واحدة للاحتفاظ بالإدخال. تُفحص الروابط اليدوية والتلقائية بالتساوي، وتُحفظ الإدخالات غير المرتبطة أو غير المحددة",+ "automationCollectionReviewTip": "فحص الإدخالات الحالية وفق جميع قواعد تجميع الكتل المفعّلة، باستخدام المعايير نفسها للإدخالات المضافة يدويًا وتلقائيًا","automationCollectionCleanupConfirm": "أزل فقط الإدخالات المؤكدة غير المطابقة في هذه الصفحة وحقولها، بما فيها المضافة يدوياً. تُحفظ الكتل الأصلية ويمكن التراجع عن العملية. ستُفحص القواعد والمطابقات مجدداً قبل الإزالة",- "automationCollectionMatched": "مطابق",- "automationCollectionUnmatched": "غير مطابق",+ "automationCollectionMatched": "يطابق القواعد",+ "automationCollectionUnmatched": "لا يطابق القواعد","automationCollectionUnknown": "يتعذر التحديد","blockGutterMode": "إظهار مؤشرات الكتل كاملة","blockGutterModeTip": "عند التفعيل، تظهر جميع مؤشرات الكتلة الحالية وحاوياتها، وعند التعطيل يكون العرض مختصرًا",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex a43a4201e7..08fc935431 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Sammlungsverwaltung",+ "automationCollectionRules": "Regeltreffer",+ "automationCollectionEntries": "Datenbankeinträge",+ "automationCollectionNotCollected": "Nicht gesammelt",+ "automationCollectionRemove": "Entfernen",+ "automationCollectionRemoveConfirm": "Diesen Eintrag und seine Feldwerte entfernen. Der Quellinhalt bleibt erhalten. Diese Aktion kann rückgängig gemacht werden.",+ "automationCollectionReasonInvalidItem": "Die Verknüpfungsdaten des Eintrags sind unvollständig",+ "automationCollectionReasonDetached": "Der Eintrag ist nicht mit einem Quellblock verknüpft",+ "automationCollectionReasonNoRules": "Keine aktivierten Blocksammelregeln",+ "automationCollectionReasonInvalidRule": "Eine aktivierte Sammelregel ist ungültig",+ "automationCollectionReasonUnavailable": "Der Quellblock ist nicht verfügbar",+ "automationCollectionReasonUnreadable": "Der Quellinhalt konnte nicht gelesen werden","menuMouseScroll": "Menüs durch Mausbewegung scrollen","menuMouseScrollTip": "Bewege die Maus innerhalb eines zu langen Menüs nach oben oder unten, um dessen Inhalt zu scrollen","aiWebSearchExaTip": "Webseiten mit Exa durchsuchen",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Für Search und Fetch gemeinsam; Suchanfragen und Ziel-URLs werden an DeepSeek gesendet und Anfragen abgerechnet","automationCollectionReview": "Gesammelte Einträge prüfen","automationCollectionCleanup": "Nicht passende Einträge dieser Seite entfernen",- "automationCollectionReviewTip": "Alle aktiven Blocksammelregeln prüfen; ein Treffer genügt zum Behalten. Manuelle und automatische Bindungen werden gleich geprüft; ungebundene oder unbestimmbare Einträge bleiben erhalten",+ "automationCollectionReviewTip": "Vorhandene Einträge anhand aller aktivierten Blocksammelregeln prüfen; manuell und automatisch hinzugefügte Einträge werden gleich beurteilt","automationCollectionCleanupConfirm": "Nur bestätigte, nicht passende Einträge dieser Seite samt Feldern entfernen, einschließlich manuell hinzugefügter Einträge. Quellblöcke bleiben erhalten, die Aktion ist rückgängig machbar. Regeln und Treffer werden erneut geprüft",- "automationCollectionMatched": "Passend",- "automationCollectionUnmatched": "Nicht passend",+ "automationCollectionMatched": "Entspricht den Regeln",+ "automationCollectionUnmatched": "Entspricht nicht den Regeln","automationCollectionUnknown": "Nicht bestimmbar","blockGutterMode": "Vollständige Blockmarkierungen anzeigen","blockGutterModeTip": "Zeigt bei Aktivierung alle Markierungen des aktuellen Blocks und seiner Container an; bei Deaktivierung wird eine vereinfachte Darstellung verwendet",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex 2c0433d232..dbe39f3cea 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Collection management",+ "automationCollectionRules": "Rule matches",+ "automationCollectionEntries": "Database entries",+ "automationCollectionNotCollected": "Not collected",+ "automationCollectionRemove": "Remove",+ "automationCollectionRemoveConfirm": "Remove this entry and its field values. The source content is kept. This action can be undone.",+ "automationCollectionReasonInvalidItem": "Entry binding information is incomplete",+ "automationCollectionReasonDetached": "Entry is detached from its source block",+ "automationCollectionReasonNoRules": "No enabled block collection rules",+ "automationCollectionReasonInvalidRule": "An enabled collection rule is invalid",+ "automationCollectionReasonUnavailable": "Source block is unavailable",+ "automationCollectionReasonUnreadable": "Source content could not be read","menuMouseScroll": "Scroll menus with mouse movement","menuMouseScrollTip": "Move the mouse up or down within an overflowing menu to scroll its contents","aiWebSearchExaTip": "Search web pages with Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Shared by Search and Fetch; queries and target URLs are sent to DeepSeek and requests are billed","automationCollectionReview": "Review collected entries","automationCollectionCleanup": "Remove unmatched entries on this page",- "automationCollectionReviewTip": "Check all enabled block collection rules; a match with any rule keeps the entry. Manual and automatic bindings are checked equally; detached or indeterminate entries are kept",+ "automationCollectionReviewTip": "Check existing entries against all enabled block collection rules; manually and automatically added entries use the same criteria","automationCollectionCleanupConfirm": "Remove only the confirmed unmatched entries on this page, including manually added entries and their fields. Source blocks are kept and the operation can be undone. Rules and matches will be checked again before removal",- "automationCollectionMatched": "Matching",- "automationCollectionUnmatched": "Not matching",+ "automationCollectionMatched": "Matches rules",+ "automationCollectionUnmatched": "Does not match rules","automationCollectionUnknown": "Cannot determine","blockGutterMode": "Show full block indicators","blockGutterModeTip": "When enabled, shows all indicators for the current block and its containers; when disabled, uses a simplified display",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex 08b566024a..ca63031724 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Gestión de recopilación",+ "automationCollectionRules": "Coincidencias de reglas",+ "automationCollectionEntries": "Entradas de la base de datos",+ "automationCollectionNotCollected": "Sin recopilar",+ "automationCollectionRemove": "Retirar",+ "automationCollectionRemoveConfirm": "Retirar esta entrada y los valores de sus campos. Se conserva el contenido de origen. Esta acción se puede deshacer.",+ "automationCollectionReasonInvalidItem": "La información del vínculo está incompleta",+ "automationCollectionReasonDetached": "La entrada no está vinculada a un bloque de origen",+ "automationCollectionReasonNoRules": "No hay reglas de recopilación de bloques activadas",+ "automationCollectionReasonInvalidRule": "Una regla de recopilación activada no es válida",+ "automationCollectionReasonUnavailable": "El bloque de origen no está disponible",+ "automationCollectionReasonUnreadable": "No se pudo leer el contenido de origen","menuMouseScroll": "Desplazar menús con el movimiento del ratón","menuMouseScrollTip": "Mueve el ratón hacia arriba o abajo dentro de un menú que exceda la altura disponible para desplazar su contenido","aiWebSearchExaTip": "Buscar páginas web con Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Compartida por Search y Fetch; las consultas y las URL de destino se envían a DeepSeek y se cobra por solicitud","automationCollectionReview": "Revisar entradas recopiladas","automationCollectionCleanup": "Quitar entradas no coincidentes de esta página",- "automationCollectionReviewTip": "Se comprueban todas las reglas activas de recopilación de bloques; basta con coincidir con una para conservar la entrada. Los enlaces manuales y automáticos se comprueban igual; las entradas sin enlace o indeterminadas se conservan",+ "automationCollectionReviewTip": "Comprobar las entradas existentes con todas las reglas de recopilación de bloques activadas, con los mismos criterios para entradas manuales y automáticas","automationCollectionCleanupConfirm": "Se quitarán solo las entradas confirmadas como no coincidentes de esta página y sus campos, incluidas las añadidas manualmente. Se conservan los bloques originales y se puede deshacer la operación. Se volverán a comprobar las reglas y coincidencias",- "automationCollectionMatched": "Coincide",- "automationCollectionUnmatched": "No coincide",+ "automationCollectionMatched": "Cumple las reglas",+ "automationCollectionUnmatched": "No cumple las reglas","automationCollectionUnknown": "No se puede determinar","blockGutterMode": "Mostrar todos los indicadores de bloque","blockGutterModeTip": "Al activarlo, se muestran todos los indicadores del bloque actual y sus contenedores; al desactivarlo, se usa una visualización simplificada",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex ac7ab90c35..140965086b 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Gestion de la collecte",+ "automationCollectionRules": "Correspondances des règles",+ "automationCollectionEntries": "Entrées de la base",+ "automationCollectionNotCollected": "Non collecté",+ "automationCollectionRemove": "Retirer",+ "automationCollectionRemoveConfirm": "Retirer cette entrée et les valeurs de ses champs. Le contenu source est conservé. Cette action peut être annulée.",+ "automationCollectionReasonInvalidItem": "Les informations de liaison sont incomplètes",+ "automationCollectionReasonDetached": "L’entrée n’est pas liée à un bloc source",+ "automationCollectionReasonNoRules": "Aucune règle de collecte de blocs activée",+ "automationCollectionReasonInvalidRule": "Une règle de collecte activée est invalide",+ "automationCollectionReasonUnavailable": "Le bloc source est indisponible",+ "automationCollectionReasonUnreadable": "Le contenu source n’a pas pu être lu","menuMouseScroll": "Faire défiler les menus avec le mouvement de la souris","menuMouseScrollTip": "Déplacez la souris vers le haut ou le bas dans un menu trop long pour faire défiler son contenu","aiWebSearchExaTip": "Rechercher des pages web avec Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Partagée entre Search et Fetch ; les requêtes et les URL cibles sont envoyées à DeepSeek, avec une facturation par requête","automationCollectionReview": "Vérifier les entrées collectées","automationCollectionCleanup": "Retirer les entrées non correspondantes de cette page",- "automationCollectionReviewTip": "Toutes les règles actives de collecte sont vérifiées ; une correspondance suffit à conserver l’entrée. Les liaisons manuelles et automatiques sont traitées de même ; les entrées non liées ou indéterminées sont conservées",+ "automationCollectionReviewTip": "Vérifier les entrées existantes selon toutes les règles de collecte de blocs activées, avec les mêmes critères pour les ajouts manuels et automatiques","automationCollectionCleanupConfirm": "Retirer uniquement les entrées confirmées comme non correspondantes de cette page et leurs champs, y compris les ajouts manuels. Les blocs sources sont conservés et l’action peut être annulée. Les règles et correspondances seront revérifiées",- "automationCollectionMatched": "Correspond",- "automationCollectionUnmatched": "Ne correspond pas",+ "automationCollectionMatched": "Conforme aux règles",+ "automationCollectionUnmatched": "Non conforme aux règles","automationCollectionUnknown": "Indéterminé","blockGutterMode": "Afficher tous les indicateurs de bloc","blockGutterModeTip": "Lorsque cette option est activée, affiche tous les indicateurs du bloc actuel et de ses conteneurs ; sinon, utilise un affichage simplifié",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex b229946d17..1ef599999c 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "ניהול איסוף",+ "automationCollectionRules": "התאמות לכללים",+ "automationCollectionEntries": "רשומות מסד הנתונים",+ "automationCollectionNotCollected": "לא נאסף",+ "automationCollectionRemove": "הסרה",+ "automationCollectionRemoveConfirm": "הסרת רשומה זו וערכי השדות שלה. תוכן המקור נשמר. ניתן לבטל פעולה זו.",+ "automationCollectionReasonInvalidItem": "פרטי הקישור של הרשומה אינם שלמים",+ "automationCollectionReasonDetached": "הרשומה אינה מקושרת לבלוק מקור",+ "automationCollectionReasonNoRules": "אין כללים פעילים לאיסוף בלוקים",+ "automationCollectionReasonInvalidRule": "כלל איסוף פעיל אינו תקין",+ "automationCollectionReasonUnavailable": "בלוק המקור אינו זמין",+ "automationCollectionReasonUnreadable": "לא ניתן לקרוא את תוכן המקור","menuMouseScroll": "גלילת תפריטים באמצעות תנועת העכבר","menuMouseScrollTip": "כאשר תוכן התפריט חורג מהגובה הזמין, יש להזיז את העכבר למעלה או למטה בתוך התפריט כדי לגלול את תוכנו","aiWebSearchExaTip": "חיפוש דפי אינטרנט באמצעות Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "משותף ל־Search ול־Fetch; שאילתות וכתובות URL נשלחות ל־DeepSeek והחיוב הוא לפי בקשה","automationCollectionReview": "בדיקת הרשומות שנאספו","automationCollectionCleanup": "הסרת הרשומות שאינן תואמות בדף זה",- "automationCollectionReviewTip": "נבדקים כל כללי איסוף הבלוקים הפעילים; התאמה לכלל אחד מספיקה לשמירת הרשומה. קישורים ידניים ואוטומטיים נבדקים באופן שווה; רשומות לא מקושרות או לא ניתנות לקביעה נשמרות",+ "automationCollectionReviewTip": "בדיקת רשומות קיימות לפי כל כללי איסוף הבלוקים הפעילים, עם אותם קריטריונים לרשומות שנוספו ידנית ואוטומטית","automationCollectionCleanupConfirm": "יש להסיר רק רשומות בדף זה שאושרו כלא תואמות ואת השדות שלהן, כולל רשומות שנוספו ידנית. בלוקי המקור נשמרים וניתן לבטל את הפעולה. הכללים וההתאמות ייבדקו שוב לפני ההסרה",- "automationCollectionMatched": "תואם",- "automationCollectionUnmatched": "אינו תואם",+ "automationCollectionMatched": "תואם לכללים",+ "automationCollectionUnmatched": "אינו תואם לכללים","automationCollectionUnknown": "לא ניתן לקבוע","blockGutterMode": "הצגת כל סמני הבלוקים","blockGutterModeTip": "כאשר האפשרות מופעלת, מוצגים כל הסמנים של הבלוק הנוכחי והמכלים שלו; כאשר היא מושבתת, נעשה שימוש בתצוגה מצומצמת",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex e179284e97..834d14f5d6 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "संग्रह प्रबंधन",+ "automationCollectionRules": "नियम से मेल",+ "automationCollectionEntries": "डेटाबेस प्रविष्टियाँ",+ "automationCollectionNotCollected": "संग्रहित नहीं",+ "automationCollectionRemove": "हटाएँ",+ "automationCollectionRemoveConfirm": "इस प्रविष्टि और इसके फ़ील्ड मानों को हटाएँ। मूल सामग्री सुरक्षित रहेगी। इस कार्रवाई को पूर्ववत किया जा सकता है।",+ "automationCollectionReasonInvalidItem": "प्रविष्टि की लिंक जानकारी अधूरी है",+ "automationCollectionReasonDetached": "प्रविष्टि मूल ब्लॉक से जुड़ी नहीं है",+ "automationCollectionReasonNoRules": "ब्लॉक संग्रह का कोई नियम सक्षम नहीं है",+ "automationCollectionReasonInvalidRule": "सक्षम संग्रह नियम अमान्य है",+ "automationCollectionReasonUnavailable": "मूल ब्लॉक उपलब्ध नहीं है",+ "automationCollectionReasonUnreadable": "मूल सामग्री पढ़ी नहीं जा सकी","menuMouseScroll": "माउस की गति से मेनू स्क्रॉल करें","menuMouseScrollTip": "मेनू की सामग्री उपलब्ध ऊँचाई से अधिक होने पर उसे स्क्रॉल करने के लिए मेनू के भीतर माउस को ऊपर या नीचे ले जाएँ","aiWebSearchExaTip": "Exa से वेब पृष्ठ खोजें",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Search और Fetch के लिए साझा कुंजी; खोज शब्द और लक्ष्य URL DeepSeek को भेजे जाते हैं और प्रति अनुरोध शुल्क लगता है","automationCollectionReview": "संग्रहित प्रविष्टियों की समीक्षा करें","automationCollectionCleanup": "इस पृष्ठ की बेमेल प्रविष्टियाँ हटाएँ",- "automationCollectionReviewTip": "सभी सक्षम ब्लॉक संग्रह नियम जाँचे जाते हैं; किसी एक से मेल खाने पर प्रविष्टि रखी जाती है। मैन्युअल और स्वचालित लिंक समान रूप से जाँचे जाते हैं; बिना लिंक वाली या अनिर्धारित प्रविष्टियाँ रखी जाती हैं",+ "automationCollectionReviewTip": "मौजूदा प्रविष्टियों को सभी सक्षम ब्लॉक संग्रह नियमों के अनुसार जाँचें; मैन्युअल और स्वचालित रूप से जोड़ी गई प्रविष्टियों पर समान मानदंड लागू होते हैं","automationCollectionCleanupConfirm": "केवल इस पृष्ठ की पुष्टि की गई बेमेल प्रविष्टियाँ और उनके फ़ील्ड हटाएँ, मैन्युअल रूप से जोड़ी गई प्रविष्टियों सहित। स्रोत ब्लॉक सुरक्षित रहते हैं और कार्रवाई पूर्ववत की जा सकती है। हटाने से पहले नियम और मिलान दोबारा जाँचे जाएँगे",- "automationCollectionMatched": "मेल खाता है",- "automationCollectionUnmatched": "मेल नहीं खाता",+ "automationCollectionMatched": "नियमों से मेल खाती है",+ "automationCollectionUnmatched": "नियमों से मेल नहीं खाती","automationCollectionUnknown": "निर्धारित नहीं किया जा सकता","blockGutterMode": "सभी ब्लॉक संकेतक दिखाएँ","blockGutterModeTip": "सक्षम होने पर वर्तमान ब्लॉक और उसके सभी कंटेनर के संकेतक दिखते हैं; अक्षम होने पर संक्षिप्त रूप में दिखते हैं",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex eb1654ace2..027be015d0 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Pengelolaan pengumpulan",+ "automationCollectionRules": "Kecocokan aturan",+ "automationCollectionEntries": "Entri basis data",+ "automationCollectionNotCollected": "Belum dikumpulkan",+ "automationCollectionRemove": "Keluarkan",+ "automationCollectionRemoveConfirm": "Keluarkan entri ini beserta nilai bidangnya. Konten sumber tetap disimpan. Tindakan ini dapat dibatalkan.",+ "automationCollectionReasonInvalidItem": "Informasi pengikatan entri tidak lengkap",+ "automationCollectionReasonDetached": "Entri tidak terikat ke blok sumber",+ "automationCollectionReasonNoRules": "Tidak ada aturan pengumpulan blok yang diaktifkan",+ "automationCollectionReasonInvalidRule": "Ada aturan pengumpulan aktif yang tidak valid",+ "automationCollectionReasonUnavailable": "Blok sumber tidak tersedia",+ "automationCollectionReasonUnreadable": "Konten sumber tidak dapat dibaca","menuMouseScroll": "Gulir menu dengan gerakan tetikus","menuMouseScrollTip": "Gerakkan tetikus ke atas atau ke bawah di dalam menu yang melebihi tinggi yang tersedia untuk menggulir isinya","aiWebSearchExaTip": "Cari halaman web dengan Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Digunakan bersama oleh Search dan Fetch; kueri dan URL tujuan dikirim ke DeepSeek dan dikenai biaya per permintaan","automationCollectionReview": "Periksa entri yang dikumpulkan","automationCollectionCleanup": "Keluarkan entri yang tidak cocok di halaman ini",- "automationCollectionReviewTip": "Periksa semua aturan pengumpulan blok yang aktif; kecocokan dengan satu aturan mempertahankan entri. Tautan manual dan otomatis diperiksa sama; entri terlepas atau tidak dapat ditentukan dipertahankan",+ "automationCollectionReviewTip": "Periksa entri yang ada berdasarkan semua aturan pengumpulan blok yang aktif; entri manual dan otomatis menggunakan kriteria yang sama","automationCollectionCleanupConfirm": "Keluarkan hanya entri halaman ini yang dikonfirmasi tidak cocok beserta kolomnya, termasuk entri manual. Blok sumber dipertahankan dan tindakan dapat diurungkan. Aturan dan kecocokan akan diperiksa kembali",- "automationCollectionMatched": "Cocok",- "automationCollectionUnmatched": "Tidak cocok",+ "automationCollectionMatched": "Sesuai aturan",+ "automationCollectionUnmatched": "Tidak sesuai aturan","automationCollectionUnknown": "Tidak dapat ditentukan","blockGutterMode": "Tampilkan indikator blok lengkap","blockGutterModeTip": "Saat diaktifkan, menampilkan semua indikator blok saat ini dan wadahnya; saat dinonaktifkan, menggunakan tampilan ringkas",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 38253c4973..a452dfb1e2 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Gestione raccolta",+ "automationCollectionRules": "Corrispondenze delle regole",+ "automationCollectionEntries": "Voci del database",+ "automationCollectionNotCollected": "Non raccolto",+ "automationCollectionRemove": "Rimuovi",+ "automationCollectionRemoveConfirm": "Rimuovere questa voce e i valori dei suoi campi. Il contenuto originale viene conservato. L’azione può essere annullata.",+ "automationCollectionReasonInvalidItem": "Le informazioni di collegamento sono incomplete",+ "automationCollectionReasonDetached": "La voce non è collegata a un blocco di origine",+ "automationCollectionReasonNoRules": "Nessuna regola di raccolta blocchi attiva",+ "automationCollectionReasonInvalidRule": "Una regola di raccolta attiva non è valida",+ "automationCollectionReasonUnavailable": "Il blocco di origine non è disponibile",+ "automationCollectionReasonUnreadable": "Impossibile leggere il contenuto originale","menuMouseScroll": "Scorri i menu con il movimento del mouse","menuMouseScrollTip": "Sposta il mouse verso l'alto o il basso all'interno di un menu troppo lungo per scorrerne il contenuto","aiWebSearchExaTip": "Cerca pagine web con Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Condivisa da Search e Fetch; le ricerche e gli URL di destinazione sono inviati a DeepSeek con addebito per richiesta","automationCollectionReview": "Controlla le voci raccolte","automationCollectionCleanup": "Rimuovi le voci non corrispondenti di questa pagina",- "automationCollectionReviewTip": "Controlla tutte le regole di raccolta attive; una corrispondenza basta a conservare la voce. I collegamenti manuali e automatici sono controllati allo stesso modo; le voci scollegate o indeterminate vengono conservate",+ "automationCollectionReviewTip": "Verifica le voci esistenti rispetto a tutte le regole di raccolta blocchi attive, con gli stessi criteri per le aggiunte manuali e automatiche","automationCollectionCleanupConfirm": "Rimuovi solo le voci confermate come non corrispondenti di questa pagina e i relativi campi, incluse quelle aggiunte manualmente. I blocchi originali vengono conservati e l’operazione è annullabile. Regole e corrispondenze verranno ricontrollate",- "automationCollectionMatched": "Corrisponde",- "automationCollectionUnmatched": "Non corrisponde",+ "automationCollectionMatched": "Conforme alle regole",+ "automationCollectionUnmatched": "Non conforme alle regole","automationCollectionUnknown": "Non determinabile","blockGutterMode": "Mostra tutti gli indicatori di blocco","blockGutterModeTip": "Se attivato, mostra tutti gli indicatori del blocco corrente e dei suoi contenitori; se disattivato, usa una visualizzazione semplificata",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex 0c799864be..cb7f663683 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "収集管理",+ "automationCollectionRules": "ルールの一致",+ "automationCollectionEntries": "データベース項目",+ "automationCollectionNotCollected": "未収集",+ "automationCollectionRemove": "除去",+ "automationCollectionRemoveConfirm": "この項目とフィールド値を除去します。原文は保持されます。この操作は元に戻せます。",+ "automationCollectionReasonInvalidItem": "項目のバインド情報が不完全です",+ "automationCollectionReasonDetached": "項目が元のブロックにバインドされていません",+ "automationCollectionReasonNoRules": "有効な通常ブロック収集ルールがありません",+ "automationCollectionReasonInvalidRule": "有効化された収集ルールに不備があります",+ "automationCollectionReasonUnavailable": "元のブロックを利用できません",+ "automationCollectionReasonUnreadable": "原文を読み取れませんでした","menuMouseScroll": "マウスの動きに合わせてメニューをスクロール","menuMouseScrollTip": "メニューの内容が表示可能な高さを超える場合、メニュー内でマウスを上下に動かすと内容をスクロールできます","aiWebSearchExaTip": "Exa で Web ページを検索します",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Search と Fetch で共有します。検索語と対象 URL は DeepSeek に送信され、リクエストごとに課金されます","automationCollectionReview": "収集結果を確認","automationCollectionCleanup": "このページの不一致項目を除外",- "automationCollectionReviewTip": "有効な通常ブロック収集ルールすべてで確認し、いずれかに一致すれば保持します。手動・自動のバインド項目を同様に確認し、未バインドや判定不能の項目は保持します",+ "automationCollectionReviewTip": "有効な通常ブロック収集ルールすべてに対して既存項目を確認し、手動と自動で追加した項目を同じ基準で判定します","automationCollectionCleanupConfirm": "このページで不一致と確認された項目とそのフィールドを除外します。手動追加も対象です。元ブロックは保持され、操作は元に戻せます。実行前にルールと一致状態を再確認します",- "automationCollectionMatched": "一致",- "automationCollectionUnmatched": "不一致",+ "automationCollectionMatched": "ルールに一致",+ "automationCollectionUnmatched": "ルールに不一致","automationCollectionUnknown": "判定不能","blockGutterMode": "ブロックアイコンをすべて表示","blockGutterModeTip": "有効にすると現在のブロックと、それを含むコンテナのすべてのブロックアイコンを表示し、無効にすると簡略表示します",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex 5c59d0a222..cc7422ef20 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "수집 관리",+ "automationCollectionRules": "규칙 일치",+ "automationCollectionEntries": "데이터베이스 항목",+ "automationCollectionNotCollected": "미수집",+ "automationCollectionRemove": "제거",+ "automationCollectionRemoveConfirm": "이 항목과 필드 값을 제거합니다. 원본 내용은 유지됩니다. 이 작업은 실행 취소할 수 있습니다.",+ "automationCollectionReasonInvalidItem": "항목의 연결 정보가 불완전합니다",+ "automationCollectionReasonDetached": "항목이 원본 블록에 연결되어 있지 않습니다",+ "automationCollectionReasonNoRules": "활성화된 블록 수집 규칙이 없습니다",+ "automationCollectionReasonInvalidRule": "활성화된 수집 규칙이 유효하지 않습니다",+ "automationCollectionReasonUnavailable": "원본 블록을 사용할 수 없습니다",+ "automationCollectionReasonUnreadable": "원본 내용을 읽을 수 없습니다","menuMouseScroll": "마우스 움직임으로 메뉴 스크롤","menuMouseScrollTip": "메뉴 내용이 표시 가능한 높이를 초과하면 메뉴 안에서 마우스를 위아래로 움직여 내용을 스크롤합니다","aiWebSearchExaTip": "Exa로 웹 페이지 검색",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Search와 Fetch에서 공유하며, 검색어와 대상 URL이 DeepSeek으로 전송되고 요청별로 요금이 부과됩니다","automationCollectionReview": "수집 결과 확인","automationCollectionCleanup": "이 페이지의 불일치 항목 제외",- "automationCollectionReviewTip": "활성화된 모든 블록 수집 규칙을 확인하며 하나라도 일치하면 유지합니다. 수동 및 자동 연결 항목을 동일하게 확인하며, 연결되지 않았거나 판단할 수 없는 항목은 유지합니다",+ "automationCollectionReviewTip": "활성화된 모든 블록 수집 규칙으로 기존 항목을 확인하며, 수동 및 자동 추가 항목에 동일한 기준을 적용합니다","automationCollectionCleanupConfirm": "이 페이지에서 불일치가 확인된 항목과 필드만 제외합니다. 수동으로 추가한 항목도 포함됩니다. 원본 블록은 유지되며 실행을 취소할 수 있습니다. 실행 전에 규칙과 일치 상태를 다시 확인합니다",- "automationCollectionMatched": "일치",- "automationCollectionUnmatched": "불일치",+ "automationCollectionMatched": "규칙에 일치",+ "automationCollectionUnmatched": "규칙에 불일치","automationCollectionUnknown": "판단할 수 없음","blockGutterMode": "블록 아이콘 모두 표시","blockGutterModeTip": "활성화하면 현재 블록과 이를 포함하는 컨테이너의 모든 블록 아이콘을 표시하고, 비활성화하면 간소화하여 표시합니다",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 8fe95dcfdf..42a841aa00 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Verzamelbeheer",+ "automationCollectionRules": "Regelovereenkomsten",+ "automationCollectionEntries": "Database-items",+ "automationCollectionNotCollected": "Niet verzameld",+ "automationCollectionRemove": "Verwijderen",+ "automationCollectionRemoveConfirm": "Verwijder dit item en de veldwaarden. De broninhoud blijft behouden. Deze actie kan ongedaan worden gemaakt.",+ "automationCollectionReasonInvalidItem": "De koppelingsgegevens zijn onvolledig",+ "automationCollectionReasonDetached": "Het item is niet aan een bronblok gekoppeld",+ "automationCollectionReasonNoRules": "Geen ingeschakelde regels voor blokverzameling",+ "automationCollectionReasonInvalidRule": "Een ingeschakelde verzamelregel is ongeldig",+ "automationCollectionReasonUnavailable": "Het bronblok is niet beschikbaar",+ "automationCollectionReasonUnreadable": "De broninhoud kon niet worden gelezen","menuMouseScroll": "Menu's scrollen met muisbewegingen","menuMouseScrollTip": "Beweeg de muis omhoog of omlaag binnen een menu dat te lang is om de inhoud te scrollen","aiWebSearchExaTip": "Webpagina's zoeken met Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Gedeeld door Search en Fetch; zoekopdrachten en doel-URL's worden naar DeepSeek verzonden en per verzoek gefactureerd","automationCollectionReview": "Verzamelde items controleren","automationCollectionCleanup": "Niet-passende items op deze pagina verwijderen",- "automationCollectionReviewTip": "Controleer alle actieve regels voor blokverzameling; één overeenkomst is voldoende om een item te behouden. Handmatige en automatische koppelingen worden gelijk gecontroleerd; ontkoppelde of onbepaalde items blijven behouden",+ "automationCollectionReviewTip": "Controleer bestaande items op alle ingeschakelde regels voor blokverzameling; handmatig en automatisch toegevoegde items worden gelijk beoordeeld","automationCollectionCleanupConfirm": "Verwijder alleen bevestigde niet-passende items op deze pagina en hun velden, ook handmatig toegevoegde items. Bronblokken blijven behouden en de actie kan ongedaan worden gemaakt. Regels en overeenkomsten worden opnieuw gecontroleerd",- "automationCollectionMatched": "Komt overeen",- "automationCollectionUnmatched": "Komt niet overeen",+ "automationCollectionMatched": "Voldoet aan de regels",+ "automationCollectionUnmatched": "Voldoet niet aan de regels","automationCollectionUnknown": "Niet te bepalen","blockGutterMode": "Alle blokindicatoren tonen","blockGutterModeTip": "Toont bij inschakeling alle indicatoren van het huidige blok en de bijbehorende containers; gebruikt bij uitschakeling een vereenvoudigde weergave",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex d1f77f6e87..6a88107fb2 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Zarządzanie zbieraniem",+ "automationCollectionRules": "Dopasowania reguł",+ "automationCollectionEntries": "Wpisy bazy danych",+ "automationCollectionNotCollected": "Niezebrane",+ "automationCollectionRemove": "Usuń",+ "automationCollectionRemoveConfirm": "Usuń ten wpis i wartości jego pól. Treść źródłowa zostanie zachowana. Tę czynność można cofnąć.",+ "automationCollectionReasonInvalidItem": "Informacje o powiązaniu wpisu są niepełne",+ "automationCollectionReasonDetached": "Wpis nie jest powiązany z blokiem źródłowym",+ "automationCollectionReasonNoRules": "Brak włączonych reguł zbierania bloków",+ "automationCollectionReasonInvalidRule": "Włączona reguła zbierania jest nieprawidłowa",+ "automationCollectionReasonUnavailable": "Blok źródłowy jest niedostępny",+ "automationCollectionReasonUnreadable": "Nie udało się odczytać treści źródłowej","menuMouseScroll": "Przewijanie menu ruchem myszy","menuMouseScrollTip": "Gdy zawartość menu przekracza dostępną wysokość, przesuwaj mysz w górę lub w dół wewnątrz menu, aby je przewijać","aiWebSearchExaTip": "Wyszukuj strony internetowe za pomocą Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Wspólny dla Search i Fetch; zapytania i docelowe adresy URL są wysyłane do DeepSeek, a opłaty naliczane za żądanie","automationCollectionReview": "Sprawdź zebrane wpisy","automationCollectionCleanup": "Usuń niepasujące wpisy z tej strony",- "automationCollectionReviewTip": "Sprawdzane są wszystkie aktywne reguły zbierania bloków; dopasowanie do jednej wystarcza, aby zachować wpis. Powiązania ręczne i automatyczne są sprawdzane tak samo; wpisy niepowiązane lub nieokreślone pozostają",+ "automationCollectionReviewTip": "Sprawdź istniejące wpisy według wszystkich włączonych reguł zbierania bloków, stosując te same kryteria do wpisów ręcznych i automatycznych","automationCollectionCleanupConfirm": "Usuń tylko potwierdzone niepasujące wpisy z tej strony wraz z polami, również dodane ręcznie. Bloki źródłowe pozostają, a operację można cofnąć. Reguły i dopasowania zostaną sprawdzone ponownie",- "automationCollectionMatched": "Pasuje",- "automationCollectionUnmatched": "Nie pasuje",+ "automationCollectionMatched": "Spełnia reguły",+ "automationCollectionUnmatched": "Nie spełnia reguł","automationCollectionUnknown": "Nie można ustalić","blockGutterMode": "Pokaż wszystkie wskaźniki bloków","blockGutterModeTip": "Po włączeniu pokazuje wszystkie wskaźniki bieżącego bloku i jego kontenerów; po wyłączeniu używa uproszczonego widoku",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex 04341580d5..8444b55d65 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Gerenciamento de coleta",+ "automationCollectionRules": "Correspondências das regras",+ "automationCollectionEntries": "Entradas do banco de dados",+ "automationCollectionNotCollected": "Não coletado",+ "automationCollectionRemove": "Remover",+ "automationCollectionRemoveConfirm": "Remover esta entrada e os valores dos seus campos. O conteúdo de origem será mantido. Esta ação pode ser desfeita.",+ "automationCollectionReasonInvalidItem": "As informações de vínculo estão incompletas",+ "automationCollectionReasonDetached": "A entrada não está vinculada a um bloco de origem",+ "automationCollectionReasonNoRules": "Nenhuma regra de coleta de blocos ativada",+ "automationCollectionReasonInvalidRule": "Uma regra de coleta ativada é inválida",+ "automationCollectionReasonUnavailable": "O bloco de origem não está disponível",+ "automationCollectionReasonUnreadable": "Não foi possível ler o conteúdo de origem","menuMouseScroll": "Rolar menus com o movimento do mouse","menuMouseScrollTip": "Mova o mouse para cima ou para baixo dentro de um menu que exceda a altura disponível para rolar seu conteúdo","aiWebSearchExaTip": "Pesquisar páginas da web com o Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Compartilhada por Search e Fetch; consultas e URLs de destino são enviadas ao DeepSeek, com cobrança por solicitação","automationCollectionReview": "Verificar entradas coletadas","automationCollectionCleanup": "Remover entradas não correspondentes desta página",- "automationCollectionReviewTip": "Verifica todas as regras ativas de coleta de blocos; uma correspondência basta para manter a entrada. Vínculos manuais e automáticos são verificados igualmente; entradas desvinculadas ou indeterminadas são mantidas",+ "automationCollectionReviewTip": "Verificar as entradas existentes com todas as regras de coleta de blocos ativadas, usando os mesmos critérios para entradas manuais e automáticas","automationCollectionCleanupConfirm": "Remove apenas as entradas confirmadas como não correspondentes desta página e seus campos, incluindo adições manuais. Os blocos de origem são mantidos e a ação pode ser desfeita. As regras e correspondências serão verificadas novamente",- "automationCollectionMatched": "Corresponde",- "automationCollectionUnmatched": "Não corresponde",+ "automationCollectionMatched": "Atende às regras",+ "automationCollectionUnmatched": "Não atende às regras","automationCollectionUnknown": "Não foi possível determinar","blockGutterMode": "Mostrar todos os indicadores de bloco","blockGutterModeTip": "Quando ativado, mostra todos os indicadores do bloco atual e de seus contêineres; quando desativado, usa uma exibição simplificada",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex e3c5477acd..947988d6d2 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Управление сбором",+ "automationCollectionRules": "Совпадения по правилам",+ "automationCollectionEntries": "Записи базы данных",+ "automationCollectionNotCollected": "Не собрано",+ "automationCollectionRemove": "Убрать",+ "automationCollectionRemoveConfirm": "Убрать эту запись и значения её полей. Исходное содержимое сохранится. Действие можно отменить.",+ "automationCollectionReasonInvalidItem": "Данные привязки записи неполны",+ "automationCollectionReasonDetached": "Запись не привязана к исходному блоку",+ "automationCollectionReasonNoRules": "Нет включённых правил сбора блоков",+ "automationCollectionReasonInvalidRule": "Включённое правило сбора недействительно",+ "automationCollectionReasonUnavailable": "Исходный блок недоступен",+ "automationCollectionReasonUnreadable": "Не удалось прочитать исходное содержимое","menuMouseScroll": "Прокрутка меню движением мыши","menuMouseScrollTip": "Если содержимое меню превышает доступную высоту, перемещайте мышь вверх или вниз внутри меню для его прокрутки","aiWebSearchExaTip": "Поиск веб-страниц с помощью Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Общий для Search и Fetch; запросы и целевые URL отправляются в DeepSeek, оплата взимается за запрос","automationCollectionReview": "Проверить собранные записи","automationCollectionCleanup": "Убрать неподходящие записи этой страницы",- "automationCollectionReviewTip": "Проверяются все включённые правила сбора блоков; совпадения с одним достаточно для сохранения записи. Ручные и автоматические привязки проверяются одинаково; непривязанные и неопределимые записи сохраняются",+ "automationCollectionReviewTip": "Проверить существующие записи по всем включённым правилам сбора блоков; для вручную и автоматически добавленных записей действуют одинаковые критерии","automationCollectionCleanupConfirm": "Убрать только подтверждённые неподходящие записи этой страницы и их поля, включая добавленные вручную. Исходные блоки сохраняются, операцию можно отменить. Правила и совпадения будут проверены повторно",- "automationCollectionMatched": "Соответствует",- "automationCollectionUnmatched": "Не соответствует",+ "automationCollectionMatched": "Соответствует правилам",+ "automationCollectionUnmatched": "Не соответствует правилам","automationCollectionUnknown": "Невозможно определить","blockGutterMode": "Показывать все значки блоков","blockGutterModeTip": "При включении показывает все значки текущего блока и его контейнеров; при отключении используется упрощённое отображение",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex 0cb1cbf8be..99cdc5c410 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Správa zhromažďovania",+ "automationCollectionRules": "Zhody pravidiel",+ "automationCollectionEntries": "Položky databázy",+ "automationCollectionNotCollected": "Nezhromaždené",+ "automationCollectionRemove": "Odstrániť",+ "automationCollectionRemoveConfirm": "Odstrániť túto položku a hodnoty jej polí. Zdrojový obsah zostane zachovaný. Túto akciu možno vrátiť späť.",+ "automationCollectionReasonInvalidItem": "Informácie o prepojení položky sú neúplné",+ "automationCollectionReasonDetached": "Položka nie je prepojená so zdrojovým blokom",+ "automationCollectionReasonNoRules": "Nie sú zapnuté žiadne pravidlá zhromažďovania blokov",+ "automationCollectionReasonInvalidRule": "Zapnuté pravidlo zhromažďovania je neplatné",+ "automationCollectionReasonUnavailable": "Zdrojový blok nie je dostupný",+ "automationCollectionReasonUnreadable": "Zdrojový obsah sa nepodarilo prečítať","menuMouseScroll": "Posúvanie ponúk pohybom myši","menuMouseScrollTip": "Ak obsah ponuky presahuje dostupnú výšku, posúvajte ho pohybom myši nahor alebo nadol v ponuke","aiWebSearchExaTip": "Vyhľadávanie webových stránok pomocou Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Spoločný pre Search a Fetch; dopyty a cieľové URL sa odosielajú do DeepSeek a účtujú sa za požiadavku","automationCollectionReview": "Skontrolovať zozbierané položky","automationCollectionCleanup": "Odstrániť nevyhovujúce položky tejto stránky",- "automationCollectionReviewTip": "Kontrolujú sa všetky aktívne pravidlá zbierania blokov; zhoda s jedným stačí na zachovanie položky. Ručné aj automatické prepojenia sa kontrolujú rovnako; neprepojené alebo neurčiteľné položky zostávajú",+ "automationCollectionReviewTip": "Skontrolovať existujúce položky podľa všetkých zapnutých pravidiel zhromažďovania blokov; ručne a automaticky pridané položky majú rovnaké kritériá","automationCollectionCleanupConfirm": "Odstrániť iba potvrdené nevyhovujúce položky tejto stránky aj s poľami vrátane ručne pridaných. Zdrojové bloky zostanú zachované a operáciu možno vrátiť späť. Pravidlá a zhody sa znova skontrolujú",- "automationCollectionMatched": "Vyhovuje",- "automationCollectionUnmatched": "Nevyhovuje",+ "automationCollectionMatched": "Spĺňa pravidlá",+ "automationCollectionUnmatched": "Nespĺňa pravidlá","automationCollectionUnknown": "Nedá sa určiť","blockGutterMode": "Zobraziť všetky indikátory blokov","blockGutterModeTip": "Po zapnutí zobrazuje všetky indikátory aktuálneho bloku a jeho kontajnerov; po vypnutí používa zjednodušené zobrazenie",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex 21c9c1d5b8..9ce1a75146 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Управљање прикупљањем",+ "automationCollectionRules": "Подударања правила",+ "automationCollectionEntries": "Ставке базе података",+ "automationCollectionNotCollected": "Није прикупљено",+ "automationCollectionRemove": "Уклони",+ "automationCollectionRemoveConfirm": "Уклонити ову ставку и вредности њених поља. Изворни садржај остаје сачуван. Ова радња се може опозвати.",+ "automationCollectionReasonInvalidItem": "Подаци о повезивању ставке су непотпуни",+ "automationCollectionReasonDetached": "Ставка није повезана са изворним блоком",+ "automationCollectionReasonNoRules": "Нема укључених правила за прикупљање блокова",+ "automationCollectionReasonInvalidRule": "Укључено правило прикупљања није исправно",+ "automationCollectionReasonUnavailable": "Изворни блок није доступан",+ "automationCollectionReasonUnreadable": "Изворни садржај није могуће прочитати","menuMouseScroll": "Померање менија покретом миша","menuMouseScrollTip": "Када садржај менија премашује доступну висину, померајте миша нагоре или надоле унутар менија да бисте померали садржај","aiWebSearchExaTip": "Претражујте веб странице помоћу услуге Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Заједнички за Search и Fetch; упити и циљни URL-ови шаљу се DeepSeek-у и наплаћују по захтеву","automationCollectionReview": "Провери прикупљене ставке","automationCollectionCleanup": "Уклони неподударне ставке са ове странице",- "automationCollectionReviewTip": "Проверавају се сва активна правила прикупљања блокова; подударање са једним чува ставку. Ручна и аутоматска повезивања проверавају се једнако; неповезане и неодредиве ставке се чувају",+ "automationCollectionReviewTip": "Провери постојеће ставке према свим укљученим правилима прикупљања блокова; ручно и аутоматски додате ставке имају исте критеријуме","automationCollectionCleanupConfirm": "Уклони само потврђене неподударне ставке са ове странице и њихова поља, укључујући ручно додате. Изворни блокови се чувају, а радња се може опозвати. Правила и подударања биће поново проверени",- "automationCollectionMatched": "Подудара се",- "automationCollectionUnmatched": "Не подудара се",+ "automationCollectionMatched": "Испуњава правила",+ "automationCollectionUnmatched": "Не испуњава правила","automationCollectionUnknown": "Није могуће одредити","blockGutterMode": "Прикажи све ознаке блокова","blockGutterModeTip": "Када је омогућено, приказује све ознаке тренутног блока и његових контејнера; када је онемогућено, користи сажети приказ",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex f2fc2e5138..5e5b5b75b6 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "จัดการการรวบรวม",+ "automationCollectionRules": "ผลที่ตรงกับกฎ",+ "automationCollectionEntries": "รายการฐานข้อมูล",+ "automationCollectionNotCollected": "ยังไม่ได้รวบรวม",+ "automationCollectionRemove": "นำออก",+ "automationCollectionRemoveConfirm": "นำรายการนี้และค่าของฟิลด์ออก โดยเก็บเนื้อหาต้นฉบับไว้ การดำเนินการนี้สามารถเลิกทำได้",+ "automationCollectionReasonInvalidItem": "ข้อมูลการเชื่อมโยงรายการไม่ครบถ้วน",+ "automationCollectionReasonDetached": "รายการไม่ได้เชื่อมโยงกับบล็อกต้นฉบับ",+ "automationCollectionReasonNoRules": "ไม่มีกฎรวบรวมบล็อกที่เปิดใช้งาน",+ "automationCollectionReasonInvalidRule": "มีกฎรวบรวมที่เปิดใช้งานแต่ไม่ถูกต้อง",+ "automationCollectionReasonUnavailable": "บล็อกต้นฉบับไม่พร้อมใช้งาน",+ "automationCollectionReasonUnreadable": "ไม่สามารถอ่านเนื้อหาต้นฉบับได้","menuMouseScroll": "เลื่อนเมนูตามการเคลื่อนไหวของเมาส์","menuMouseScrollTip": "เมื่อเนื้อหาเมนูเกินความสูงที่แสดงได้ ให้เลื่อนเมาส์ขึ้นหรือลงภายในเมนูเพื่อเลื่อนเนื้อหา","aiWebSearchExaTip": "ค้นหาหน้าเว็บด้วย Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "ใช้ร่วมกันระหว่าง Search และ Fetch โดยส่งคำค้นและ URL เป้าหมายไปยัง DeepSeek และคิดค่าบริการต่อคำขอ","automationCollectionReview": "ตรวจสอบรายการที่รวบรวม","automationCollectionCleanup": "นำรายการที่ไม่ตรงเงื่อนไขในหน้านี้ออก",- "automationCollectionReviewTip": "ตรวจสอบกฎรวบรวมบล็อกที่เปิดใช้ทั้งหมด หากตรงกับกฎใดกฎหนึ่งจะเก็บรายการไว้ ตรวจสอบรายการที่ผูกด้วยตนเองและอัตโนมัติเท่าเทียมกัน และเก็บรายการที่ไม่ผูกหรือไม่สามารถระบุได้ไว้",+ "automationCollectionReviewTip": "ตรวจสอบรายการที่มีอยู่ตามกฎรวบรวมบล็อกที่เปิดใช้งานทั้งหมด โดยใช้เกณฑ์เดียวกันกับรายการที่เพิ่มด้วยตนเองและแบบอัตโนมัติ","automationCollectionCleanupConfirm": "นำออกเฉพาะรายการในหน้านี้ที่ยืนยันแล้วว่าไม่ตรงเงื่อนไขพร้อมเขตข้อมูล รวมถึงรายการที่เพิ่มเอง บล็อกต้นฉบับจะยังอยู่และสามารถเลิกทำได้ ระบบจะตรวจสอบกฎและสถานะอีกครั้งก่อนดำเนินการ",- "automationCollectionMatched": "ตรงเงื่อนไข",- "automationCollectionUnmatched": "ไม่ตรงเงื่อนไข",+ "automationCollectionMatched": "ตรงตามกฎ",+ "automationCollectionUnmatched": "ไม่ตรงตามกฎ","automationCollectionUnknown": "ไม่สามารถระบุได้","blockGutterMode": "แสดงตัวบ่งชี้บล็อกทั้งหมด","blockGutterModeTip": "เมื่อเปิดใช้งานจะแสดงตัวบ่งชี้ทั้งหมดของบล็อกปัจจุบันและคอนเทนเนอร์ที่ครอบบล็อกนั้น เมื่อปิดใช้งานจะแสดงแบบย่อ",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 6dad982807..33b221ae68 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Toplama yönetimi",+ "automationCollectionRules": "Kural eşleşmeleri",+ "automationCollectionEntries": "Veritabanı girdileri",+ "automationCollectionNotCollected": "Toplanmadı",+ "automationCollectionRemove": "Kaldır",+ "automationCollectionRemoveConfirm": "Bu girdiyi ve alan değerlerini kaldırın. Kaynak içerik korunur. Bu işlem geri alınabilir.",+ "automationCollectionReasonInvalidItem": "Girdinin bağlantı bilgileri eksik",+ "automationCollectionReasonDetached": "Girdi kaynak bloğa bağlı değil",+ "automationCollectionReasonNoRules": "Etkin blok toplama kuralı yok",+ "automationCollectionReasonInvalidRule": "Etkin bir toplama kuralı geçersiz",+ "automationCollectionReasonUnavailable": "Kaynak blok kullanılamıyor",+ "automationCollectionReasonUnreadable": "Kaynak içerik okunamadı","menuMouseScroll": "Menüleri fare hareketiyle kaydır","menuMouseScrollTip": "Menü içeriği kullanılabilir yüksekliği aştığında, içeriği kaydırmak için fareyi menü içinde yukarı veya aşağı hareket ettirin","aiWebSearchExaTip": "Exa ile web sayfalarını arayın",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Search ve Fetch için ortaktır; sorgular ve hedef URL'ler DeepSeek'e gönderilir ve istek başına ücretlendirilir","automationCollectionReview": "Toplanan kayıtları incele","automationCollectionCleanup": "Bu sayfadaki eşleşmeyen kayıtları kaldır",- "automationCollectionReviewTip": "Etkin tüm blok toplama kuralları denetlenir; herhangi biriyle eşleşen kayıt korunur. Elle ve otomatik bağlanan kayıtlar aynı şekilde denetlenir; bağımsız veya belirlenemeyen kayıtlar korunur",+ "automationCollectionReviewTip": "Mevcut girdileri etkin tüm blok toplama kurallarına göre denetleyin; elle ve otomatik eklenen girdiler için aynı ölçütler kullanılır","automationCollectionCleanupConfirm": "Bu sayfada eşleşmediği onaylanan kayıtları ve alanlarını, elle eklenenler dahil kaldır. Kaynak bloklar korunur ve işlem geri alınabilir. Kaldırmadan önce kurallar ve eşleşmeler yeniden denetlenir",- "automationCollectionMatched": "Eşleşiyor",- "automationCollectionUnmatched": "Eşleşmiyor",+ "automationCollectionMatched": "Kurallara uyuyor",+ "automationCollectionUnmatched": "Kurallara uymuyor","automationCollectionUnknown": "Belirlenemiyor","blockGutterMode": "Tüm blok göstergelerini göster","blockGutterModeTip": "Etkinleştirildiğinde geçerli bloğun ve kapsayıcılarının tüm göstergelerini gösterir; devre dışı bırakıldığında sade bir görünüm kullanır",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex 9d4c851ed8..e98a6b1cbc 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "Керування збиранням",+ "automationCollectionRules": "Збіги за правилами",+ "automationCollectionEntries": "Записи бази даних",+ "automationCollectionNotCollected": "Не зібрано",+ "automationCollectionRemove": "Вилучити",+ "automationCollectionRemoveConfirm": "Вилучити цей запис і значення його полів. Початковий вміст буде збережено. Цю дію можна скасувати.",+ "automationCollectionReasonInvalidItem": "Дані прив’язки запису неповні",+ "automationCollectionReasonDetached": "Запис не прив’язано до початкового блока",+ "automationCollectionReasonNoRules": "Немає ввімкнених правил збирання блоків",+ "automationCollectionReasonInvalidRule": "Увімкнене правило збирання недійсне",+ "automationCollectionReasonUnavailable": "Початковий блок недоступний",+ "automationCollectionReasonUnreadable": "Не вдалося прочитати початковий вміст","menuMouseScroll": "Прокручування меню рухом миші","menuMouseScrollTip": "Якщо вміст меню перевищує доступну висоту, рухайте мишу вгору або вниз усередині меню, щоб прокручувати його вміст","aiWebSearchExaTip": "Пошук вебсторінок за допомогою Exa",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Спільний для Search і Fetch; запити й цільові URL надсилаються до DeepSeek, оплата стягується за запит","automationCollectionReview": "Перевірити зібрані записи","automationCollectionCleanup": "Прибрати невідповідні записи цієї сторінки",- "automationCollectionReviewTip": "Перевіряються всі ввімкнені правила збирання блоків; відповідності одному досить для збереження запису. Ручні й автоматичні прив’язки перевіряються однаково; непов’язані й невизначені записи зберігаються",+ "automationCollectionReviewTip": "Перевірити наявні записи за всіма ввімкненими правилами збирання блоків; для вручну й автоматично доданих записів діють однакові критерії","automationCollectionCleanupConfirm": "Прибрати лише підтверджені невідповідні записи цієї сторінки та їхні поля, включно з доданими вручну. Вихідні блоки зберігаються, дію можна скасувати. Правила й відповідність буде перевірено повторно",- "automationCollectionMatched": "Відповідає",- "automationCollectionUnmatched": "Не відповідає",+ "automationCollectionMatched": "Відповідає правилам",+ "automationCollectionUnmatched": "Не відповідає правилам","automationCollectionUnknown": "Неможливо визначити","blockGutterMode": "Показувати всі значки блоків","blockGutterModeTip": "Коли ввімкнено, показує всі значки поточного блоку та його контейнерів; коли вимкнено, використовує спрощене відображення",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 7f76979145..462e9383fd 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "收集管理",+ "automationCollectionRules": "规则匹配",+ "automationCollectionEntries": "数据库条目",+ "automationCollectionNotCollected": "未收集",+ "automationCollectionRemove": "移出",+ "automationCollectionRemoveConfirm": "移出该条目及其字段,保留原文。此操作可撤销。",+ "automationCollectionReasonInvalidItem": "条目绑定信息不完整",+ "automationCollectionReasonDetached": "条目未绑定原始块",+ "automationCollectionReasonNoRules": "没有启用的普通块收集规则",+ "automationCollectionReasonInvalidRule": "存在无效的已启用收集规则",+ "automationCollectionReasonUnavailable": "原始块不可用",+ "automationCollectionReasonUnreadable": "无法读取原始内容","menuMouseScroll": "菜单跟随鼠标滚动","menuMouseScrollTip": "菜单内容超出可用高度时,在菜单内上下移动鼠标即可滚动菜单内容","aiWebSearchExaTip": "通过 Exa 搜索网页",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Search 与 Fetch 共用,搜索词和目标 URL 会发送给 DeepSeek,按请求计费","automationCollectionReview": "检查收集结果","automationCollectionCleanup": "移出本页不匹配条目",- "automationCollectionReviewTip": "按全部启用的普通块收集规则检查,符合任一规则即保留;手动和自动绑定条目统一检查,游离或无法判断的条目保留",+ "automationCollectionReviewTip": "按全部启用的普通块收集规则检查已有条目,手动和自动收集的条目采用相同标准","automationCollectionCleanupConfirm": "将移出本页中确认不匹配的条目,包括手动添加的条目及其字段。原文保留,操作可撤销;执行前会重新检查规则和匹配状态",- "automationCollectionMatched": "仍然匹配",- "automationCollectionUnmatched": "不再匹配",+ "automationCollectionMatched": "符合规则",+ "automationCollectionUnmatched": "不符合规则","automationCollectionUnknown": "无法判断","blockGutterMode": "显示完整块标","blockGutterModeTip": "启用后显示当前块及其所属容器的全部块标,关闭时精简显示",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex fd2dda36f1..24359e6aaf 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,16 @@{+ "automationCollectionManage": "收集管理",+ "automationCollectionRules": "規則匹配",+ "automationCollectionEntries": "資料庫條目",+ "automationCollectionNotCollected": "未收集",+ "automationCollectionRemove": "移出",+ "automationCollectionRemoveConfirm": "移出此條目及其欄位,保留原文。此操作可復原。",+ "automationCollectionReasonInvalidItem": "條目繫結資訊不完整",+ "automationCollectionReasonDetached": "條目未繫結原始區塊",+ "automationCollectionReasonNoRules": "沒有啟用的一般區塊收集規則",+ "automationCollectionReasonInvalidRule": "存在無效的已啟用收集規則",+ "automationCollectionReasonUnavailable": "原始區塊無法使用",+ "automationCollectionReasonUnreadable": "無法讀取原始內容","menuMouseScroll": "選單隨滑鼠移動捲動","menuMouseScrollTip": "選單內容超出可用高度時,在選單內上下移動滑鼠即可捲動選單內容","aiWebSearchExaTip": "透過 Exa 搜尋網頁",@@ -13,10 +25,10 @@"aiWebDeepSeekKeyTip": "Search 與 Fetch 共用,搜尋詞和目標 URL 會傳送給 DeepSeek,按請求計費","automationCollectionReview": "檢查收集結果","automationCollectionCleanup": "移出本頁不相符項目",- "automationCollectionReviewTip": "依全部啟用的一般區塊收集規則檢查,符合任一規則即保留;手動和自動繫結項目統一檢查,游離或無法判斷的項目保留",+ "automationCollectionReviewTip": "按全部啟用的一般區塊收集規則檢查既有條目,手動和自動收集的條目採用相同標準","automationCollectionCleanupConfirm": "將移出本頁中確認不相符的項目,包括手動新增的項目及其欄位。原文保留,操作可復原;執行前會重新檢查規則與比對狀態",- "automationCollectionMatched": "仍然相符",- "automationCollectionUnmatched": "不再相符",+ "automationCollectionMatched": "符合規則",+ "automationCollectionUnmatched": "不符合規則","automationCollectionUnknown": "無法判斷","blockGutterMode": "顯示完整區塊標","blockGutterModeTip": "啟用後顯示目前區塊及其所屬容器的所有區塊標,關閉時精簡顯示",diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.syindex 3890f82410..e0443e2fa1 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy@@ -7,7 +7,7 @@"id": "20240208172514-9dsv6na","title": "Database","type": "doc",- "updated": "20261018120429"+ "updated": "20261018122129"},"Children": [{@@ -4610,12 +4610,30 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-u9c28d4",- "updated": "20261018000619"+ "updated": "20261018122129"},"Children": [{"Type": "NodeText",- "Data": "Use Review collected entries in block collection settings to check existing entries against all enabled block collection rules. Manual and automatically collected bound entries are checked alike; matching any rule keeps an entry. Detached entries, unavailable sources, and entries without usable rules remain unchanged. Remove unmatched entries on this page previews the count and asks for confirmation. Execution rechecks the rules, source, and binding before removing only entries confirmed unmatched, including their field values; source blocks remain. Undo and redo restore the original entry IDs and all fields. After explicit removal, a later new match creates an initialized entry instead of recovering the removed field values. Collection and cleanup commit or roll back with their transaction."+ "Data": "Open "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Automations"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Collection management"+ },+ {+ "Type": "NodeText",+ "Data": " and select Database entries to check all existing entries against the union of enabled block collection rules. Manual and automatically collected entries are checked alike. Matches rules, Does not match rules, and Cannot determine have separate counts and pages; the first opening prioritizes entries that do not match. Unknown entries explain why they cannot be classified. Remove unmatched entries on this page confirms the count and rechecks rules, sources, and bindings before removing only entries still confirmed unmatched. Nonmatching and unknown entries also offer individual removal. Removal keeps source blocks and supports undo and redo of the original entry IDs, fields, and ordering. Missing source blocks are not recreated; read or authentication failures preserve the data and return an error. A later new match creates an initialized entry rather than recovering removed field values."}]},@@ -4624,12 +4642,30 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-1ymbtr0",- "updated": "20261016202856"+ "updated": "20261018122129"},"Children": [{"Type": "NodeText",- "Data": "Enabling or editing a rule does not collect existing blocks. Enable the completed rule and open “Preview matching blocks” to inspect the source documents and existing bindings. “Collect matches on this page” collects the displayed matches that are not already bound. Use the page controls to review further results; each page contains at most 100 blocks and may be smaller when many fields are initialized."+ "Data": "Enabling or editing a rule does not collect existing blocks. In "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Automations"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Collection management"+ },+ {+ "Type": "NodeText",+ "Data": " select Rule matches and choose an enabled collection rule to inspect matching source blocks and their collected or uncollected status. Collect matches on this page adds only the displayed uncollected matches. The page controls show the current page number. Each preview page contains at most 100 blocks and may be smaller when many fields are initialized."}]},diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.syindex ad9efc7e6d..8c2ce09a0b 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy@@ -7,7 +7,7 @@"id": "20240208113259-nykkvaq","title": "数据库","type": "doc",- "updated": "20261018120429"+ "updated": "20261018122207"},"Children": [{@@ -4610,12 +4610,30 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-jtlpv7x",- "updated": "20261018000619"+ "updated": "20261018122129"},"Children": [{"Type": "NodeText",- "Data": "在普通块收集设置中点击「检查收集结果」,按全部启用的普通块收集规则检查已有条目。手动和自动绑定条目统一检查,符合任一规则即保留;游离、原文不可用、没有可用规则或无法判断的条目均保留。「移出本页不匹配条目」会显示数量并要求确认,执行前重新检查规则、原文及绑定关系,仅移出确认不匹配的条目及其字段,保留原文。撤销和重做恢复原条目 ID 和全部字段。主动移出后再发生新的匹配会创建并初始化新条目,不恢复已移出的字段值。自动收集和主动清理随各自事务一起提交或回滚。"+ "Data": "打开 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "自动化"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "收集管理"+ },+ {+ "Type": "NodeText",+ "Data": ",选择「数据库条目」,按全部启用的普通块收集规则的并集检查已有条目,手动和自动收集的条目采用相同标准。「符合规则」「不符合规则」「无法判断」分别显示数量并独立分页,首次优先显示不符合规则的条目。无法判断的条目会说明原因。「移出本页不匹配条目」会显示数量并要求确认,执行前重新检查规则、原文及绑定关系,仅移出仍明确不匹配的本页条目。不符合规则和无法判断的条目还可逐项移出。移出保留原文,撤销和重做恢复原条目 ID、字段及顺序;源块缺失时不会重建原始块,读取或认证失败时保留数据并返回错误。主动移出后再发生新的匹配会创建并初始化新条目,不恢复已移出的字段值。"}]},@@ -4624,12 +4642,30 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-7sdwuop",- "updated": "20261016202635"+ "updated": "20261018122207"},"Children": [{"Type": "NodeText",- "Data": "启用或修改规则不会自动补收旧内容。配置完整并启用后,打开“预览匹配块”,检查来源文档和是否已收集;“收集本页匹配块”只加入当前页尚未绑定的块。可翻页继续检查,每页最多 100 个块,初始化字段较多时每页数量会相应减少。"+ "Data": "启用或编辑规则不会收集已有块。在 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "自动化"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "收集管理"+ },+ {+ "Type": "NodeText",+ "Data": " 中选择「规则匹配」,再选择已启用的收集规则,查看匹配块及其已收集或未收集状态。「收集本页匹配块」仅收集当前页中尚未收集的块。分页控件显示当前页码,每页最多 100 个块,初始化字段较多时会缩小页大小。"}]},diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.syindex 73aad63766..56af539f6d 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy@@ -7,7 +7,7 @@"id": "20240208171522-y7dxcno","title": "資料庫","type": "doc",- "updated": "20261018120429"+ "updated": "20261018122207"},"Children": [{@@ -4610,12 +4610,30 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-3djfm18",- "updated": "20261018000619"+ "updated": "20261018122207"},"Children": [{"Type": "NodeText",- "Data": "在普通區塊收集設定中點擊「檢查收集結果」,按全部啟用的普通區塊收集規則檢查既有條目。手動和自動繫結條目統一檢查,符合任一規則即保留;游離、原文無法使用、沒有可用規則或無法判斷的條目均保留。「移出本頁不匹配條目」會顯示數量並要求確認,執行前重新檢查規則、原文及繫結關係,僅移出確認不匹配的條目及其欄位,保留原文。復原及重做恢復原條目 ID 和全部欄位。主動移出後再發生新的匹配會建立並初始化新條目,不恢復已移出的欄位值。自動收集和主動清理隨各自交易一起提交或回滾。"+ "Data": "開啟 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "自動化"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "收集管理"+ },+ {+ "Type": "NodeText",+ "Data": ",選擇「資料庫條目」,按全部啟用的一般區塊收集規則的聯集檢查既有條目,手動和自動收集的條目採用相同標準。「符合規則」「不符合規則」「無法判斷」分別顯示數量並獨立分頁,首次優先顯示不符合規則的條目。無法判斷的條目會說明原因。「移出本頁不匹配條目」會顯示數量並要求確認,執行前重新檢查規則、原文及繫結關係,僅移出仍明確不匹配的本頁條目。不符合規則和無法判斷的條目還可逐項移出。移出保留原文,復原及重做恢復原條目 ID、欄位及順序;原始區塊缺失時不會重建,讀取或驗證失敗時保留資料並傳回錯誤。主動移出後再發生新的匹配會建立並初始化新條目,不恢復已移出的欄位值。"}]},@@ -4624,12 +4642,30 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-8hkobl6",- "updated": "20261016202635"+ "updated": "20261018122207"},"Children": [{"Type": "NodeText",- "Data": "啟用或修改規則不會自動補收舊內容。設定完整並啟用後,開啟「預覽符合的區塊」,檢查來源文件與是否已收集;「收集本頁符合的區塊」只加入目前頁面尚未綁定的區塊。可翻頁繼續檢查,每頁最多 100 個區塊,初始化欄位較多時每頁數量會相應減少。"+ "Data": "啟用或編輯規則不會收集既有區塊。在 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "自動化"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "收集管理"+ },+ {+ "Type": "NodeText",+ "Data": " 中選擇「規則匹配」,再選擇已啟用的收集規則,查看匹配區塊及其已收集或未收集狀態。「收集本頁符合的區塊」僅收集目前頁面中尚未收集的區塊。分頁控制項顯示目前頁碼,每頁最多 100 個區塊,初始化欄位較多時會縮小頁面大小。"}]},diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.syindex 229f9c7337..3d9ceacbb6 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy@@ -8,7 +8,7 @@"id": "20240530101000-3eaevtp","title": "データベース","type": "doc",- "updated": "20261018120429"+ "updated": "20261018122207"},"Children": [{@@ -4620,12 +4620,26 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-kpasryz",- "updated": "20261018000619"+ "updated": "20261018122207"},"Children": [+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "自動化"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "収集管理"+ },{"Type": "NodeText",- "Data": "通常ブロックの収集設定にある「収集結果を確認」で、すべての有効な通常ブロック収集ルールに対して既存項目を確認できます。手動・自動でバインドした項目を同じ基準で確認し、いずれかのルールに一致すれば保持します。未バインド項目、原文が利用できない項目、利用可能なルールがない項目、判定できない項目も保持します。「このページの不一致項目を除去」で件数を確認してから実行します。実行前にルール・原文・バインド先を再確認し、不一致が確定した項目とフィールドだけを除去します。元のブロックは残します。元に戻す操作とやり直しで元の項目 ID とすべてのフィールドを復元できます。明示的な除去後に新たな一致が発生すると、初期化した新しい項目を作成し、除去したフィールド値は復元しません。自動収集と明示的な整理は、それぞれのトランザクションと一緒に確定またはロールバックされます。"+ "Data": " を開き、「データベース項目」で有効な通常ブロック収集ルールの和集合に対して既存項目を確認します。手動と自動で収集した項目を同じ基準で判定します。「ルールに一致」「ルールに不一致」「判定不能」はそれぞれ件数と独立したページを持ち、初回は不一致の項目を優先表示します。判定不能の項目には理由を表示します。「このページの不一致項目を除去」は件数の確認後、ルール・原文・バインド先を再確認し、不一致が確定した現在のページの項目だけを除去します。不一致と判定不能の項目は個別にも除去できます。原文は保持され、元に戻す操作とやり直しで元の項目 ID、フィールド、順序を復元できます。失われた元のブロックは再作成しません。読み取りや認証に失敗した場合はデータを保持してエラーを返します。除去後に新たな一致が発生すると、初期化した新しい項目を作成し、除去したフィールド値は復元しません。"}]},@@ -4634,12 +4648,30 @@"Type": "NodeParagraph","Properties": {"id": "20261015141042-ew0zsib",- "updated": "20261016202856"+ "updated": "20261018122207"},"Children": [{"Type": "NodeText",- "Data": "ルールの有効化や編集では既存内容を自動収集しません。設定を完了して有効にした後、「一致するブロックをプレビュー」で元の文書と収集状況を確認します。「このページの一致ブロックを収集」は表示中の未バインドのブロックだけを追加します。ページを切り替えて続きも確認できます。各ページは最大 100 ブロックで、初期化するフィールドが多い場合は件数が少なくなります。"+ "Data": "ルールを有効化または編集しても既存ブロックは収集しません。"+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "自動化"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "収集管理"+ },+ {+ "Type": "NodeText",+ "Data": " で「ルールの一致」を選び、有効な収集ルールを選択して、一致するブロックと収集済み・未収集の状態を確認します。「このページの一致ブロックを収集」は表示中の未収集ブロックだけを収集します。ページ操作部には現在のページ番号を表示します。1 ページは最大 100 個のブロックで、初期化するフィールドが多い場合は少なくなります。"}]},diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scssindex c96e4c6306..060591ad70 100644--- a/app/src/assets/scss/business/_av.scss+++ b/app/src/assets/scss/business/_av.scss@@ -3357,3 +3357,36 @@ img.av__cellassetimg {flex-shrink: 0;}}++.av__collection-manager {+ display: flex;+ flex-direction: column;+ gap: 16px;++ .layout-tab-bar {+ flex-shrink: 0;+ }++ .item {+ min-width: 0;+ height: auto;+ min-height: 40px;++ .item__text {+ white-space: normal;+ overflow-wrap: anywhere;+ }+ }+}++.av__collection-item {+ display: flex;+ flex-direction: row;+ align-items: flex-start;+ gap: 8px;++ > .b3-button {+ flex-shrink: 0;+ max-width: 40%;+ }+}diff --git a/app/src/protyle/render/av/automation.ts b/app/src/protyle/render/av/automation.tsindex d9f2b34828..95d3d2ac50 100644--- a/app/src/protyle/render/av/automation.ts+++ b/app/src/protyle/render/av/automation.ts@@ -9,10 +9,10 @@ import {closeInlineFilterDropdowns} from "./filterDropdown";import {bindFieldLunarDates, genFieldValue, getRelationOptions, getSelectedOptionsHTML, getValueInputHTML, openFieldRelationMenu, openFieldSelectMenu, renderRelationFieldValue, openFieldLocationEditor} from "./fieldValueEditor";import {createAVLocationReplacement} from "./locationValue";import {openSearchAV} from "./relation";-import {collectionSourceIncomplete, mountBlockCollectionSource, openBlockCollectionPreview} from "./blockCollection";+import {collectionSourceIncomplete, mountBlockCollectionSource} from "./blockCollection";import {automationTimeZone, mountAutomationTemplate} from "./automationTemplate";import {openAutomationRules} from "./automationRules";-import {openCollectionReview} from "./collectionReview";+import {openCollectionManager} from "./collectionReview";interface AutomationValue extends Omit<AVAutomationValueInput, "value"> {value?: IAVCellValue;@@ -69,6 +69,7 @@ export const openAutomationMenu = async (options: {</button><button class="b3-menu__separator"></button><div class="av__automation">+ <button type="button" class="b3-button b3-button--outline b3-button--wrap" data-action="manage-collection">${lang.automationCollectionManage}</button><div class="av__automation-body" data-body></div></div></div>`;const panel = menuElement.querySelector<HTMLElement>(".av__automation");@@ -89,7 +90,12 @@ export const openAutomationMenu = async (options: {menuElement.querySelector<HTMLElement>('[data-type="go-config"]').click();}};- panel.addEventListener("click", event => event.stopPropagation());+ panel.addEventListener("click", event => {+ if ((event.target as Element).closest('[data-action="manage-collection"]')) {+ void openCollectionManager(protyle, avID, blockElement.dataset.nodeId);+ }+ event.stopPropagation();+ });panel.addEventListener("change", event => event.stopPropagation());onResize();const response = await fetchSyncPost("/api/av/getAttributeView", {id: avID});@@ -187,10 +193,6 @@ export const openAutomationMenu = async (options: {if (enabled && rule) {enabled.checked = rule.enabled;}- const preview = body.querySelector<HTMLButtonElement>('[data-action="preview-collection"]');- if (preview) {- preview.disabled = !rule?.enabled || !!issue;- }};const save = (rule = rules[index]) => {// 不完整规则保留配置并停用,补全后由用户显式启用,避免编辑中途开始执行。@@ -325,7 +327,7 @@ ${rule.trigger === "block" ? `<div class="ft__on-surface ft__smaller av__automat${rule.trigger === "changed" ? `<div class="ft__on-surface ft__smaller av__automation-tip">${lang.automationChangedTip}</div>` : ""}</section><section class="av__automation-section"><div class="av__automation-row ft__b"><span class="ft__on-surface av__automation-section-index">2</span><span class="av__automation-section-title">${rule.trigger === "block" ? lang.automationBlockConditions : lang.automationConditions}</span></div>${rule.trigger === "block" ? "" : `<div class="ft__on-surface ft__smaller av__automation-tip">${lang.automationConditionsTip}</div>`}<div data-source-conditions></div></section>-<section class="av__automation-section"><div class="av__automation-row ft__b"><span class="ft__on-surface av__automation-section-index">3</span><span class="av__automation-section-title">${lang.automationThen}</span></div><div data-actions></div>${rule.trigger === "block" ? `<button type="button" class="b3-button b3-button--outline" data-action="preview-collection"${rule.enabled ? "" : " disabled"}>${lang.automationCollectionPreview}</button><button type="button" class="b3-button b3-button--cancel b3-button--wrap" data-action="review-collection">${lang.automationCollectionReview}</button>` : `<button type="button" class="b3-button b3-button--cancel" data-action="add-action"><svg><use xlink:href="#iconAdd"></use></svg>${lang.automationAddAction}</button>`}</section>` : ""}`;+<section class="av__automation-section"><div class="av__automation-row ft__b"><span class="ft__on-surface av__automation-section-index">3</span><span class="av__automation-section-title">${lang.automationThen}</span></div><div data-actions></div>${rule.trigger === "block" ? "" : `<button type="button" class="b3-button b3-button--cancel" data-action="add-action"><svg><use xlink:href="#iconAdd"></use></svg>${lang.automationAddAction}</button>`}</section>` : ""}`;if (!rule) {onResize();scrollElement.scrollTop = scrollTop;@@ -407,8 +409,6 @@ ${iconButton("remove-field", "iconClose", lang.delete, true, true)}`;} else if (target.matches("[data-enabled]")) {rule.enabled = target.checked;save();- const preview = body.querySelector<HTMLButtonElement>('[data-action="preview-collection"]');- if (preview) { preview.disabled = !rule.enabled; }return;} else if (target.matches("[data-trigger]")) {const wasBlock = rule.trigger === "block";@@ -501,12 +501,6 @@ ${iconButton("remove-field", "iconClose", lang.delete, true, true)}`;void render();});return;- case "preview-collection":- void openBlockCollectionPreview(protyle, avID, blockElement.dataset.nodeId, rule.id);- return;- case "review-collection":- void openCollectionReview(protyle, avID, blockElement.dataset.nodeId);- return;case "add-rule":rules.push(createRule());index = rules.length - 1;diff --git a/app/src/protyle/render/av/blockCollection.test.ts b/app/src/protyle/render/av/blockCollection.test.tsindex f9df86e559..8f45dc327d 100644--- a/app/src/protyle/render/av/blockCollection.test.ts+++ b/app/src/protyle/render/av/blockCollection.test.ts@@ -29,52 +29,3 @@ test("collection type selection replaces overlapping parents and preserves indepassert.deepEqual(toggle(["h:h1"], "h:h2"), ["h:h1", "h:h2"]);assert.deepEqual(toggle(["callout:WARNING"], "callout:WARNING"), []);});--test("collection preview is read-only and explicit collection uses only unbound previewed IDs", async () => {- const listeners = new Map<string, () => Promise<void>>();- const elements = new Map<string, {disabled: boolean, innerHTML: string, addEventListener: (name: string, callback: () => Promise<void>) => void}>();- ["[data-prev]", "[data-next]", "[data-collect]", "[data-results]"].forEach(selector => elements.set(selector, {- disabled: false, innerHTML: "", addEventListener: (_name, callback) => listeners.set(selector, callback),- }));- const performed: IOperation[] = [];- let fetches = 0;- let waits = 0;- const methods = {} as typeof import("./blockCollection");- runInNewContext(compiled, {- exports: methods,- window: {siyuan: {languages: {automationCollectionCollected: "Collected"}}},- require: (name: string) => ({- "../../../dialog": {Dialog: class {element = {isConnected: true, querySelector: (selector: string) => elements.get(selector)};}},- "../../../util/functions": {isMobile: () => true},- "../../../util/escape": {escapeAttr: String, escapeHtml: String},- "../../util/transactionQueue": {waitForPendingTransactions: async () => { waits++; }},- "../../../util/fetch": {fetchSyncPost: async (path: string, request: {avID: string, ruleID: string, page: number}) => {- assert.equal(path, "/api/av/previewAttributeViewCollection");- assert.deepEqual(JSON.parse(JSON.stringify(request)), {avID: "database", ruleID: "rule", page: 1});- fetches++;- return {code: 0, data: {hasMore: true, blocks: [- {id: "manual", content: "Manual", hPath: "/Notes", collected: true},- {id: "new", content: "New", hPath: "/Notes", collected: performed.length > 0},- ]}};- }},- "../../wysiwyg/transaction": {transaction: (_protyle: IProtyle, operations: IOperation[], inverse: IOperation[]) => {- assert.equal(inverse.length, 1);- performed.push(...operations);- }},- })[name] || {},- });- await methods.openBlockCollectionPreview({} as IProtyle, "database", "carrier", "rule");- assert.equal(performed.length, 0);- assert.equal(fetches, 1);- assert.equal(elements.get("[data-prev]").disabled, true);- assert.equal(elements.get("[data-next]").disabled, false);- assert.match(elements.get("[data-results]").innerHTML, /Manual/);- const first = listeners.get("[data-collect]")();- await listeners.get("[data-collect]")();- await first;- assert.equal(performed.length, 1);- assert.deepEqual(JSON.parse(JSON.stringify(performed[0])), {action: "collectAttrViewBlocks", avID: "database", blockID: "carrier", data: {ruleID: "rule", blockIDs: ["new"]}});- assert.equal(fetches, 2);- assert.equal(waits, 2);- assert.equal(elements.get("[data-collect]").disabled, true);-});diff --git a/app/src/protyle/render/av/blockCollection.ts b/app/src/protyle/render/av/blockCollection.tsindex b70bc772c2..56d44a8808 100644--- a/app/src/protyle/render/av/blockCollection.ts+++ b/app/src/protyle/render/av/blockCollection.ts@@ -1,11 +1,7 @@-import type {AVAutomationBlockSourceInput, AVBlockCollectionMatch} from "../../../types/api";-import {Dialog} from "../../../dialog";+import type {AVAutomationBlockSourceInput} from "../../../types/api";import {fetchSyncPost} from "../../../util/fetch";import {escapeAttr, escapeHtml} from "../../../util/escape";-import {isMobile} from "../../../util/functions";import {movePathTo} from "../../../util/pathName";-import {transaction} from "../../wysiwyg/transaction";-import {waitForPendingTransactions} from "../../util/transactionQueue";import {mountCollectionConditions} from "./collectionConditions";import {BlockPanel} from "../../../block/Panel";@@ -86,42 +82,3 @@ ${notebooks.length || documents.length ? `<div class="av__automation-source-list});void render();};--export const openBlockCollectionPreview = async (protyle: IProtyle, avID: string, blockID: string, ruleID: string) => {- const lang = window.siyuan.languages;- await waitForPendingTransactions(protyle);- const dialog = new Dialog({title: lang.automationCollectionPreview, width: isMobile() ? "92vw" : "680px",- content: `<div class="b3-dialog__content av__collection-preview"><div class="av__automation-preview-results" data-results></div></div><div class="b3-dialog__action"><button type="button" class="b3-button b3-button--cancel" data-prev>${lang.previous}</button><span class="fn__space"></span><button type="button" class="b3-button b3-button--cancel" data-next>${lang.next}</button><span class="fn__flex-1"></span><button type="button" class="b3-button b3-button--text" data-collect>${lang.automationCollectPage}</button></div>`});- let page = 1;- let matches: AVBlockCollectionMatch[] = [];- let busy = false;- const previous = dialog.element.querySelector<HTMLButtonElement>("[data-prev]");- const next = dialog.element.querySelector<HTMLButtonElement>("[data-next]");- const collect = dialog.element.querySelector<HTMLButtonElement>("[data-collect]");- const load = async () => {- busy = true;- previous.disabled = next.disabled = collect.disabled = true;- const result = await fetchSyncPost("/api/av/previewAttributeViewCollection", {avID, ruleID, page});- if (!dialog.element.isConnected) { return; }- busy = false;- const host = dialog.element.querySelector<HTMLElement>("[data-results]");- if (result.code !== 0) { host.textContent = result.msg; return; }- matches = result.data.blocks;- host.innerHTML = matches.map(item => `<div class="av__automation-field"><a href="siyuan://blocks/${escapeAttr(item.id)}" class="ft__breakword av__automation-preview-content">${escapeHtml(item.content || item.id)}</a><div class="ft__on-surface ft__smaller ft__breakword av__automation-preview-description">${escapeHtml(item.hPath)}${item.collected ? ` - ${lang.automationCollectionCollected}` : ""}</div></div>`).join("") || `<div class="ft__on-surface av__automation-preview-empty">${lang.emptyContent}</div>`;- previous.disabled = page === 1;- next.disabled = !result.data.hasMore;- collect.disabled = !matches.some(item => !item.collected);- };- previous.addEventListener("click", () => { if (!busy) { page--; void load(); } });- next.addEventListener("click", () => { if (!busy) { page++; void load(); } });- collect.addEventListener("click", async () => {- if (busy) { return; }- busy = true;- previous.disabled = next.disabled = collect.disabled = true;- const operation = {action: "collectAttrViewBlocks" as const, avID, blockID, data: {ruleID, blockIDs: matches.filter(item => !item.collected).map(item => item.id)}};- transaction(protyle, [operation], [operation]);- await waitForPendingTransactions(protyle);- await load();- });- await load();-};diff --git a/app/src/protyle/render/av/collectionReview.test.ts b/app/src/protyle/render/av/collectionReview.test.tsindex 8389366886..f31f90a18b 100644--- a/app/src/protyle/render/av/collectionReview.test.ts+++ b/app/src/protyle/render/av/collectionReview.test.ts@@ -7,81 +7,153 @@ import {ModuleKind, ScriptTarget, transpileModule} from "typescript";const compiled = transpileModule(readFileSync("src/protyle/render/av/collectionReview.ts", "utf8"), {compilerOptions: {module: ModuleKind.CommonJS, target: ScriptTarget.ES2022},}).outputText;+const tick = () => new Promise(resolve => setTimeout(resolve, 0));-const setup = () => {- const listeners = new Map<string, () => void | Promise<void>>();- const elements = new Map<string, {disabled: boolean, innerHTML: string, textContent: string, addEventListener: (name: string, callback: () => void | Promise<void>) => void}>();- ["[data-prev]", "[data-next]", "[data-cleanup]", "[data-counts]", "[data-results]"].forEach(selector => elements.set(selector, {- disabled: false, innerHTML: "", textContent: "", addEventListener: (_name, callback) => listeners.set(selector, callback),- }));- const root = {isConnected: true, querySelector: (selector: string) => elements.get(selector)};+const setup = (unmatched = 1) => {+ const listeners = new Map<string, (event?: unknown) => void | Promise<void>>();+ const element = (selector: string, dataset: Record<string, string> = {}) => {+ let html = "";+ const label = {textContent: ""};+ return {+ disabled: false, textContent: "", dataset, value: "rule", options: [] as number[],+ get innerHTML() { return html; },+ set innerHTML(value: string) { html = value; this.options = [1]; },+ classList: {toggle() {}}, setAttribute() {}, hasAttribute: () => !!dataset.collectionStatus || !!dataset.collectionView,+ querySelector: () => label,+ addEventListener: (name: string, callback: (event?: unknown) => void | Promise<void>) => listeners.set(`${selector}:${name}`, callback),+ };+ };+ const elements = new Map<string, ReturnType<typeof element>>();+ for (const name of ["prev", "next", "cleanup", "collect", "results", "page", "rule-control", "status-tabs", "review-tip", "collection-rule"]) {+ elements.set(`[data-${name}]`, element(`[data-${name}]`));+ }+ const tabs = ["matched", "unmatched", "unknown"].map(value => element(value, {collectionStatus: value}));+ const views = ["rules", "entries"].map(value => element(value, {collectionView: value}));+ const root = {+ isConnected: true,+ querySelector: (selector: string) => elements.get(selector),+ querySelectorAll: (selector: string) => selector === "[data-collection-status]" ? tabs : [...tabs, ...views],+ addEventListener: (name: string, callback: (event?: unknown) => void) => listeners.set(`root:${name}`, callback),+ };const performed: {do: IOperation[], undo: IOperation[]}[] = [];- const requests: number[] = [];+ const requests: {page: number, status?: string, ruleID?: string}[] = [];const confirmations: {confirm: () => Promise<void>, cancel: () => void}[] = [];let items = [- {itemID: "matched", blockID: "block-matched", status: "matched", content: "Keep", hPath: "/Tasks"},- {itemID: "unmatched", blockID: "block-unmatched", status: "unmatched", content: "<unsafe>", hPath: "/Tasks"},- {itemID: "unknown", blockID: "", status: "unknown", content: "Detached", hPath: ""},+ {itemID: "matched", blockID: "block-matched", status: "matched", content: "Keep", hPath: "/Tasks", isDetached: false, reason: ""},+ ...Array.from({length: unmatched}, (_, i) => ({itemID: `unmatched-${i}`, blockID: `block-${i}`, status: "unmatched", content: "<unsafe>", hPath: "/Tasks", isDetached: false, reason: ""})),+ {itemID: "unknown", blockID: "", status: "unknown", content: "Detached", hPath: "", isDetached: true, reason: "detached"},];const methods = {} as typeof import("./collectionReview");+ const languages = JSON.parse(readFileSync("appearance/langs/en.json", "utf8"));runInNewContext(compiled, {- exports: methods,- window: {siyuan: {languages: {automationCollectionReview: "Review", automationCollectionCleanup: "Remove", automationCollectionReviewTip: "Review rules", automationCollectionCleanupConfirm: "Confirm removal", automationCollectionMatched: "Matching", automationCollectionUnmatched: "Not matching", automationCollectionUnknown: "Unknown"}}},+ exports: methods, window: {siyuan: {languages}},require: (name: string) => ({"../../../dialog": {Dialog: class {element = root;}},"../../../dialog/confirmDialog": {confirmDialog: (_title: string, _text: string, confirm: () => Promise<void>, cancel: () => void) => confirmations.push({confirm, cancel})},"../../../util/functions": {isMobile: () => true},"../../../util/escape": {escapeAttr: String, escapeHtml: (value: string) => value.replace(/</g, "<")},"../../util/transactionQueue": {waitForPendingTransactions: async () => {}},- "../../../util/fetch": {fetchSyncPost: async (path: string, request: {avID: string, page: number}) => {+ "../../../util/fetch": {fetchSyncPost: async (path: string, request: {page: number, status?: string, ruleID?: string}) => {+ if (path === "/api/av/getAttributeView") {+ return {code: 0, data: {av: {automations: {rules: [{id: "rule", name: "Tasks", enabled: true, trigger: "block"}]}}}};+ }+ requests.push(request);+ if (path === "/api/av/previewAttributeViewCollection") {+ return {code: 0, data: {hasMore: false, blocks: [+ {id: "bound", content: "Bound", hPath: "/Tasks", collected: true},+ {id: "new", content: "New", hPath: "/Tasks", collected: performed.length > 0},+ ]}};+ }assert.equal(path, "/api/av/reviewAttributeViewCollection");- assert.equal(request.avID, "database");- requests.push(request.page);- return {code: 0, data: {items, ruleVersion: "reviewed-rules", hasMore: request.page === 1,- matched: 1, unmatched: items.filter(item => item.status === "unmatched").length, unknown: 1}};+ const selected = items.filter(item => item.status === request.status);+ return {code: 0, data: {items: selected.slice((request.page - 1) * 100, request.page * 100), ruleVersion: "reviewed-rules",+ hasMore: selected.length > request.page * 100, matched: 1, unknown: items.some(item => item.status === "unknown") ? 1 : 0,+ unmatched: items.filter(item => item.status === "unmatched").length}};}},"../../wysiwyg/transaction": {transaction: (_protyle: IProtyle, operations: IOperation[], undo: IOperation[]) => {performed.push({do: operations, undo});- items = items.filter(item => item.status !== "unmatched");+ const operation = operations[0];+ if (operation.action === "cleanupAttrViewBlocks") {+ const ids = new Set(operation.data.items.map(item => item.itemID));+ items = items.filter(item => !ids.has(item.itemID));+ } else if (operation.action === "removeAttrViewBlock") {+ items = items.filter(item => !operation.srcIDs.includes(item.itemID));+ }}},})[name] || {},});- return {open: () => methods.openCollectionReview({} as IProtyle, "database", "carrier"), root, elements, listeners, performed, confirmations, requests};+ const click = async (dataset: Record<string, string>) => {+ listeners.get("root:click")({target: {closest: () => ({dataset})}});+ await tick();+ };+ return {open: () => methods.openCollectionManager({} as IProtyle, "database", "carrier"), root, elements, listeners,+ performed, confirmations, requests, click, languages};};-test("collection review requires confirmation and only removes reviewed unmatched bindings with an undo operation", async () => {- const state = setup();+test("collection manager filters before paging, remembers category pages and confirms only this page's cleanup", async () => {+ const state = setup(101);await state.open();assert.equal(state.performed.length, 0);assert.ok(state.elements.get("[data-results]").innerHTML.includes("<unsafe>"));- assert.ok(state.elements.get("[data-counts]").textContent.includes("Unknown"));- assert.equal(state.elements.get("[data-cleanup]").disabled, false);- await state.listeners.get("[data-cleanup]")();- assert.equal(state.performed.length, 0);- assert.equal(state.elements.get("[data-cleanup]").disabled, true);- await state.listeners.get("[data-cleanup]")();- assert.equal(state.confirmations.length, 1, "repeated clicks cannot open another confirmation");+ await state.listeners.get("[data-next]:click")();+ await tick();+ assert.equal(state.elements.get("[data-page]").textContent, "2");+ await state.click({collectionStatus: "unknown"});+ assert.equal(state.elements.get("[data-page]").textContent, "1");+ await state.click({collectionStatus: "unmatched"});+ assert.equal(state.elements.get("[data-page]").textContent, "2");+ await state.listeners.get("[data-cleanup]:click")();+ await state.listeners.get("[data-cleanup]:click")();+ assert.equal(state.confirmations.length, 1);state.confirmations[0].cancel();assert.equal(state.performed.length, 0);- await state.listeners.get("[data-cleanup]")();+ await state.listeners.get("[data-cleanup]:click")();await state.confirmations[1].confirm();- assert.equal(state.performed.length, 1);- assert.deepEqual(JSON.parse(JSON.stringify(state.performed[0])), {do: [{action: "cleanupAttrViewBlocks", avID: "database", blockID: "carrier",- data: {ruleVersion: "reviewed-rules", items: [{itemID: "unmatched", blockID: "block-unmatched"}]}}], undo: [{action: "cleanupAttrViewBlocks", avID: "database", blockID: "carrier",- data: {ruleVersion: "reviewed-rules", items: [{itemID: "unmatched", blockID: "block-unmatched"}]}}]});- assert.equal(state.elements.get("[data-cleanup]").disabled, true);- assert.deepEqual(state.requests, [1, 1], "cleanup refreshes the review after the transaction queue settles");+ const operation = state.performed[0].do[0];+ assert.equal(operation.action, "cleanupAttrViewBlocks");+ if (operation.action !== "cleanupAttrViewBlocks") { return; }+ assert.equal(operation.data.items.length, 1);+ assert.equal(operation.data.items[0].itemID, "unmatched-100");+ assert.equal(operation.data.ruleVersion, "reviewed-rules");+ assert.equal(state.elements.get("[data-page]").textContent, "1", "an emptied last page is corrected");+ assert.deepEqual(state.requests.slice(-2).map(request => request.page), [2, 1]);});-test("collection review paginates without mutation and ignores confirmation after its dialog closes", async () => {+test("unknown entries display reasons and use ordinary undoable removal without rule cleanup", async () => {const state = setup();await state.open();- await state.listeners.get("[data-next]")();- assert.equal(state.elements.get("[data-next]").disabled, true);- await state.listeners.get("[data-prev]")();- assert.deepEqual(state.requests, [1, 2, 1]);+ await state.click({collectionStatus: "unknown"});+ assert.ok(state.elements.get("[data-results]").innerHTML.includes(state.languages.automationCollectionReasonDetached));+ await state.click({removeItem: "unknown"});+ await state.confirmations[0].confirm();+ assert.deepEqual(JSON.parse(JSON.stringify(state.performed[0])), {+ do: [{action: "removeAttrViewBlock", avID: "database", blockID: "carrier", srcIDs: ["unknown"]}],+ undo: [{action: "insertAttrViewBlock", avID: "database", blockID: "carrier",+ srcs: [{itemID: "unknown", id: "unknown", isDetached: true, content: "Detached"}]}],+ });+ await state.click({collectionStatus: "matched"});+ assert.doesNotMatch(state.elements.get("[data-results]").innerHTML, /data-remove-item/);+});++test("rule preview collects only displayed unbound matches and ignores repeated clicks", async () => {+ const state = setup();+ await state.open();+ await state.click({collectionView: "rules"});assert.equal(state.performed.length, 0);- await state.listeners.get("[data-cleanup]")();+ const pending = state.listeners.get("[data-collect]:click")();+ await state.listeners.get("[data-collect]:click")();+ await pending;+ assert.equal(state.performed.length, 1);+ assert.deepEqual(JSON.parse(JSON.stringify(state.performed[0].do)), [{action: "collectAttrViewBlocks", avID: "database", blockID: "carrier",+ data: {ruleID: "rule", blockIDs: ["new"]}}]);+ assert.equal(state.elements.get("[data-collect]").disabled, true);+});++test("collection manager chooses unknown when no entries are unmatched and ignores closed confirmations", async () => {+ const state = setup(0);+ await state.open();+ assert.equal(state.requests.at(-1).status, "unknown");+ await state.click({removeItem: "unknown"});state.root.isConnected = false;await state.confirmations[0].confirm();assert.equal(state.performed.length, 0);diff --git a/app/src/protyle/render/av/collectionReview.ts b/app/src/protyle/render/av/collectionReview.tsindex 7511db2f62..0362b46508 100644--- a/app/src/protyle/render/av/collectionReview.ts+++ b/app/src/protyle/render/av/collectionReview.ts@@ -1,4 +1,4 @@-import type {AVCollectionReview} from "../../../types/api";+import type {AVBlockCollectionMatch, AVCollectionReview, AVCollectionReviewItem} from "../../../types/api";import {Dialog} from "../../../dialog";import {confirmDialog} from "../../../dialog/confirmDialog";import {fetchSyncPost} from "../../../util/fetch";@@ -8,66 +8,191 @@ import {openLink} from "../../../editor/openLink";import {transaction} from "../../wysiwyg/transaction";import {waitForPendingTransactions} from "../../util/transactionQueue";-export const openCollectionReview = async (protyle: IProtyle, avID: string, blockID: string) => {+type ReviewStatus = AVCollectionReviewItem["status"];++export const openCollectionManager = async (protyle: IProtyle, avID: string, blockID: string) => {const lang = window.siyuan.languages;await waitForPendingTransactions(protyle);- const dialog = new Dialog({title: lang.automationCollectionReview, width: isMobile() ? "92vw" : "680px",- content: `<div class="b3-dialog__content av__collection-preview"><div class="av__automation-control"><div class="ft__on-surface ft__smaller av__automation-tip">${lang.automationCollectionReviewTip}</div><div class="ft__on-surface ft__smaller ft__breakword" role="status" aria-live="polite" data-counts></div><div data-results></div></div></div><div class="b3-dialog__action av__automation-row"><div class="av__automation-row"><button type="button" class="b3-button b3-button--cancel" data-prev>${lang.previous}</button><button type="button" class="b3-button b3-button--cancel" data-next>${lang.next}</button></div><span class="fn__flex-1"></span><button type="button" class="b3-button b3-button--remove b3-button--wrap" data-cleanup>${lang.automationCollectionCleanup}</button></div>`});- const previous = dialog.element.querySelector<HTMLButtonElement>("[data-prev]");- const next = dialog.element.querySelector<HTMLButtonElement>("[data-next]");- const cleanup = dialog.element.querySelector<HTMLButtonElement>("[data-cleanup]");- const statuses = {matched: lang.automationCollectionMatched, unmatched: lang.automationCollectionUnmatched, unknown: lang.automationCollectionUnknown};- let page = 1;- let busy = false;+ const statuses: Record<ReviewStatus, string> = {+ matched: lang.automationCollectionMatched,+ unmatched: lang.automationCollectionUnmatched,+ unknown: lang.automationCollectionUnknown,+ };+ const reasons: Record<NonNullable<AVCollectionReviewItem["reason"]>, string> = {+ invalidItem: lang.automationCollectionReasonInvalidItem,+ detached: lang.automationCollectionReasonDetached,+ noRules: lang.automationCollectionReasonNoRules,+ invalidRule: lang.automationCollectionReasonInvalidRule,+ unavailable: lang.automationCollectionReasonUnavailable,+ unreadable: lang.automationCollectionReasonUnreadable,+ };+ const tab = (attribute: string, value: string, label: string) => `<div class="item item--full" ${attribute}="${value}" role="tab" tabindex="0" aria-selected="false"><span class="fn__flex-1"></span><span class="item__text">${escapeHtml(label)}</span><span class="fn__flex-1"></span></div>`;+ const dialog = new Dialog({title: lang.automationCollectionManage, width: isMobile() ? "92vw" : "760px",+ content: `<div class="b3-dialog__content av__collection-preview av__collection-manager">+<div class="layout-tab-bar fn__flex" role="tablist" aria-label="${escapeAttr(lang.automationCollectionManage)}">${tab("data-collection-view", "rules", lang.automationCollectionRules)}${tab("data-collection-view", "entries", lang.automationCollectionEntries)}</div>+<label class="av__automation-control fn__none" data-rule-control><span>${lang.automationRule}</span><select class="b3-select fn__block" data-collection-rule></select></label>+<div class="ft__on-surface ft__smaller av__automation-tip" data-review-tip>${lang.automationCollectionReviewTip}</div>+<div class="layout-tab-bar fn__flex" role="tablist" aria-label="${escapeAttr(lang.automationCollectionEntries)}" data-status-tabs>${Object.entries(statuses).map(([value, label]) => tab("data-collection-status", value, label)).join("")}</div>+<div class="av__automation-preview-results" data-results role="status" aria-live="polite"></div>+</div><div class="b3-dialog__action av__automation-row"><div class="av__automation-row"><button type="button" class="b3-button b3-button--cancel" data-prev>${lang.previous}</button><span data-page></span><button type="button" class="b3-button b3-button--cancel" data-next>${lang.next}</button></div><span class="fn__flex-1"></span><button type="button" class="b3-button b3-button--text b3-button--wrap fn__none" data-collect>${lang.automationCollectPage}</button><button type="button" class="b3-button b3-button--remove b3-button--wrap" data-cleanup>${lang.automationCollectionCleanup}</button></div>`});+ const root = dialog.element;+ const host = root.querySelector<HTMLElement>("[data-results]");+ const previous = root.querySelector<HTMLButtonElement>("[data-prev]");+ const next = root.querySelector<HTMLButtonElement>("[data-next]");+ const cleanup = root.querySelector<HTMLButtonElement>("[data-cleanup]");+ const collect = root.querySelector<HTMLButtonElement>("[data-collect]");+ const ruleSelect = root.querySelector<HTMLSelectElement>("[data-collection-rule]");+ const pages: Record<ReviewStatus, number> = {matched: 1, unmatched: 1, unknown: 1};+ const rulePages = new Map<string, number>();+ let view = "entries";+ let status: ReviewStatus = "unmatched";+ let initial = true;+ let busy = true;let review: AVCollectionReview;+ let matches: AVBlockCollectionMatch[] = [];+ let hasMore = false;+ const page = () => view === "entries" ? pages[status] : rulePages.get(ruleSelect.value) || 1;+ const setPage = (value: number) => {+ if (view === "entries") { pages[status] = value; } else { rulePages.set(ruleSelect.value, value); }+ };const candidates = () => review?.items.filter(item => item.status === "unmatched") || [];const updateActions = () => {- previous.disabled = busy || page === 1;- next.disabled = busy || !review?.hasMore;- cleanup.disabled = busy || candidates().length === 0;+ previous.disabled = busy || page() === 1;+ next.disabled = busy || !hasMore;+ cleanup.disabled = busy || !candidates().length;+ collect.disabled = busy || !matches.some(item => !item.collected);cleanup.textContent = `${lang.automationCollectionCleanup} (${candidates().length})`;+ cleanup.classList.toggle("fn__none", view !== "entries" || status !== "unmatched");+ collect.classList.toggle("fn__none", view !== "rules");+ ruleSelect.disabled = busy || !ruleSelect.options.length;+ root.querySelector("[data-page]").textContent = String(page());+ root.querySelector("[data-rule-control]").classList.toggle("fn__none", view !== "rules");+ root.querySelector("[data-status-tabs]").classList.toggle("fn__none", view !== "entries");+ root.querySelector("[data-review-tip]").classList.toggle("fn__none", view !== "entries");+ root.querySelectorAll<HTMLElement>("[data-collection-view], [data-collection-status], [data-remove-item]").forEach(button => {+ if (button.tagName === "BUTTON") { (button as HTMLButtonElement).disabled = busy; }+ button.setAttribute("aria-disabled", String(busy));+ const selected = button.dataset.collectionView ? button.dataset.collectionView === view : button.dataset.collectionStatus === status;+ button.classList.toggle("item--focus", selected);+ if (button.hasAttribute("role")) { button.setAttribute("aria-selected", String(selected)); }+ });+ };+ const renderReview = () => {+ root.querySelectorAll<HTMLElement>("[data-collection-status]").forEach(button => {+ const key = button.dataset.collectionStatus as ReviewStatus;+ button.querySelector(".item__text").textContent = `${statuses[key]} (${review[key]})`;+ });+ host.innerHTML = review.items.map(item => `<div class="av__automation-field av__collection-item"><div class="fn__flex-1"><div class="ft__breakword av__automation-preview-content">${item.blockID && !item.isDetached ? `<a href="siyuan://blocks/${escapeAttr(item.blockID)}">${escapeHtml(item.content || item.blockID)}</a>` : escapeHtml(item.content || item.itemID)}</div><div class="ft__on-surface ft__smaller ft__breakword">${escapeHtml(item.reason ? reasons[item.reason] : item.hPath)}</div></div>${item.status !== "matched" && item.itemID ? `<button type="button" class="b3-button b3-button--cancel b3-button--wrap" data-remove-item="${escapeAttr(item.itemID)}">${lang.automationCollectionRemove}</button>` : ""}</div>`).join("") || `<div class="ft__on-surface">${lang.emptyContent}</div>`;};- const load = async () => {+ const load = async (): Promise<void> => {busy = true;review = undefined;+ matches = [];+ hasMore = false;+ host.textContent = lang.loading;updateActions();- const result = await fetchSyncPost("/api/av/reviewAttributeViewCollection", {avID, page});- if (!dialog.element.isConnected) { return; }- const results = dialog.element.querySelector<HTMLElement>("[data-results]");- const counts = dialog.element.querySelector<HTMLElement>("[data-counts]");- busy = false;- if (result.code !== 0) {- results.textContent = result.msg;- counts.textContent = "";- updateActions();- return;+ if (view === "rules") {+ if (!ruleSelect.value) {+ host.textContent = lang.automationCollectionReasonNoRules;+ } else {+ const result = await fetchSyncPost("/api/av/previewAttributeViewCollection", {avID, ruleID: ruleSelect.value, page: page()});+ if (!root.isConnected) { return; }+ if (result.code !== 0) { host.textContent = result.msg; } else {+ matches = result.data.blocks;+ hasMore = result.data.hasMore;+ host.innerHTML = matches.map(item => `<div class="av__automation-field"><a href="siyuan://blocks/${escapeAttr(item.id)}" class="ft__breakword av__automation-preview-content">${escapeHtml(item.content || item.id)}</a><div class="ft__on-surface ft__smaller ft__breakword">${escapeHtml(item.hPath)} - ${item.collected ? lang.automationCollectionCollected : lang.automationCollectionNotCollected}</div></div>`).join("") || `<div class="ft__on-surface">${lang.emptyContent}</div>`;+ }+ }+ } else {+ const result = await fetchSyncPost("/api/av/reviewAttributeViewCollection", {avID, page: page(), status});+ if (!root.isConnected) { return; }+ if (result.code !== 0) { host.textContent = result.msg; } else {+ review = result.data;+ if (initial) {+ initial = false;+ const first: ReviewStatus = review.unmatched ? "unmatched" : review.unknown ? "unknown" : "matched";+ if (first !== status) { status = first; return load(); }+ }+ const lastPage = Math.max(1, Math.ceil(review[status] / 100));+ if (page() > lastPage) { setPage(lastPage); return load(); }+ hasMore = review.hasMore;+ renderReview();+ }}- review = result.data;- counts.textContent = `${statuses.matched} (${review.matched}) - ${statuses.unmatched} (${review.unmatched}) - ${statuses.unknown} (${review.unknown})`;- results.innerHTML = review.items.map(item => `<div class="av__automation-field">${item.blockID ? `<a href="siyuan://blocks/${escapeAttr(item.blockID)}" class="ft__breakword av__automation-preview-content">${escapeHtml(item.content || item.blockID)}</a>` : `<div class="ft__breakword">${escapeHtml(item.content || item.itemID)}</div>`}<div class="ft__on-surface ft__smaller ft__breakword">${escapeHtml(statuses[item.status])}${item.hPath ? ` - ${escapeHtml(item.hPath)}` : ""}</div></div>`).join("") || `<div class="ft__on-surface">${lang.emptyContent}</div>`;+ busy = false;+ updateActions();+ };+ const perform = async (operations: IOperation[], undo: IOperation[]) => {+ transaction(protyle, operations, undo);+ await waitForPendingTransactions(protyle);+ if (root.isConnected) { await load(); }+ };+ const confirmRemoval = (title: string, text: string, operations: IOperation[], undo: IOperation[]) => {+ busy = true;updateActions();+ confirmDialog(title, text, async () => {+ if (root.isConnected) { await perform(operations, undo); }+ }, () => { busy = false; updateActions(); }, true, undefined, lang.confirm);};- previous.addEventListener("click", async () => { if (!busy && page > 1) { page--; await load(); } });- next.addEventListener("click", async () => { if (!busy && review?.hasMore) { page++; await load(); } });+ root.addEventListener("click", event => {+ const button = (event.target as Element).closest<HTMLElement>("[data-collection-view], [data-collection-status], [data-remove-item]");+ if (!button || busy) { return; }+ if (button.dataset.collectionView) {+ view = button.dataset.collectionView;+ void load();+ } else if (button.dataset.collectionStatus) {+ status = button.dataset.collectionStatus as ReviewStatus;+ void load();+ } else {+ const item = review?.items.find(row => row.itemID === button.dataset.removeItem);+ if (!item || item.status === "matched") { return; }+ const operation: IOperation = {action: "removeAttrViewBlock", avID, blockID, srcIDs: [item.itemID]};+ const undo: IOperation = {action: "insertAttrViewBlock", avID, blockID,+ srcs: [{itemID: item.itemID, id: item.blockID || item.itemID, isDetached: item.isDetached, content: item.content}]};+ confirmRemoval(lang.automationCollectionRemove, lang.automationCollectionRemoveConfirm, [operation], [undo]);+ }+ });+ root.addEventListener("keydown", event => {+ const target = (event.target as Element).closest<HTMLElement>('[role="tab"]');+ if (!target || busy) { return; }+ if (event.key === "Enter" || event.key === " ") {+ event.preventDefault();+ target.click();+ } else if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) {+ event.preventDefault();+ const tabs = Array.from(target.parentElement.querySelectorAll<HTMLElement>('[role="tab"]'));+ const index = tabs.indexOf(target);+ const nextIndex = event.key === "Home" ? 0 : event.key === "End" ? tabs.length - 1 :+ (index + (event.key === "ArrowLeft" ? -1 : 1) + tabs.length) % tabs.length;+ tabs[nextIndex].focus();+ tabs[nextIndex].click();+ }+ });+ previous.addEventListener("click", () => { if (!busy && page() > 1) { setPage(page() - 1); void load(); } });+ next.addEventListener("click", () => { if (!busy && hasMore) { setPage(page() + 1); void load(); } });+ ruleSelect.addEventListener("change", () => { if (!busy) { void load(); } });cleanup.addEventListener("click", () => {if (busy || !candidates().length) { return; }const items = candidates().map(item => ({itemID: item.itemID, blockID: item.blockID}));- const ruleVersion = review.ruleVersion;+ const operation: IOperation = {action: "cleanupAttrViewBlocks", avID, blockID, data: {ruleVersion: review.ruleVersion, items}};+ confirmRemoval(`${lang.automationCollectionCleanup} (${items.length})`, lang.automationCollectionCleanupConfirm, [operation], [operation]);+ });+ collect.addEventListener("click", async () => {+ if (busy || !matches.some(item => !item.collected)) { return; }busy = true;updateActions();- confirmDialog(`${lang.automationCollectionCleanup} (${items.length})`, lang.automationCollectionCleanupConfirm, async () => {- if (!dialog.element.isConnected) { return; }- const operation = {action: "cleanupAttrViewBlocks" as const, avID, blockID, data: {ruleVersion, items}};- transaction(protyle, [operation], [operation]);- await waitForPendingTransactions(protyle);- if (!dialog.element.isConnected) { return; }- page = 1;- await load();- }, () => { busy = false; updateActions(); }, true, undefined, lang.confirm);+ const operation: IOperation = {action: "collectAttrViewBlocks", avID, blockID,+ data: {ruleID: ruleSelect.value, blockIDs: matches.filter(item => !item.collected).map(item => item.id)}};+ await perform([operation], [operation]);});- dialog.element.querySelector("[data-results]").addEventListener("click", event => {+ host.addEventListener("click", event => {const link = (event.target as Element).closest<HTMLAnchorElement>("a[href]");if (link) { event.preventDefault(); openLink(protyle.app, link.getAttribute("href"), event as MouseEvent); }});+ updateActions();+ const response = await fetchSyncPost("/api/av/getAttributeView", {id: avID});+ if (!root.isConnected) { return; }+ const rules = response.code === 0 ? (response.data.av.automations?.rules || []).filter(rule => rule.enabled && rule.trigger === "block") : [];+ ruleSelect.innerHTML = rules.map(rule => `<option value="${escapeAttr(rule.id)}">${escapeHtml(rule.name)}</option>`).join("");await load();};diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.tsindex d6223c76f7..ff0f5446c0 100644--- a/app/src/types/api/index.d.ts+++ b/app/src/types/api/index.d.ts@@ -312,9 +312,9 @@ export type AVCollectionCleanupItemInput = { "blockID": string; "itemID": stringexport type AVCollectionReview = { "hasMore": boolean; "items": Array<AVCollectionReviewItem | null> | null; "matched": number; "ruleVersion": string; "unknown": number; "unmatched": number; };-export type AVCollectionReviewItem = { "blockID": string; "content": string; "hPath": string; "itemID": string; "status": "matched" | "unmatched" | "unknown"; };+export type AVCollectionReviewItem = { "blockID": string; "content": string; "hPath": string; "isDetached": boolean; "itemID": string; "reason"?: "invalidItem" | "detached" | "noRules" | "invalidRule" | "unavailable" | "unreadable"; "status": "matched" | "unmatched" | "unknown"; };-export type AVCollectionReviewRequestInput = { "avID": string; "page"?: number; };+export type AVCollectionReviewRequestInput = { "avID": string; "page"?: number; "status"?: "" | "matched" | "unmatched" | "unknown"; };export type AVConditionalColorRule = { "color": AVValueSelect | null; "filter": AVViewFilter | null; "id": string; "matchOption": boolean; "target": "item" | "property"; };@@ -3805,6 +3805,10 @@ export interface APIPOSTRoutes {/*** 按全部启用收集规则的并集检查已有条目,返回 matched、unmatched、unknown 和规则版本。* 手动及自动绑定条目统一判断;游离、无可用规则或无法判断时保留,不隐式清理或补收。+ * status 可选,按分类筛选后每页最多 100 项;省略时保留混合分页,全库计数不受筛选影响。+ * unknown 条目通过 reason 说明原因;isDetached 表示游离条目,主动移出使用普通条目移出事务。+ * reason 的 invalidItem、detached、noRules、invalidRule 分别表示绑定信息不完整、游离、无启用规则和规则无效,+ * unavailable 表示源块不可用,unreadable 表示源内容读取失败;原因不包含原始错误或私密路径。* 使用 cleanupAttrViewBlocks 事务明确移出预览后确认的条目,执行时重新检查并支持撤销。*/"/api/av/reviewAttributeViewCollection": {diff --git a/app/tests/automationPanel.test.js b/app/tests/automationPanel.test.jsindex 91ab56ea3b..14ea429e30 100644--- a/app/tests/automationPanel.test.js+++ b/app/tests/automationPanel.test.js@@ -75,13 +75,27 @@ const runCases = async (sources, css, mobile) => {"dialog/inputDialog": {openInputDialog: options => { collectionTypeInput = options; }},"block/Panel": {BlockPanel: class {constructor(options) {scopePreviews.push(options);}}},"util/pathName": {movePathTo: options => scopeRequests.push(options)},- "util/fetch": {fetchSyncPost: async (url, request) => url.includes("previewAttributeViewTemplate") ?- (templatePreviews.push(request), {code: 0, data: {type: "date", date: {content: 1792713600000, isNotEmpty: true, isNotTime: true}}}) : url.includes("getHPathByID") ? {code: 0, data: "/Tasks"} :- url.includes("reviewAttributeViewCollection") ? {code: 0, data: {ruleVersion: "snapshot", matched: 7, unmatched: 7, unknown: 6, hasMore: false,- items: Array.from({length: 20}, (_, index) => ({itemID: `entry-${index}`, blockID: `block-${index}`,+ "util/fetch": {fetchSyncPost: async (url, request) => {+ if (url.includes("previewAttributeViewTemplate")) {+ templatePreviews.push(request);+ return {code: 0, data: {type: "date", date: {content: 1792713600000, isNotEmpty: true, isNotTime: true}}};+ }+ if (url.includes("getHPathByID")) return {code: 0, data: "/Tasks"};+ if (url === "/api/av/reviewAttributeViewCollection") {+ const items = Array.from({length: 20}, (_, index) => ({itemID: `entry-${index}`,+ blockID: index % 3 === 2 ? "" : `block-${index}`, isDetached: index % 3 === 2,content: index === 0 ? "<img src=x onerror=alert(1)>" : `Collected entry ${index + 1} with manually maintained fields`,- hPath: "/Tasks/" + "a-long-document-title".repeat(8), status: ["matched", "unmatched", "unknown"][index % 3]}))}} :- {code: 0, data: {av: request.id === "source" ? database : targetDatabase}},+ hPath: "/Tasks/" + "a-long-document-title".repeat(8),+ reason: index % 3 === 2 ? "detached" : undefined, status: ["matched", "unmatched", "unknown"][index % 3]}));+ return {code: 0, data: {ruleVersion: "snapshot", matched: 7, unmatched: 7, unknown: 6, hasMore: false,+ items: items.filter(item => !request.status || item.status === request.status)}};+ }+ if (url.includes("previewAttributeViewCollection")) return {code: 0, data: {hasMore: false, blocks: [+ {id: "bound", content: "Bound block", hPath: "/Tasks", collected: true},+ {id: "new", content: "Unbound block", hPath: "/Tasks", collected: false},+ ]}};+ return {code: 0, data: {av: request.id === "source" ? database : targetDatabase}};+ },fetchPost: (_url, _request, callback) => searches.push(() => callback({code: 0, data: {rows: {values: [{blockID: "related", block: {content: "Related"}},]}}}))},@@ -502,11 +516,11 @@ const runCases = async (sources, css, mobile) => {await click('[data-remove="document"][data-index="1"]');await click('[data-remove="notebook"]');assert.deepEqual(latest().blockSource.documentIDs, ["document"]);- assert.equal(get('[data-action="preview-collection"]').disabled, true);+ assert.equal(get('[data-action="manage-collection"]').disabled, false, "management remains available without an enabled rule");assert.equal(get("[data-status]").textContent, lang.automationReady);get("[data-enabled]").click();assert.equal(latest().enabled, true);- assert.equal(get('[data-action="preview-collection"]').disabled, false);+ assert.equal(menu.querySelector('[data-action="preview-collection"]'), null, "rule actions do not contain database-level management");assert.equal(latest().actions[0].type, "collect");assert.deepEqual(database.automations.rules[0].conditions, [currentCondition]);for (const width of mobile ? [360, 740] : [420, 1000]) {@@ -659,7 +673,8 @@ const runCases = async (sources, css, mobile) => {await click("[data-tags] .b3-chip__close");assert.deepEqual(latest().blockSource.tags, []);const writesBeforeReview = transactions.length;- await click('[data-action="review-collection"]');+ database.automations.rules = [structuredClone(latest())];+ await click('[data-action="manage-collection"]');assert.equal(window.siyuan.dialogs.length, 1, "collection review uses the shared dialog on desktop and mobile");const reviewDialog = window.siyuan.dialogs[0];assert.equal(reviewDialog.element.querySelectorAll("[data-results] img").length, 0, "source text is escaped");@@ -712,6 +727,32 @@ const runCases = async (sources, css, mobile) => {assert.equal(cleanup.action, "cleanupAttrViewBlocks");assert.equal(cleanup.data.items.length, 7, "cleanup only submits the page's unmatched entries");assert.equal(cleanup.data.ruleVersion, "snapshot");+ reviewDialog.element.querySelector('[data-collection-status="matched"]').click();+ await tick();+ assert.equal(reviewDialog.element.querySelectorAll("[data-results] img").length, 0, "matching source text is escaped");+ assert.equal(reviewDialog.element.querySelectorAll("[data-remove-item]").length, 0, "matching entries have no removal action");+ reviewDialog.element.querySelector('[data-collection-status="unknown"]').click();+ await tick();+ assert.ok(reviewDialog.element.querySelector("[data-results]").textContent.includes(lang.automationCollectionReasonDetached));+ assert.equal(reviewDialog.element.querySelector("[data-cleanup]").classList.contains("fn__none"), true);+ await require("electron").ipcRenderer.invoke("automation-size", mobile ? 360 : 420, 900);+ await require("electron").ipcRenderer.invoke("automation-capture", `${mobile ? "mobile" : "desktop"}-${window.innerWidth}-midnight-review-unknown`);+ reviewDialog.element.querySelector("[data-remove-item]").click();+ await tick();+ document.querySelector("#confirmDialogConfirmBtn").click();+ await tick();+ assert.equal(transactions.at(-1).perform[0].action, "removeAttrViewBlock");+ assert.equal(transactions.at(-1).undo[0].action, "insertAttrViewBlock");+ reviewDialog.element.querySelector('[data-collection-view="rules"]').click();+ await tick();+ assert.equal(reviewDialog.element.querySelector("[data-status-tabs]").classList.contains("fn__none"), true);+ assert.equal(reviewDialog.element.querySelector("[data-collection-rule]").options.length, 1);+ assert.ok(reviewDialog.element.querySelector("[data-results]").textContent.includes(lang.automationCollectionNotCollected));+ await require("electron").ipcRenderer.invoke("automation-capture", `${mobile ? "mobile" : "desktop"}-${window.innerWidth}-midnight-review-rules`);+ reviewDialog.element.querySelector("[data-collect]").click();+ await tick();+ assert.equal(transactions.at(-1).perform[0].action, "collectAttrViewBlocks");+ assert.deepEqual(transactions.at(-1).perform[0].data.blockIDs, ["new"]);reviewDialog.destroy();reviewTheme.remove();await tick();@@ -756,7 +797,7 @@ if (process.versions.electron && process.type === "browser") {ipcMain.handle("automation-pointer", (_event, x, y) => win.webContents.debugger.sendCommand("Input.dispatchMouseEvent", {type: "mouseMoved", x, y}));ipcMain.handle("automation-capture", async (_event, name) => {if (!process.env.SIYUAN_AUTOMATION_CAPTURE_DIR) return;- assert.match(name, /^(desktop|mobile)-\d+-(daylight|midnight)(-actions|-conditions|-collection|-review|-review-confirm|-types)?$/);+ assert.match(name, /^(desktop|mobile)-\d+-(daylight|midnight)(-actions|-conditions|-collection|-review|-review-confirm|-review-unknown|-review-rules|-types)?$/);win.webContents.invalidate();await new Promise(resolve => setTimeout(resolve, 150));fs.writeFileSync(path.join(process.env.SIYUAN_AUTOMATION_CAPTURE_DIR, name + ".png"), (await win.webContents.capturePage()).toPNG());diff --git a/kernel/api/av_contract_automation.go b/kernel/api/av_contract_automation.goindex fb58a834da..28bfdd1227 100644--- a/kernel/api/av_contract_automation.go+++ b/kernel/api/av_contract_automation.go@@ -24,7 +24,7 @@ var reviewAttributeViewCollection = contractHandler(apicontract.ReviewAttributeVif err := holdAttributeViewRequest(c, "", request.AvID); err != nil {return apicontract.Failure[*apicontract.AVCollectionReview](-1, err.Error())}- data, err := model.ReviewAttributeViewCollection(request.AvID, request.Page)+ data, err := model.ReviewAttributeViewCollection(request.AvID, request.Page, request.Status)if err != nil {return apicontract.Failure[*apicontract.AVCollectionReview](-1, err.Error())}diff --git a/kernel/api/contract_av_automation_test.go b/kernel/api/contract_av_automation_test.goindex a037a5df62..8e9679af97 100644--- a/kernel/api/contract_av_automation_test.go+++ b/kernel/api/contract_av_automation_test.go@@ -356,6 +356,25 @@ func TestAVContractAutomationWrites(t *testing.T) {if quoteItem == nil {t.Fatal("review endpoint did not report the preserved unmatched quote")}+ for _, status := range []string{"matched", "unmatched", "unknown"} {+ filtered := callAttributeViewContextFilterAPI(t, "/api/av/reviewAttributeViewCollection",+ map[string]any{"avID": database.ID, "page": 1, "status": status}, reviewAttributeViewCollection)+ requireAPIContract(t, http.MethodPost, "/api/av/reviewAttributeViewCollection", filtered)+ var result struct {+ Data apicontract.AVCollectionReview+ }+ if err = json.Unmarshal(filtered.Body.Bytes(), &result); err != nil {+ t.Fatal(err)+ }+ if result.Data.Matched != reviewed.Data.Matched || result.Data.Unmatched != reviewed.Data.Unmatched || result.Data.Unknown != reviewed.Data.Unknown {+ t.Fatal("category filter changed global counts")+ }+ for _, item := range result.Data.Items {+ if item.Status != status {+ t.Fatalf("wrong category: %+v", item)+ }+ }+ }if err = model.PerformAttributeViewOperations([]*model.Operation{{Action: "cleanupAttrViewBlocks", AvID: database.ID,Data: &apicontract.AVCollectionCleanup{RuleVersion: reviewed.Data.RuleVersion, Items: []*apicontract.AVCollectionCleanupItem{quoteItem}}}}); err != nil {t.Fatal(err)diff --git a/kernel/apicontract/av_automation.go b/kernel/apicontract/av_automation.goindex b3bf96236b..4fad44a1a9 100644--- a/kernel/apicontract/av_automation.go+++ b/kernel/apicontract/av_automation.go@@ -137,10 +137,12 @@ type AVCollectBlocks struct {// AVCollectionReviewRequest 检查当前数据库全部已有条目,按全部启用的普通块规则取并集。// 自动和手动绑定条目采用相同判断;无可用规则、规则无效、游离条目或源块不可读取均为 unknown。-// page 从 1 开始,每页最多 100 项,计数覆盖整个数据库;不修改数据或自动补收。+// page 从 1 开始,每页最多 100 项,计数覆盖整个数据库;status 可选,指定后先筛选再分页。+// 省略 status 保留混合分页;unknown 的 reason 描述当前无法判断的原因,不修改数据或自动补收。type AVCollectionReviewRequest struct {- AvID string `json:"avID"`- Page int `json:"page" api:"optional"`+ AvID string `json:"avID"`+ Page int `json:"page" api:"optional"`+ Status string `json:"status" api:"optional,enum=|matched|unmatched|unknown"`}type AVCollectionReview struct {@@ -153,11 +155,13 @@ type AVCollectionReview struct {}type AVCollectionReviewItem struct {- ItemID string `json:"itemID"`- BlockID string `json:"blockID"`- Content string `json:"content"`- HPath string `json:"hPath"`- Status string `json:"status" api:"enum=matched|unmatched|unknown"`+ ItemID string `json:"itemID"`+ BlockID string `json:"blockID"`+ Content string `json:"content"`+ HPath string `json:"hPath"`+ Status string `json:"status" api:"enum=matched|unmatched|unknown"`+ Reason string `json:"reason,omitempty" api:"optional,enum=invalidItem|detached|noRules|invalidRule|unavailable|unreadable"`+ IsDetached bool `json:"isDetached"`}type AVCollectionCleanupItem struct {diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.goindex 2af7f7b6e3..0ee6280bdf 100644--- a/kernel/apicontract/contracts.go+++ b/kernel/apicontract/contracts.go@@ -1253,6 +1253,10 @@ var PreviewAttributeViewCollection = define[AVBlockCollectionPreviewRequest, *AV// 按全部启用收集规则的并集检查已有条目,返回 matched、unmatched、unknown 和规则版本。// 手动及自动绑定条目统一判断;游离、无可用规则或无法判断时保留,不隐式清理或补收。+// status 可选,按分类筛选后每页最多 100 项;省略时保留混合分页,全库计数不受筛选影响。+// unknown 条目通过 reason 说明原因;isDetached 表示游离条目,主动移出使用普通条目移出事务。+// reason 的 invalidItem、detached、noRules、invalidRule 分别表示绑定信息不完整、游离、无启用规则和规则无效,+// unavailable 表示源块不可用,unreadable 表示源内容读取失败;原因不包含原始错误或私密路径。// 使用 cleanupAttrViewBlocks 事务明确移出预览后确认的条目,执行时重新检查并支持撤销。var ReviewAttributeViewCollection = define[AVCollectionReviewRequest, *AVCollectionReview]("reviewAttributeViewCollection", "/api/av/reviewAttributeViewCollection", AuthenticatedAccess|AdminAccess, StructJSONBody, ResponseOptions{}, "POST")diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.jsonindex d23970e98f..867ca9c874 100644--- a/kernel/apicontract/schema.json+++ b/kernel/apicontract/schema.json@@ -7785,9 +7785,23 @@"hPath": {"type": "string"},+ "isDetached": {+ "type": "boolean"+ },"itemID": {"type": "string"},+ "reason": {+ "type": "string",+ "enum": [+ "invalidItem",+ "detached",+ "noRules",+ "invalidRule",+ "unavailable",+ "unreadable"+ ]+ },"status": {"type": "string","enum": [@@ -7801,6 +7815,7 @@"blockID","content","hPath",+ "isDetached","itemID","status"],@@ -7814,6 +7829,15 @@},"page": {"type": "integer"+ },+ "status": {+ "type": "string",+ "enum": [+ "",+ "matched",+ "unmatched",+ "unknown"+ ]}},"required": [diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex cae64673d6..8e6291d380 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -6619,13 +6619,13 @@ func removeAttributeViewBlock(srcIDs []string, avID, blockID string, tx *Transac}// Remove av block also remove node attr https://github.com/siyuan-note/siyuan/issues/9091#issuecomment-1709824006if !val.IsDetached && nil != val.Block {- bt := treenode.GetBlockTree(val.Block.ID)- if nil == bt {- for _, encBoxID := range treenode.GetOpenedEncryptedBoxIDs() {- if encBT := treenode.GetBlockTreeInBox(val.Block.ID, encBoxID); nil != encBT {- bt = encBT- break+ bt := attributeViewBindingBlockTree(val.Block.ID, av.GetAVBoxID(avID))+ if bt != nil && (tx == nil || tx.trees[bt.RootID] == nil) {+ if _, statErr := os.Stat(filepath.Join(util.DataDir, bt.BoxID, bt.Path)); statErr != nil {+ if !errors.Is(statErr, os.ErrNotExist) {+ return statErr}+ bt = nil}}if nil != bt {diff --git a/kernel/model/attribute_view_collection_review.go b/kernel/model/attribute_view_collection_review.goindex 0b5f35c9c9..63a81f6bb2 100644--- a/kernel/model/attribute_view_collection_review.go+++ b/kernel/model/attribute_view_collection_review.go@@ -44,18 +44,28 @@ func (tx *Transaction) newCollectionReview(view *av.AttributeView, boxID string)// 仅有明确的不匹配结论才能进入清理预览;不可读取和没有规则均不解释为不匹配。func (review *collectionReview) item(row *av.Value) *apicontract.AVCollectionReviewItem {- ret := &apicontract.AVCollectionReviewItem{Status: "unknown"}+ ret := &apicontract.AVCollectionReviewItem{Status: "unknown", Reason: "invalidItem"}if row == nil {return ret}ret.ItemID = row.BlockID+ ret.IsDetached = row.IsDetachedif row.Block == nil {return ret}ret.BlockID, ret.Content = row.Block.ID, util.UnescapeHTML(row.Block.Content)- if row.IsDetached || row.Block.ID == "" || len(review.rules) == 0 {+ if row.IsDetached || row.Block.ID == "" {+ ret.Reason = "detached"return ret}+ if len(review.rules) == 0 {+ ret.Reason = "noRules"+ if review.uncertain {+ ret.Reason = "invalidRule"+ }+ return ret+ }+ ret.Reason = "unavailable"bt := attributeViewBindingBlockTree(row.Block.ID, review.boxID)if bt == nil || !IsSameCryptoBoundary(review.boxID, bt.BoxID) {return ret@@ -66,6 +76,7 @@ func (review *collectionReview) item(row *av.Value) *apicontract.AVCollectionRevtree, err = review.tx.loadTreeByBlockTree(bt)if err != nil {review.trees[bt.RootID] = nil+ ret.Reason = "unreadable"return ret}review.trees[bt.RootID] = tree@@ -82,6 +93,7 @@ func (review *collectionReview) item(row *av.Value) *apicontract.AVCollectionRevreview.matches[bt.RootID] = matches}if tree == nil {+ ret.Reason = "unreadable"return ret}if !review.present[bt.RootID][row.Block.ID] {@@ -89,14 +101,19 @@ func (review *collectionReview) item(row *av.Value) *apicontract.AVCollectionRev}ret.HPath = tree.HPathif review.matches[bt.RootID][row.Block.ID] {- ret.Status = "matched"+ ret.Status, ret.Reason = "matched", ""} else if !review.uncertain {- ret.Status = "unmatched"+ ret.Status, ret.Reason = "unmatched", ""+ } else {+ ret.Reason = "invalidRule"}return ret}-func ReviewAttributeViewCollection(avID string, page int) (*apicontract.AVCollectionReview, error) {+func ReviewAttributeViewCollection(avID string, page int, status string) (*apicontract.AVCollectionReview, error) {+ if status != "" && status != "matched" && status != "unmatched" && status != "unknown" {+ return nil, fmt.Errorf("invalid collection review status")+ }FlushTxQueue()tx := &Transaction{luteEngine: util.NewLute(), trees: map[string]*parse.Tree{}}defer tx.finishAttributeViewMutation(false)@@ -111,7 +128,8 @@ func ReviewAttributeViewCollection(avID string, page int) (*apicontract.AVCollecpage = 1}values := view.GetBlockKeyValues().Values- for index, row := range values {+ count := 0+ for _, row := range values {item := review.item(row)switch item.Status {case "matched":@@ -121,11 +139,15 @@ func ReviewAttributeViewCollection(avID string, page int) (*apicontract.AVCollecdefault:ret.Unknown++}- if index/100 == page-1 {+ if status != "" && item.Status != status {+ continue+ }+ if count/100 == page-1 {ret.Items = append(ret.Items, item)}+ count++}- ret.HasMore = page <= len(values)/100 && len(values) > page*100+ ret.HasMore = page <= count/100 && count > page*100return ret, nil}diff --git a/kernel/model/attribute_view_collection_review_fts5_test.go b/kernel/model/attribute_view_collection_review_fts5_test.goindex 48b9a17a8c..733fec8652 100644--- a/kernel/model/attribute_view_collection_review_fts5_test.go+++ b/kernel/model/attribute_view_collection_review_fts5_test.go@@ -8,6 +8,8 @@ import ("github.com/88250/lute/ast""github.com/siyuan-note/siyuan/kernel/apicontract""github.com/siyuan-note/siyuan/kernel/av"+ "github.com/siyuan-note/siyuan/kernel/filesys"+ "github.com/siyuan-note/siyuan/kernel/treenode")func collectionCleanupOperation(viewID string, review *apicontract.AVCollectionReview) *Operation {@@ -46,7 +48,7 @@ func TestBlockCollectionReviewCleanupAndUndo(t *testing.T) {if err := av.SaveAttributeView(view); err != nil {t.Fatal(err)}- review, err := ReviewAttributeViewCollection(view.ID, 1)+ review, err := ReviewAttributeViewCollection(view.ID, 1, "")if err != nil {t.Fatal(err)}@@ -99,7 +101,7 @@ func TestBlockCollectionReviewUnionAndRecheck(t *testing.T) {if err := av.SaveAttributeView(view); err != nil {t.Fatal(err)}- review, err := ReviewAttributeViewCollection(view.ID, 1)+ review, err := ReviewAttributeViewCollection(view.ID, 1, "")if err != nil || review.Matched != 1 || review.Unmatched != 1 {t.Fatalf("enabled rule union: %+v %v", review, err)}@@ -127,10 +129,15 @@ func TestBlockCollectionReviewUnionAndRecheck(t *testing.T) {if err = av.SaveAttributeView(view); err != nil {t.Fatal(err)}- review, err = ReviewAttributeViewCollection(view.ID, 1)+ review, err = ReviewAttributeViewCollection(view.ID, 1, "")if err != nil || review.Unknown != 2 || review.Unmatched != 0 {t.Fatalf("no enabled rules must remain indeterminate: %+v %v", review, err)}+ for _, item := range review.Items {+ if item.Reason != "noRules" {+ t.Fatalf("missing disabled-rule reason: %+v", item)+ }+ }}func TestBlockCollectionReviewBindingAndUnavailableSource(t *testing.T) {@@ -139,7 +146,7 @@ func TestBlockCollectionReviewBindingAndUnavailableSource(t *testing.T) {Srcs: []map[string]any{{"id": fixture.sourceID, "isDetached": false}}}}); err != nil {t.Fatal(err)}- review, err := ReviewAttributeViewCollection(view.ID, 1)+ review, err := ReviewAttributeViewCollection(view.ID, 1, "")if err != nil || review.Unmatched != 1 {t.Fatalf("initial review: %+v %v", review, err)}@@ -160,12 +167,76 @@ func TestBlockCollectionReviewBindingAndUnavailableSource(t *testing.T) {if err = av.SaveAttributeView(view); err != nil {t.Fatal(err)}- review, err = ReviewAttributeViewCollection(view.ID, 1)- if err != nil || review.Unknown != 1 || review.Unmatched != 0 {+ review, err = ReviewAttributeViewCollection(view.ID, 1, "")+ if err != nil || review.Unknown != 1 || review.Unmatched != 0 || review.Items[0].Reason != "unavailable" {t.Fatalf("unavailable source must remain indeterminate: %+v %v", review, err)}}+func TestBlockCollectionReviewClassifiedPagination(t *testing.T) {+ fixture, view, _ := setupBlockCollectionTest(t)+ tree, err := LoadTreeByBlockID(fixture.sourceID)+ if err != nil {+ t.Fatal(err)+ }+ view.Automations.Rules[0].BlockSource.Types = []string{"p"}+ key := view.GetBlockKeyValues()+ for i := 0; i < 202; i++ {+ node := treenode.NewParagraph("")+ if i%2 == 0 {+ node.AppendChild(&ast.Node{Type: ast.NodeTextMark, TextMarkType: "tag", TextMarkTextContent: "todo"})+ }+ tree.Root.AppendChild(node)+ key.Values = append(key.Values, &av.Value{KeyID: key.Key.ID, BlockID: ast.NewNodeID(), Type: av.KeyTypeBlock,+ Block: &av.ValueBlock{ID: node.ID, Content: "Entry"}})+ }+ for i := 0; i < 3; i++ {+ key.Values = append(key.Values, &av.Value{KeyID: key.Key.ID, BlockID: ast.NewNodeID(), Type: av.KeyTypeBlock,+ IsDetached: true, Block: &av.ValueBlock{Content: "Detached"}})+ }+ if _, err = filesys.WriteTree(tree); err != nil {+ t.Fatal(err)+ }+ treenode.UpsertBlockTree(tree)+ if err = av.SaveAttributeView(view); err != nil {+ t.Fatal(err)+ }+ for _, status := range []string{"", "matched", "unmatched", "unknown"} {+ for _, page := range []int{0, 1, 2, 3, int(^uint(0) >> 1)} {+ review, reviewErr := ReviewAttributeViewCollection(view.ID, page, status)+ if reviewErr != nil || review.Matched != 101 || review.Unmatched != 101 || review.Unknown != 3 {+ t.Fatalf("global counts changed for %s page %d: %+v %v", status, page, review, reviewErr)+ }+ count := 101+ if status == "" {+ count = 205+ }+ if status == "unknown" {+ count = 3+ }+ current := max(1, page)+ expected := 0+ if current <= 3 {+ expected = max(0, min(100, count-(current-1)*100))+ }+ if len(review.Items) != expected || review.HasMore != (current <= count/100 && count > current*100) {+ t.Fatalf("%s page %d: %d items, hasMore=%v", status, page, len(review.Items), review.HasMore)+ }+ for _, item := range review.Items {+ if status != "" && item.Status != status {+ t.Fatalf("unexpected category: %+v", item)+ }+ if item.Status == "unknown" && (item.Reason != "detached" || !item.IsDetached) {+ t.Fatalf("missing reason: %+v", item)+ }+ }+ }+ }+ if _, err = ReviewAttributeViewCollection(view.ID, 1, "invalid"); err == nil {+ t.Fatal("invalid category was accepted")+ }+}+func TestBlockCollectionReviewInvalidRulesAndPagination(t *testing.T) {fixture, view, _ := setupBlockCollectionTest(t)if err := PerformAttributeViewOperations([]*Operation{{Action: "insertAttrViewBlock", AvID: view.ID,@@ -183,7 +254,7 @@ func TestBlockCollectionReviewInvalidRulesAndPagination(t *testing.T) {t.Fatal(err)}for _, page := range []int{0, 1, 2, 3, int(^uint(0) >> 1)} {- review, err := ReviewAttributeViewCollection(view.ID, page)+ review, err := ReviewAttributeViewCollection(view.ID, page, "")if err != nil || review.Unknown != 101 || review.Unmatched != 0 || review.Matched != 0 {t.Fatalf("invalid rules must preserve uncertain entries: %+v %v", review, err)}@@ -196,6 +267,11 @@ func TestBlockCollectionReviewInvalidRulesAndPagination(t *testing.T) {if len(review.Items) != expected || review.HasMore != more {t.Fatalf("page %d returned %d items, hasMore=%v", page, len(review.Items), review.HasMore)}+ for _, item := range review.Items {+ if item.IsDetached && item.Reason != "detached" || !item.IsDetached && item.Reason != "invalidRule" {+ t.Fatalf("missing indeterminate reason: %+v", item)+ }+ }}}@@ -213,7 +289,7 @@ func TestBlockCollectionReviewCleanupRollback(t *testing.T) {if err := PerformTxSync(blockCollectionTags(t, fixture.sourceID, "")); err != nil {t.Fatal(err)}- review, err := ReviewAttributeViewCollection(view.ID, 1)+ review, err := ReviewAttributeViewCollection(view.ID, 1, "")if err != nil || review.Unmatched != 1 {t.Fatalf("review before rollback: %+v %v", review, err)}diff --git a/kernel/model/attribute_view_collection_sqlcipher_test.go b/kernel/model/attribute_view_collection_sqlcipher_test.goindex 7f4cb99c8b..3e643f0831 100644--- a/kernel/model/attribute_view_collection_sqlcipher_test.go+++ b/kernel/model/attribute_view_collection_sqlcipher_test.go@@ -29,7 +29,7 @@ func TestBlockCollectionEncryptedSourceAndRecovery(t *testing.T) {}func testBlockCollectionEncryptedSourceAndRecovery(t *testing.T, target string) {- fixture, view, _ := setupBlockCollectionTest(t)+ fixture, view, keyID := setupBlockCollectionTest(t)boxID := fixture.box.IDtree, err := LoadTreeByBlockID(fixture.sourceID)if err != nil {@@ -120,7 +120,7 @@ func testBlockCollectionEncryptedSourceAndRecovery(t *testing.T, target string)if err != nil || len(preview.Blocks) != 1 || !preview.Blocks[0].Collected {t.Fatal("encrypted preview failed", err)}- review, err := ReviewAttributeViewCollection(view.ID, 1)+ review, err := ReviewAttributeViewCollection(view.ID, 1, "")if err != nil || review.Matched != 1 || review.Unmatched != 0 {t.Fatalf("encrypted review failed: %+v %v", review, err)}@@ -129,7 +129,7 @@ func testBlockCollectionEncryptedSourceAndRecovery(t *testing.T, target string)Data: `{"custom-state":"inactive"}`}}}); err != nil {t.Fatal(err)}- review, err = ReviewAttributeViewCollection(view.ID, 1)+ review, err = ReviewAttributeViewCollection(view.ID, 1, "")if err != nil || review.Unmatched != 1 || review.Items[0].ItemID != itemID {t.Fatalf("encrypted mismatch did not preserve the collected entry: %+v %v", review, err)}@@ -149,6 +149,45 @@ func testBlockCollectionEncryptedSourceAndRecovery(t *testing.T, target string)if err != nil || stored.GetBlockValue(itemID) == nil {t.Fatal("encrypted cleanup undo did not restore the original entry", err)}+ if target == "" {+ for _, detached := range []bool{false, true} {+ rowID, source := ast.NewNodeID(), ast.NewNodeID()+ stored.GetBlockKeyValues().Values = append(stored.GetBlockKeyValues().Values, &av.Value{+ KeyID: stored.GetBlockKeyValues().Key.ID, BlockID: rowID, Type: av.KeyTypeBlock, IsDetached: detached,+ Block: &av.ValueBlock{ID: source, Content: "Retained entry"}})+ values, _ := stored.GetKeyValues(keyID)+ values.Values = append(values.Values, &av.Value{KeyID: keyID, BlockID: rowID, Type: av.KeyTypeText,+ Text: &av.ValueText{Content: "Edited field"}})+ if err = av.SaveAttributeView(stored); err != nil {+ t.Fatal(err)+ }+ review, err = ReviewAttributeViewCollection(view.ID, 1, "unknown")+ if err != nil || len(review.Items) != 1 || review.Items[0].ItemID != rowID {+ t.Fatalf("unknown encrypted review: %+v %v", review, err)+ }+ remove := &Operation{Action: "removeAttrViewBlock", AvID: view.ID, SrcIDs: []string{rowID}}+ undo := &Operation{Action: "insertAttrViewBlock", AvID: view.ID,+ Srcs: []map[string]any{{"itemID": rowID, "id": source, "isDetached": detached}}}+ manual := &Transaction{fromAPI: true, DoOperations: []*Operation{remove}, UndoOperations: []*Operation{undo}}+ if err = PerformTxSync(manual); err != nil {+ t.Fatal(err)+ }+ if err = PerformTxSync(&Transaction{isReplay: true, DoOperations: cloneOperations(manual.UndoOperations)}); err != nil {+ t.Fatal(err)+ }+ stored, err = av.ParseAttributeViewForIndexInBox(view.ID, boxID)+ if err != nil || stored.GetBlockValue(rowID) == nil || stored.GetValue(keyID, rowID).Text.Content != "Edited field" {+ t.Fatal("unknown encrypted undo lost entry fields", err)+ }+ if err = PerformTxSync(&Transaction{isReplay: true, DoOperations: cloneOperations(manual.DoOperations)}); err != nil {+ t.Fatal(err)+ }+ stored, err = av.ParseAttributeViewForIndexInBox(view.ID, boxID)+ if err != nil || stored.GetBlockValue(rowID) != nil {+ t.Fatal("unknown encrypted redo failed", err)+ }+ }+ }avPath := filepath.Join(util.DataDir, boxID, "storage", "av", view.ID+".json")docPath := filepath.Join(util.DataDir, boxID, tree.Path)for _, path := range []string{avPath, docPath} {@@ -162,6 +201,38 @@ func testBlockCollectionEncryptedSourceAndRecovery(t *testing.T, target string)}beforeDoc, _ := os.ReadFile(docPath)beforeView, _ := os.ReadFile(avPath)+ if target == "" {+ corruptDoc := append([]byte(nil), beforeDoc...)+ corruptDoc[len(corruptDoc)-1] ^= 1+ if err = os.WriteFile(docPath, corruptDoc, 0600); err != nil {+ t.Fatal(err)+ }+ cache.ClearAVCache()+ cache.RemoveTreeDataInBox(tree.ID, boxID)+ review, err = ReviewAttributeViewCollection(view.ID, 1, "unknown")+ if err != nil || len(review.Items) != 1 || review.Items[0].Reason != "unreadable" {+ t.Fatalf("unreadable encrypted source: %+v %v", review, err)+ }+ manual := &Transaction{fromAPI: true,+ DoOperations: []*Operation{{Action: "removeAttrViewBlock", AvID: view.ID, SrcIDs: []string{itemID}}},+ UndoOperations: []*Operation{{Action: "insertAttrViewBlock", AvID: view.ID,+ Srcs: []map[string]any{{"itemID": itemID, "id": sourceID, "isDetached": false}}}}}+ if err = PerformTxSync(manual); err == nil {+ t.Fatal("manual removal accepted unauthenticated source content")+ }+ preserved, readErr := os.ReadFile(avPath)+ if readErr != nil || !bytes.Equal(beforeView, preserved) {+ t.Fatal("failed manual removal modified the database", readErr)+ }+ preserved, readErr = os.ReadFile(docPath)+ if readErr != nil || !bytes.Equal(corruptDoc, preserved) {+ t.Fatal("failed manual removal modified source ciphertext", readErr)+ }+ if err = os.WriteFile(docPath, beforeDoc, 0600); err != nil {+ t.Fatal(err)+ }+ cache.RemoveTreeDataInBox(tree.ID, boxID)+ }for _, failure := range []string{"locked", "corrupt"} {if failure == "locked" {cachedDEKsLock.Lock()@@ -177,7 +248,7 @@ func testBlockCollectionEncryptedSourceAndRecovery(t *testing.T, target string)if _, err = PreviewAttributeViewCollection(view.ID, view.Automations.Rules[0].ID, 1); err == nil {t.Fatal("preview accepted inaccessible ciphertext")}- if _, err = ReviewAttributeViewCollection(view.ID, 1); err == nil {+ if _, err = ReviewAttributeViewCollection(view.ID, 1, ""); err == nil {t.Fatal("review accepted inaccessible ciphertext")}if err = PerformTxSync(&Transaction{fromAPI: true, DoOperations: []*Operation{cleanupOp}}); err == nil {diff --git a/kernel/model/attribute_view_items.go b/kernel/model/attribute_view_items.goindex f3a48187b6..9a0b156c0e 100644--- a/kernel/model/attribute_view_items.go+++ b/kernel/model/attribute_view_items.go@@ -20,6 +20,8 @@ import ("encoding/json""errors""fmt"+ "os"+ "path/filepath""reflect""slices""strings"@@ -27,6 +29,7 @@ import ("github.com/88250/lute/parse""github.com/siyuan-note/siyuan/kernel/av""github.com/siyuan-note/siyuan/kernel/treenode"+ "github.com/siyuan-note/siyuan/kernel/util")// 删除快照只保存在内核撤销日志中,保留字段值、条目身份和各视图顺序,不参与接口序列化。@@ -36,6 +39,7 @@ type attributeViewItemsSnapshot struct {Keys []*av.KeyValuesOrders map[string][]stringCovers map[string]map[string]*av.CardCoverPosition+ MissingBlocks map[string]boolrelatedChanges *attributeViewFieldsSnapshot}@@ -229,6 +233,30 @@ func (tx *Transaction) readAttributeViewItems(state *attributeViewItemsSnapshot)return tx.readAttributeViewForMutation(state.AvID, state.BlockID, state.BoxID)}+// 只把索引、文件或认证后文档中的源块缺失视为缺失;其它读取失败均保留错误。+func (tx *Transaction) attributeViewItemSourceMissing(state *attributeViewItemsSnapshot, blockID string) (bool, error) {+ bt := attributeViewBindingBlockTree(blockID, state.BoxID)+ if bt == nil {+ return true, nil+ }+ if tx.trees[bt.RootID] == nil {+ if _, err := os.Stat(filepath.Join(util.DataDir, bt.BoxID, bt.Path)); err != nil {+ if errors.Is(err, os.ErrNotExist) {+ return true, nil+ }+ return false, err+ }+ }+ tree, err := tx.loadTreeByBlockTree(bt)+ if errors.Is(err, os.ErrNotExist) {+ return true, nil+ }+ if err != nil {+ return false, err+ }+ return treenode.GetNodeInTree(tree, blockID) == nil, nil+}+func (tx *Transaction) prepareAttributeViewItemMutation(current *av.AttributeView, state *attributeViewItemsSnapshot) error {if _, err := tx.readAttributeViewItems(state); err != nil {return err@@ -272,6 +300,25 @@ func (tx *Transaction) prepareAttributeViewItemMutation(current *av.AttributeVie}}for _, id := range blockIDs {+ if id != state.BlockID {+ missing, err := tx.attributeViewItemSourceMissing(state, id)+ if err != nil {+ return err+ }+ // 缺失源块只恢复原条目快照,不创建替代源块;读取或认证失败仍返回错误。+ if missing && !tx.isReplay {+ if state.MissingBlocks == nil {+ state.MissingBlocks = map[string]bool{}+ }+ state.MissingBlocks[id] = true+ }+ if missing && state.MissingBlocks[id] {+ continue+ }+ if missing {+ return ErrBlockNotFound+ }+ }if err := tx.rememberAttributeViewMutationTree(id); err != nil {return err}@@ -303,6 +350,18 @@ func (tx *Transaction) restoreAttributeViewItems(op *Operation) error {if value.Type != av.KeyTypeBlock || value.IsDetached || value.Block == nil {continue}+ if current.GetBlockValueByBoundID(value.Block.ID) != nil {+ return fmt.Errorf("database entry binding [%s] changed", value.Block.ID)+ }+ if state.MissingBlocks[value.Block.ID] {+ missing, missingErr := tx.attributeViewItemSourceMissing(state, value.Block.ID)+ if missingErr != nil {+ return missingErr+ }+ if missing {+ continue+ }+ }tree, loadErr := tx.loadTree(value.Block.ID)if loadErr != nil {return loadErr@@ -390,6 +449,15 @@ func (tx *Transaction) restoreAttributeViewItems(op *Operation) error {if primary == nil || primary.IsDetached || primary.Block == nil {continue}+ if state.MissingBlocks[primary.Block.ID] {+ missing, missingErr := tx.attributeViewItemSourceMissing(state, primary.Block.ID)+ if missingErr != nil {+ return missingErr+ }+ if missing {+ continue+ }+ }node, tree, loadErr := getNodeByBlockID(tx, primary.Block.ID)if loadErr != nil {return loadErrdiff --git a/kernel/model/attribute_view_items_fts5_test.go b/kernel/model/attribute_view_items_fts5_test.goindex e609fb3997..5bdc1346f9 100644--- a/kernel/model/attribute_view_items_fts5_test.go+++ b/kernel/model/attribute_view_items_fts5_test.go@@ -23,6 +23,72 @@ import ("github.com/siyuan-note/siyuan/kernel/util")+func TestAttributeViewItemsMissingSourceUndoRedo(t *testing.T) {+ for _, mode := range []string{"index", "file", "node"} {+ t.Run(mode, func(t *testing.T) { testAttributeViewItemsMissingSourceUndoRedo(t, mode) })+ }+}++func testAttributeViewItemsMissingSourceUndoRedo(t *testing.T, mode string) {+ _, before, op, undo := setupAttributeViewItemsTest(t, true)+ missingID := ast.NewNodeID()+ missingPath := ""+ itemID := op.SrcIDs[0]+ if mode != "index" {+ tree, err := LoadTreeByBlockID(before.GetBlockValue(itemID).Block.ID)+ if err != nil {+ t.Fatal(err)+ }+ if mode == "file" {+ missingID = before.GetBlockValue(itemID).Block.ID+ missingPath = filepath.Join(util.DataDir, tree.Box, tree.Path)+ if err = os.Remove(missingPath); err != nil {+ t.Fatal(err)+ }+ } else {+ node := treenode.NewParagraph("")+ missingID = node.ID+ tree.Root.AppendChild(node)+ treenode.UpsertBlockTree(tree)+ node.Unlink()+ if _, err = filesys.WriteTree(tree); err != nil {+ t.Fatal(err)+ }+ }+ }+ before.GetBlockValue(itemID).Block.ID = missingID+ if err := av.SaveAttributeView(before); err != nil {+ t.Fatal(err)+ }+ op.SrcIDs = []string{itemID}+ undo = undo[:1]+ undo[0].Srcs[0]["id"] = missingID+ tx := &Transaction{fromAPI: true, DoOperations: []*Operation{op}, UndoOperations: undo}+ if err := PerformTxSync(tx); err != nil {+ t.Fatal(err)+ }+ if readAttributeViewItemsTest(t, before.ID).GetBlockValue(itemID) != nil {+ t.Fatal("missing-source entry was not removed")+ }+ for range 2 {+ if err := PerformTxSync(&Transaction{isReplay: true, DoOperations: cloneOperations(tx.UndoOperations)}); err != nil {+ t.Fatal(err)+ }+ assertAttributeViewItemsEqual(t, before, readAttributeViewItemsTest(t, before.ID))+ if mode == "file" {+ if _, err := os.Stat(missingPath); !errors.Is(err, os.ErrNotExist) {+ t.Fatal("undo recreated a missing source file", err)+ }+ }+ if tree, err := LoadTreeByBlockID(missingID); err == nil && treenode.GetNodeInTree(tree, missingID) != nil && mode != "file" {+ t.Fatal("undo fabricated a source block")+ }+ if err := PerformTxSync(&Transaction{isReplay: true, DoOperations: cloneOperations(tx.DoOperations)}); err != nil {+ t.Fatal(err)+ }+ }+}+func TestAttributeViewItemsUndoRedo(t *testing.T) {for _, bound := range []bool{false, true} {name := "detached"@@ -337,6 +403,7 @@ func TestAttributeViewItemsEncryptedReplay(t *testing.T) {boxID := ast.NewNodeID()markRuntimeEncryptedBox(boxID)setDEKForTest(boxID, bytes.Repeat([]byte{0x62}, 32))+ repairEncryptedBoxStateFromDEK(boxID)av.SetAVBoxID(original.ID, boxID)t.Cleanup(func() {av.SetAVBoxID(original.ID, "")