An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:lipstick: Improve database panel field visibility menus https://github.com/siyuan-note/siyuan/issues/19993
Daniel1c1ec60ee320
diff --git a/AGENTS.md b/AGENTS.mdindex d05862091a..613901217f 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -132,6 +132,7 @@ Unambiguous mechanical edits with no behavioral or compatibility impact need no6. **CSS:** Do not use the `:has()` selector because of its performance impact- Before adding or styling a basic control, inspect and reuse the existing component, markup pattern, and shared styles in `app/src/assets/scss/component/` (for example, `b3-button`, `b3-select`, and `b3-text-field`), including existing modifiers; use `block__icon` for established icon-button patterns- Apply the same reuse-first rule to menus, dialogs, tooltips, and drag interactions: inspect existing implementations and APIs before adding a feature-specific replacement+ - For single-choice enumerations in menus, use submenu items with the current option checked rather than embedding a select control. Show a right-arrow indicator on the parent item, open its submenu on hover on desktop, and support tapping on mobile. Reuse the existing menu implementation and positioning behavior- Feature styles should describe layout (such as placement, width constraints, gaps, and wrapping), rather than duplicate or override basic control appearance (such as height, padding, typography, colors, borders, shadows, and hover/focus/disabled states). Do not use deeper selectors, inline styles, or `!important` merely to restyle a shared control- If existing controls cannot meet a requirement, explain the concrete need and prefer extending a shared component or modifier when the need is reusable. Keep necessary feature-specific exceptions narrowly scoped; use theme variables for appearance and retain keyboard focus and disabled feedback- Reuse components according to their purpose; do not borrow an unrelated component (for example, menu items for a form) and then cancel its styles. Preserve useful feature classes as theme hooks when switching to shared controlsdiff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 90e8ee2cdb..f80351ec6c 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "يسري عند فتح الإعدادات في المرة القادمة؛ يحدد كل ملحق طريقة فتح إعداداته","settingsPendingSaveError": "تعذّر حفظ التغييرات المعلّقة في المحرر. يرجى المحاولة مرة أخرى.","blockTypeParentChange": "سيؤدي هذا التحويل إلى تغيير بنية الكتلة الخارجية أو تخطيطها",- "attributePanelVisibility": "ظهور الحقل في لوحة الخصائص",+ "attributePanelVisibility": "ظهور الحقل في لوحة قاعدة البيانات","alwaysShow": "إظهار دائمًا","hideWhenEmpty": "إخفاء عندما يكون فارغًا","alwaysHide": "إخفاء دائمًا",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex f9b20b21a7..1736719de9 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Gilt beim nächsten Öffnen der Einstellungen; Plugins bestimmen selbst, wie ihre Einstellungen geöffnet werden","settingsPendingSaveError": "Ausstehende Änderungen im Editor konnten nicht gespeichert werden. Bitte erneut versuchen.","blockTypeParentChange": "Diese Umwandlung würde die Struktur oder das Layout des äußeren Blocks ändern",- "attributePanelVisibility": "Feldsichtbarkeit im Eigenschaftsbereich",+ "attributePanelVisibility": "Feldsichtbarkeit im Datenbankbereich","alwaysShow": "Immer anzeigen","hideWhenEmpty": "Ausblenden, wenn leer","alwaysHide": "Immer ausblenden",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex 67853a4b38..b666a58e2f 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Applies the next time settings are opened; plugins determine how their own settings open","settingsPendingSaveError": "Could not save pending editor changes. Please try again.","blockTypeParentChange": "This conversion would change the outer block structure or layout",- "attributePanelVisibility": "Attribute panel field visibility",+ "attributePanelVisibility": "Database panel field visibility","alwaysShow": "Always show","hideWhenEmpty": "Hide when empty","alwaysHide": "Always hide",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex df936ed185..8f4b9dc2a4 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Se aplica la próxima vez que se abran los ajustes; cada complemento decide cómo abrir sus propios ajustes","settingsPendingSaveError": "No se pudieron guardar los cambios pendientes del editor. Inténtalo de nuevo.","blockTypeParentChange": "Esta conversión cambiaría la estructura o el diseño del bloque exterior",- "attributePanelVisibility": "Visibilidad del campo en el panel de propiedades",+ "attributePanelVisibility": "Visibilidad del campo en el panel de la base de datos","alwaysShow": "Mostrar siempre","hideWhenEmpty": "Ocultar cuando esté vacío","alwaysHide": "Ocultar siempre",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 07ce3e747b..9e87898e5f 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "S’applique à la prochaine ouverture des paramètres ; les extensions décident comment ouvrir leurs propres paramètres","settingsPendingSaveError": "Impossible d'enregistrer les modifications en attente dans l'éditeur. Veuillez réessayer.","blockTypeParentChange": "Cette conversion modifierait la structure ou la disposition du bloc extérieur",- "attributePanelVisibility": "Visibilité du champ dans le panneau des propriétés",+ "attributePanelVisibility": "Visibilité du champ dans le panneau de la base de données","alwaysShow": "Toujours afficher","hideWhenEmpty": "Masquer si vide","alwaysHide": "Toujours masquer",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 2ba1272be8..38190055b2 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "יחול בפתיחה הבאה של ההגדרות; כל תוסף קובע כיצד ההגדרות שלו ייפתחו","settingsPendingSaveError": "לא ניתן לשמור את השינויים הממתינים בעורך. יש לנסות שוב.","blockTypeParentChange": "המרה זו תשנה את המבנה או הפריסה של הבלוק החיצוני",- "attributePanelVisibility": "נראות שדה בחלונית המאפיינים",+ "attributePanelVisibility": "נראות שדה בחלונית מסד הנתונים","alwaysShow": "הצג תמיד","hideWhenEmpty": "הסתר כשהשדה ריק","alwaysHide": "הסתר תמיד",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 0d923da89a..6ccdceda3d 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "अगली बार सेटिंग खोलने पर लागू होगा; प्लगइन अपनी सेटिंग खोलने का तरीका स्वयं तय करते हैं","settingsPendingSaveError": "संपादक में लंबित बदलाव सहेजे नहीं जा सके। कृपया दोबारा प्रयास करें।","blockTypeParentChange": "इस रूपांतरण से बाहरी ब्लॉक की संरचना या लेआउट बदल जाएगा",- "attributePanelVisibility": "गुण पैनल में फ़ील्ड की दृश्यता",+ "attributePanelVisibility": "डेटाबेस पैनल में फ़ील्ड की दृश्यता","alwaysShow": "हमेशा दिखाएँ","hideWhenEmpty": "खाली होने पर छिपाएँ","alwaysHide": "हमेशा छिपाएँ",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex e382ac3143..360e8fb2ef 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Berlaku saat pengaturan dibuka berikutnya; plugin menentukan cara membuka pengaturannya sendiri","settingsPendingSaveError": "Perubahan editor yang tertunda tidak dapat disimpan. Silakan coba lagi.","blockTypeParentChange": "Konversi ini akan mengubah struktur atau tata letak blok luar",- "attributePanelVisibility": "Visibilitas kolom di panel properti",+ "attributePanelVisibility": "Visibilitas kolom di panel basis data","alwaysShow": "Selalu tampilkan","hideWhenEmpty": "Sembunyikan saat kosong","alwaysHide": "Selalu sembunyikan",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 6c3599d542..cda9a8b12b 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Si applica alla prossima apertura delle impostazioni; i plugin decidono come aprire le proprie impostazioni","settingsPendingSaveError": "Impossibile salvare le modifiche in sospeso nell'editor. Riprova.","blockTypeParentChange": "Questa conversione modificherebbe la struttura o la disposizione del blocco esterno",- "attributePanelVisibility": "Visibilità del campo nel pannello delle proprietà",+ "attributePanelVisibility": "Visibilità del campo nel pannello del database","alwaysShow": "Mostra sempre","hideWhenEmpty": "Nascondi se vuoto","alwaysHide": "Nascondi sempre",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex af6de5e2e6..7f1b485e6c 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "次回設定を開くときに適用されます。プラグインの設定を開く方法は各プラグインが決定します","settingsPendingSaveError": "エディターの未保存の変更を保存できませんでした。もう一度お試しください。","blockTypeParentChange": "この変換は外側のブロックの構造やレイアウトを変更するため実行できません",- "attributePanelVisibility": "属性パネルのフィールド表示",+ "attributePanelVisibility": "データベースパネルのフィールド表示","alwaysShow": "常に表示","hideWhenEmpty": "空の場合は非表示","alwaysHide": "常に非表示",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex f32c0de5e6..9178591c69 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "다음에 설정을 열 때 적용되며, 플러그인 설정을 여는 방식은 각 플러그인이 결정합니다","settingsPendingSaveError": "편집기의 저장 대기 중인 변경 사항을 저장할 수 없습니다. 다시 시도해 주세요.","blockTypeParentChange": "이 변환은 바깥쪽 블록의 구조나 레이아웃을 변경합니다",- "attributePanelVisibility": "속성 패널 필드 표시",+ "attributePanelVisibility": "데이터베이스 패널 필드 표시","alwaysShow": "항상 표시","hideWhenEmpty": "비어 있으면 숨기기","alwaysHide": "항상 숨기기",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 192d3db459..8ae374ec58 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Geldt de volgende keer dat instellingen worden geopend; plugins bepalen hoe hun eigen instellingen openen","settingsPendingSaveError": "Niet-opgeslagen wijzigingen in de editor konden niet worden opgeslagen. Probeer het opnieuw.","blockTypeParentChange": "Deze conversie zou de structuur of indeling van het buitenste blok wijzigen",- "attributePanelVisibility": "Veldzichtbaarheid in het eigenschappenpaneel",+ "attributePanelVisibility": "Veldzichtbaarheid in het databasepaneel","alwaysShow": "Altijd tonen","hideWhenEmpty": "Verbergen indien leeg","alwaysHide": "Altijd verbergen",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex 7d2153232a..219ad525d3 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Obowiązuje przy następnym otwarciu ustawień; wtyczki decydują, jak otwierać własne ustawienia","settingsPendingSaveError": "Nie udało się zapisać oczekujących zmian w edytorze. Spróbuj ponownie.","blockTypeParentChange": "Ta konwersja zmieniłaby strukturę lub układ bloku zewnętrznego",- "attributePanelVisibility": "Widoczność pola w panelu właściwości",+ "attributePanelVisibility": "Widoczność pola w panelu bazy danych","alwaysShow": "Zawsze pokazuj","hideWhenEmpty": "Ukryj, gdy puste","alwaysHide": "Zawsze ukrywaj",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex a1a8248aa0..048d980120 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Aplica-se na próxima abertura das configurações; os plugins determinam como abrir suas próprias configurações","settingsPendingSaveError": "Não foi possível salvar as alterações pendentes no editor. Tente novamente.","blockTypeParentChange": "Esta conversão alteraria a estrutura ou o layout do bloco externo",- "attributePanelVisibility": "Visibilidade do campo no painel de propriedades",+ "attributePanelVisibility": "Visibilidade do campo no painel do banco de dados","alwaysShow": "Sempre mostrar","hideWhenEmpty": "Ocultar quando vazio","alwaysHide": "Sempre ocultar",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex f8cce3ebd4..1ef13ad937 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Применяется при следующем открытии настроек; плагины определяют способ открытия своих настроек","settingsPendingSaveError": "Не удалось сохранить ожидающие изменения в редакторе. Попробуйте ещё раз.","blockTypeParentChange": "Это преобразование изменит структуру или расположение внешнего блока",- "attributePanelVisibility": "Видимость поля в панели свойств",+ "attributePanelVisibility": "Видимость поля на панели базы данных","alwaysShow": "Всегда показывать","hideWhenEmpty": "Скрывать, если пусто","alwaysHide": "Всегда скрывать",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex 40cacb7d5f..a079cda2af 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Platí pri ďalšom otvorení nastavení; doplnky určujú spôsob otvorenia svojich vlastných nastavení","settingsPendingSaveError": "Nepodarilo sa uložiť čakajúce zmeny v editore. Skúste to znova.","blockTypeParentChange": "Táto konverzia by zmenila štruktúru alebo rozloženie vonkajšieho bloku",- "attributePanelVisibility": "Viditeľnosť poľa na paneli vlastností",+ "attributePanelVisibility": "Viditeľnosť poľa na paneli databázy","alwaysShow": "Vždy zobraziť","hideWhenEmpty": "Skryť, ak je prázdne","alwaysHide": "Vždy skryť",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex 178b4dab07..174e812510 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Примењује се при следећем отварању подешавања; додаци одређују како се отварају њихова подешавања","settingsPendingSaveError": "Није могуће сачувати промене на чекању у уређивачу. Покушајте поново.","blockTypeParentChange": "Ова конверзија би променила структуру или распоред спољног блока",- "attributePanelVisibility": "Видљивост поља у панелу својстава",+ "attributePanelVisibility": "Видљивост поља у панелу базе података","alwaysShow": "Увек прикажи","hideWhenEmpty": "Сакриј када је празно","alwaysHide": "Увек сакриј",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex 103a0c27a2..1ae43c8e69 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "มีผลเมื่อเปิดการตั้งค่าครั้งถัดไป ส่วนปลั๊กอินจะกำหนดวิธีเปิดการตั้งค่าของตนเอง","settingsPendingSaveError": "ไม่สามารถบันทึกการเปลี่ยนแปลงที่ค้างอยู่ในตัวแก้ไขได้ โปรดลองอีกครั้ง","blockTypeParentChange": "การแปลงนี้จะเปลี่ยนโครงสร้างหรือเค้าโครงของบล็อกภายนอก",- "attributePanelVisibility": "การแสดงฟิลด์ในแผงคุณสมบัติ",+ "attributePanelVisibility": "การแสดงฟิลด์ในแผงฐานข้อมูล","alwaysShow": "แสดงเสมอ","hideWhenEmpty": "ซ่อนเมื่อว่าง","alwaysHide": "ซ่อนเสมอ",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex d98b8c5dbe..3edee7754d 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Ayarlar bir sonraki açılışta uygulanır; eklentiler kendi ayarlarının nasıl açılacağını belirler","settingsPendingSaveError": "Düzenleyicide bekleyen değişiklikler kaydedilemedi. Lütfen tekrar deneyin.","blockTypeParentChange": "Bu dönüştürme dış bloğun yapısını veya düzenini değiştirir",- "attributePanelVisibility": "Özellik panelindeki alan görünürlüğü",+ "attributePanelVisibility": "Veritabanı panelindeki alan görünürlüğü","alwaysShow": "Her zaman göster","hideWhenEmpty": "Boş olduğunda gizle","alwaysHide": "Her zaman gizle",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex a0982933b5..1a808bd82d 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "Застосовується під час наступного відкриття налаштувань; плагіни визначають спосіб відкриття власних налаштувань","settingsPendingSaveError": "Не вдалося зберегти зміни, що очікують у редакторі. Спробуйте ще раз.","blockTypeParentChange": "Це перетворення змінить структуру або розташування зовнішнього блоку",- "attributePanelVisibility": "Видимість поля в панелі властивостей",+ "attributePanelVisibility": "Видимість поля на панелі бази даних","alwaysShow": "Завжди показувати","hideWhenEmpty": "Приховувати, якщо порожнє","alwaysHide": "Завжди приховувати",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 35ce9637d3..31a5530984 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "下次打开设置界面时生效,插件设置的打开方式由插件决定","settingsPendingSaveError": "无法保存编辑器中尚未提交的修改,请重试。","blockTypeParentChange": "此转换会改变外层块的结构或布局",- "attributePanelVisibility": "属性面板字段可见性",+ "attributePanelVisibility": "数据库面板字段可见性","alwaysShow": "始终显示","hideWhenEmpty": "空白时隐藏","alwaysHide": "始终隐藏",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 1143879ad8..835edd4fae 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -16,7 +16,7 @@"settingsWindowModeTip": "下次開啟設定介面時生效,外掛程式設定的開啟方式由外掛程式決定","settingsPendingSaveError": "無法儲存編輯器中尚未提交的變更,請重試。","blockTypeParentChange": "此轉換會改變外層區塊的結構或版面配置",- "attributePanelVisibility": "屬性面板欄位可見性",+ "attributePanelVisibility": "資料庫面板欄位可見性","alwaysShow": "始終顯示","hideWhenEmpty": "空白時隱藏","alwaysHide": "始終隱藏",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 8cab76b008..1f8ac6349e 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": "20260930212321"+ "updated": "20261001060000"},"Children": [{@@ -45,12 +45,12 @@"HeadingLevel": 2,"Properties": {"id": "20260930175958-jgqkczm",- "updated": "20260930175958"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "Attribute panel field visibility"+ "Data": "Database panel field visibility"}]},@@ -59,12 +59,12 @@"Type": "NodeParagraph","Properties": {"id": "20260930175958-sqtxjcl",- "updated": "20260930212321"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "In a database attribute panel at the top of a document, on a database entry page, or in a block attribute dialog, click a field name to set Attribute panel field visibility to Always show, Hide when empty, or Always hide. Default preserves the panel's existing display settings; the panel at the top of a document follows the global setting for hiding empty fields. Rules apply to attribute panels of that database and do not change field visibility in its views. Click the panel's edit button to temporarily reveal hidden fields and edit their values or visibility rules."+ "Data": "In a database attribute panel at the top of a document, on a database entry page, or in a block attribute dialog, click a field name to set Database panel field visibility to Always show, Hide when empty, or Always hide. Default preserves the panel's existing display settings; the panel at the top of a document follows the global setting for hiding empty fields. Rules apply to attribute panels of that database and do not change field visibility in its views. Click the panel's edit button to temporarily reveal hidden fields and edit their values or visibility rules."}]},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 eb1f5e3270..25d3b4033f 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": "20260930212321"+ "updated": "20261001060000"},"Children": [{@@ -45,12 +45,12 @@"HeadingLevel": 2,"Properties": {"id": "20260930175958-maj1ve9",- "updated": "20260930175958"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "属性面板字段可见性"+ "Data": "数据库面板字段可见性"}]},@@ -59,12 +59,12 @@"Type": "NodeParagraph","Properties": {"id": "20260930175958-aw9rfh1",- "updated": "20260930212321"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "在文档顶部、数据库条目页或块属性对话框的数据库属性面板中点击字段名,可以将“属性面板字段可见性”设置为“始终显示”“空白时隐藏”或“始终隐藏”。“默认”保留面板原有的显示设置,其中文档顶部面板沿用全局隐藏空字段设置。规则对该数据库的属性面板生效,不影响数据库各视图的字段显隐。点击面板的编辑按钮可以临时展开隐藏字段,编辑字段值或修改显示规则。"+ "Data": "在文档顶部、数据库条目页或块属性对话框的数据库属性面板中点击字段名,可以将“数据库面板字段可见性”设置为“始终显示”“空白时隐藏”或“始终隐藏”。“默认”保留面板原有的显示设置,其中文档顶部面板沿用全局隐藏空字段设置。规则对该数据库的属性面板生效,不影响数据库各视图的字段显隐。点击面板的编辑按钮可以临时展开隐藏字段,编辑字段值或修改显示规则。"}]},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 c5e609d4a9..f656fe8b98 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": "20260930212321"+ "updated": "20261001060000"},"Children": [{@@ -45,12 +45,12 @@"HeadingLevel": 2,"Properties": {"id": "20260930175958-lm4h64b",- "updated": "20260930175958"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "屬性面板欄位可見性"+ "Data": "資料庫面板欄位可見性"}]},@@ -59,12 +59,12 @@"Type": "NodeParagraph","Properties": {"id": "20260930175958-m98nd8z",- "updated": "20260930212321"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "在文件頂部、資料庫項目頁或區塊屬性對話方塊的資料庫屬性面板中點選欄位名稱,可以將「屬性面板欄位可見性」設為「始終顯示」「空白時隱藏」或「始終隱藏」。「預設」保留面板原有的顯示設定,其中文件頂部面板沿用全域隱藏空欄位設定。規則對該資料庫的屬性面板生效,不影響資料庫各檢視的欄位顯隱。點選面板的編輯按鈕可以暫時展開隱藏欄位,編輯欄位值或修改顯示規則。"+ "Data": "在文件頂部、資料庫項目頁或區塊屬性對話方塊的資料庫屬性面板中點選欄位名稱,可以將「資料庫面板欄位可見性」設為「始終顯示」「空白時隱藏」或「始終隱藏」。「預設」保留面板原有的顯示設定,其中文件頂部面板沿用全域隱藏空欄位設定。規則對該資料庫的屬性面板生效,不影響資料庫各檢視的欄位顯隱。點選面板的編輯按鈕可以暫時展開隱藏欄位,編輯欄位值或修改顯示規則。"}]},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 7df2cc6347..8332be5554 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": "20260930212321"+ "updated": "20261001060000"},"Children": [{@@ -46,12 +46,12 @@"HeadingLevel": 2,"Properties": {"id": "20260930175958-ucbrk0m",- "updated": "20260930175958"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "属性パネルのフィールド表示"+ "Data": "データベースパネルのフィールド表示"}]},@@ -60,12 +60,12 @@"Type": "NodeParagraph","Properties": {"id": "20260930175958-49g85qs",- "updated": "20260930212321"+ "updated": "20261001060000"},"Children": [{"Type": "NodeText",- "Data": "ドキュメント上部、データベース項目ページ、またはブロック属性ダイアログのデータベース属性パネルでフィールド名をクリックすると、「属性パネルのフィールド表示」を「常に表示」「空の場合は非表示」「常に非表示」に設定できます。「デフォルト」はパネルの従来の表示設定を維持し、ドキュメント上部のパネルでは空のフィールドを非表示にする全体設定に従います。ルールはそのデータベースの属性パネルに適用され、各ビューのフィールド表示には影響しません。パネルの編集ボタンをクリックすると、非表示のフィールドを一時的に展開して値や表示ルールを編集できます。"+ "Data": "ドキュメント上部、データベース項目ページ、またはブロック属性ダイアログのデータベース属性パネルでフィールド名をクリックすると、「データベースパネルのフィールド表示」を「常に表示」「空の場合は非表示」「常に非表示」に設定できます。「デフォルト」はパネルの従来の表示設定を維持し、ドキュメント上部のパネルでは空のフィールドを非表示にする全体設定に従います。ルールはそのデータベースの属性パネルに適用され、各ビューのフィールド表示には影響しません。パネルの編集ボタンをクリックすると、非表示のフィールドを一時的に展開して値や表示ルールを編集できます。"}]},diff --git a/app/src/protyle/render/av/attributePanelVisibility.test.ts b/app/src/protyle/render/av/attributePanelVisibility.test.tsindex dbf860e4aa..6ce77ef52a 100644--- a/app/src/protyle/render/av/attributePanelVisibility.test.ts+++ b/app/src/protyle/render/av/attributePanelVisibility.test.ts@@ -8,12 +8,12 @@ import {promisify} from "node:util";import {ScriptTarget, transpileModule} from "typescript";import {compileString} from "sass";-const browserCases = (source: string, css: string, columnSource: string, blockSource: string) => {+const browserCases = (source: string, css: string, columnSource: string, blockSource: string, menuSource: string) => {const check: typeof assert = require("node:assert/strict");const config = {editor: {databaseAttrShow: true, databaseAttrHideEmpty: false, databaseAttrViewMode: 0, databaseAttrUseTabs: false}};Object.assign(window, {siyuan: {config, languages: {database: "Database", edit: "Edit", displayEmptyFields: "Show", hideEmptyFields: "Hide",- default: "Default", attributePanelVisibility: "Attribute panel visibility",+ default: "Default", attributePanelVisibility: "Database panel field visibility",alwaysShow: "Always show", hideWhenEmpty: "Hide when empty", alwaysHide: "Always hide",}}});const Panel = new Function("cancelHeightAnimation", source + "\nreturn AVAttributePanel;")(() => {});@@ -64,26 +64,52 @@ const browserCases = (source: string, css: string, columnSource: string, blockSo}const transactions: unknown[][] = [];const escape = (value: string) => value || "";- const columns = new Function("getFieldsByData", "escapeAttr", "escapeHtml", "escapeAriaLabel", "bindRollupData", "transaction",+ let mobile = false;+ let submenuShown = 0;+ let mobileChoices: IMenu[] = [];+ Object.assign(window.siyuan, {menus: {menu: {remove() {}, showSubMenu() { submenuShown++; }}}});+ const Item = new Function("updateMenuItemGroupClasses", menuSource + "\nreturn MenuItem;")(() => {});+ class MobileMenu {+ public addItem(item: IMenu) { mobileChoices.push(item); }+ public open() {}+ }+ const columns = new Function("getFieldsByData", "escapeAttr", "escapeHtml", "escapeAriaLabel", "bindRollupData", "transaction", "MenuItem", "Menu", "isMobile",columnSource + "\nreturn {getEditHTML, bindEditEvent};")((data: IAV) => (data.view as IAVTable).columns, escape, escape, escape, () => {},- (_protyle: IProtyle, operations: IOperation[], undo: IOperation[]) => transactions.push([operations, undo]));+ (_protyle: IProtyle, operations: IOperation[], undo: IOperation[]) => transactions.push([operations, undo]),+ Item, MobileMenu, () => mobile);for (const visibility of [undefined, "always", "hide-empty", "hide"]) {const field = {id: "key", name: "Notes", type: "text", attributePanelVisibility: visibility};const data = {id: "database", viewType: "table", view: {columns: [field]}};const menuElement = document.createElement("div");const options = {data, colId: field.id, isCustomAttr: true, menuElement};- menuElement.innerHTML = columns.getEditHTML(options);document.body.append(menuElement);- columns.bindEditEvent(options);- const select = menuElement.querySelector<HTMLSelectElement>('[data-type="attributePanelVisibility"]');- check.deepEqual(Array.from(select.options, option => option.value), ["", "always", "hide-empty", "hide"]);- check.equal(select.value, visibility || "");let previous = visibility || "";- for (const next of ["hide", "always", ""]) {+ for (const next of [previous, "hide", "hide-empty", "always", ""]) {+ menuElement.innerHTML = columns.getEditHTML(options);+ columns.bindEditEvent(options);+ const parent = menuElement.querySelector<HTMLButtonElement>('[data-type="attributePanelVisibility"]');+ const buttons = Array.from(parent.querySelectorAll<HTMLButtonElement>(".b3-menu__submenu .b3-menu__item"));+ check.equal(parent.querySelector("select"), null);+ check.equal(Array.from(parent.querySelectorAll("use")).some(use => use.getAttribute("xlink:href") === "#iconRight"), true);+ check.deepEqual(buttons.map(button => button.querySelector(".b3-menu__label").textContent),+ ["Default", "Always show", "Hide when empty", "Always hide"]);+ const values = ["", "always", "hide-empty", "hide"];+ check.equal(buttons.findIndex(button => !!button.querySelector(".b3-menu__checked")), values.indexOf(previous));+ const shown = submenuShown;+ parent.dispatchEvent(new MouseEvent("mouseenter"));+ check.equal(submenuShown, shown + 1);+ check.equal(parent.classList.contains("b3-menu__item--show"), true);+ parent.dispatchEvent(new KeyboardEvent("keydown", {key: "ArrowRight", bubbles: true}));+ check.equal(document.activeElement, buttons[0]);+ buttons[0].dispatchEvent(new KeyboardEvent("keydown", {key: "ArrowLeft", bubbles: true}));+ check.equal(parent.classList.contains("b3-menu__item--show"), false);+ check.equal(document.activeElement, parent);+ parent.dispatchEvent(new MouseEvent("mouseenter"));+ menuElement.querySelector('[data-type="name"]').dispatchEvent(new MouseEvent("mouseover", {bubbles: true}));+ check.equal(parent.classList.contains("b3-menu__item--show"), false, "hovering another item closes the submenu");const count = transactions.length;- select.value = next;- select.dispatchEvent(new Event("change", {bubbles: true}));+ buttons[values.indexOf(next)].click();if (next === previous) {check.equal(transactions.length, count);} else {@@ -96,6 +122,20 @@ const browserCases = (source: string, css: string, columnSource: string, blockSoprevious = next;}}+ mobile = true;+ mobileChoices = [];+ menuElement.innerHTML = columns.getEditHTML(options);+ columns.bindEditEvent(options);+ const mobileParent = menuElement.querySelector<HTMLButtonElement>('[data-type="attributePanelVisibility"]');+ const shown = submenuShown;+ mobileParent.dispatchEvent(new MouseEvent("mouseenter"));+ check.equal(submenuShown, shown, "mobile opens choices by tap rather than hover");+ mobileParent.click();+ check.equal(mobileChoices.length, 4);+ check.equal(mobileChoices[0].checked, true);+ mobileChoices[2].click(mobileParent, new MouseEvent("click"));+ check.equal(field.attributePanelVisibility, "hide-empty");+ mobile = false;menuElement.innerHTML = columns.getEditHTML({...options, isCustomAttr: false});check.equal(menuElement.querySelector('[data-type="attributePanelVisibility"]'), null);menuElement.remove();@@ -174,16 +214,20 @@ test("attribute panel field rules preserve global defaults and reveal hidden fieconst blockSource = transpileModule(readFileSync(path.resolve(__dirname, "blockAttr.ts"), "utf8").replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, ""),{compilerOptions: {target: ScriptTarget.ES2021}}).outputText;+ const menuSource = transpileModule(readFileSync("src/menus/Menu.ts", "utf8")+ .replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, ""),+ {compilerOptions: {target: ScriptTarget.ES2021}}).outputText;const temporary = mkdtempSync(path.join(tmpdir(), "siyuan-panel-visibility-test-"));const script = path.join(temporary, "run.cjs");- const code = "const __name = value => value; (" + browserCases.toString() + ")(" + JSON.stringify(source) + "," + JSON.stringify(css) + "," + JSON.stringify(columnSource) + "," + JSON.stringify(blockSource) + ")";+ const code = "const __name = value => value; (" + browserCases.toString() + ")(" + JSON.stringify(source) + "," + JSON.stringify(css) + "," + JSON.stringify(columnSource) + "," + JSON.stringify(blockSource) + "," + JSON.stringify(menuSource) + ")";writeFileSync(script, `const {app, BrowserWindow} = require("electron");app.setPath("userData", ${JSON.stringify(path.join(temporary, "profile"))});app.whenReady().then(async () => {const win = new BrowserWindow({show: false, webPreferences: {nodeIntegration: true, contextIsolation: false}});+ win.webContents.on("console-message", event => console.error(event.message));try {await win.loadURL("data:text/html,<html><body></body></html>");- console.log(await win.webContents.executeJavaScript(${JSON.stringify(code)}));+ console.log(await win.webContents.executeJavaScript(${JSON.stringify("try {" + code + "} catch (error) {console.error(error.stack); throw error;}")}));app.exit(0);} catch (error) { console.error(error); app.exit(1); }});`, "utf8");diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex ebd3ce1b78..9fea161b8b 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -1,6 +1,7 @@import {isTableLikeView} from "./viewType";import {isAVRenderData} from "./renderData";import {Menu} from "../../../plugin/Menu";+import {MenuItem} from "../../../menus/Menu";import {transaction} from "../../wysiwyg/transaction";import {fetchPost, fetchSyncPost} from "../../../util/fetch";import {getDefaultOperatorByType, getEditableFilters, hasFilterForColumn} from "./filter";@@ -248,18 +249,7 @@ export const getEditHTML = (options: {</button>`;}if (options.isCustomAttr) {- const visibility = colData.attributePanelVisibility || "";- html += `<label class="b3-menu__item">- <span class="b3-menu__label">${window.siyuan.languages.attributePanelVisibility}</span>- <select class="b3-select" data-type="attributePanelVisibility">- ${[- ["", window.siyuan.languages.default],- ["always", window.siyuan.languages.alwaysShow],- ["hide-empty", window.siyuan.languages.hideWhenEmpty],- ["hide", window.siyuan.languages.alwaysHide],- ].map(([value, label]) => `<option value="${value}"${visibility === value ? " selected" : ""}>${label}</option>`).join("")}- </select>-</label>`;+ html += '<button class="b3-menu__item" data-type="attributePanelVisibility"></button>';}if (colData.type !== "block") {html += `<button class="b3-menu__item${colData.type === "relation" ? " fn__none" : ""}" data-type="duplicateCol">@@ -311,19 +301,69 @@ export const bindEditEvent = (options: {const avID = options.data.id;const colId = options.menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id");const colData = getFieldsByData(options.data).find((item: IAVColumn) => item.id === colId);- options.menuElement.querySelector<HTMLSelectElement>('[data-type="attributePanelVisibility"]')?.addEventListener("change", event => {- const visibility = (event.target as HTMLSelectElement).value as IAVColumn["attributePanelVisibility"];- const previous = colData.attributePanelVisibility || "";- if (visibility === previous) {- return;+ const visibilityElement = options.menuElement.querySelector('[data-type="attributePanelVisibility"]');+ if (visibilityElement) {+ const choices: Array<[IAVColumn["attributePanelVisibility"], string]> = [+ ["", window.siyuan.languages.default], ["always", window.siyuan.languages.alwaysShow],+ ["hide-empty", window.siyuan.languages.hideWhenEmpty], ["hide", window.siyuan.languages.alwaysHide],+ ];+ const items: IMenu[] = choices.map(([visibility, label]) => ({+ label, iconHTML: "", checked: (colData.attributePanelVisibility || "") === visibility,+ click: () => {+ const previous = colData.attributePanelVisibility || "";+ if (visibility !== previous) {+ transaction(options.protyle, [{+ action: "setAttrViewColAttributePanelVisibility", id: colId, avID, data: visibility,+ }], [{+ action: "setAttrViewColAttributePanelVisibility", id: colId, avID, data: previous,+ }]);+ colData.attributePanelVisibility = visibility;+ }+ options.menuElement.closest(".av__panel")?.remove();+ },+ }));+ const item = new MenuItem({icon: "iconEye", label: window.siyuan.languages.attributePanelVisibility, submenu: items});+ visibilityElement.replaceWith(item.element);+ item.element.dataset.type = "attributePanelVisibility";+ const submenu = item.element.querySelector<HTMLElement>(".b3-menu__submenu");+ const showSubmenu = () => {+ item.element.classList.add("b3-menu__item--show");+ window.siyuan.menus.menu.showSubMenu(submenu);+ };+ if (!isMobile()) {+ item.element.addEventListener("mouseenter", showSubmenu);+ item.element.addEventListener("keydown", event => {+ if (event.key === "ArrowRight") {+ event.preventDefault();+ event.stopPropagation();+ showSubmenu();+ submenu.querySelector<HTMLButtonElement>(".b3-menu__item").focus();+ } else if (event.key === "ArrowLeft" || event.key === "Escape") {+ event.preventDefault();+ event.stopPropagation();+ item.element.classList.remove("b3-menu__item--show");+ item.element.focus();+ }+ });+ options.menuElement.addEventListener("mouseover", event => {+ if (!item.element.contains(event.target as Node)) {+ item.element.classList.remove("b3-menu__item--show");+ }+ });}- transaction(options.protyle, [{- action: "setAttrViewColAttributePanelVisibility", id: colId, avID, data: visibility,- }], [{- action: "setAttrViewColAttributePanelVisibility", id: colId, avID, data: previous,- }]);- colData.attributePanelVisibility = visibility;- });+ item.element.addEventListener("click", event => {+ event.preventDefault();+ event.stopPropagation();+ if (isMobile()) {+ const menu = new Menu(undefined, undefined, true);+ items.forEach(choice => menu.addItem(choice));+ const rect = item.element.getBoundingClientRect();+ menu.open({x: rect.left, y: rect.bottom, h: rect.height});+ } else {+ showSubmenu();+ }+ });+ }const nameElement = options.menuElement.querySelector('[data-type="name"]') as HTMLInputElement;nameElement.addEventListener("blur", () => {const newValue = nameElement.value;