Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: Support toggling dock panels https://github.com/siyuan-note/siyuan/issues/18876

Daniel7cc80a62e265
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 7974f5fe0e..573c3088a8 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "إظهار/إخفاء لوحة الإرساء اليسرى",
+ "toggleRightDockPanel": "إظهار/إخفاء لوحة الإرساء اليمنى",
+ "toggleBottomDockPanel": "إظهار/إخفاء لوحة الإرساء السفلية",
"cursorSurroundingLines": "أسطر السياق حول المؤشر",
"cursorSurroundingLinesTip": "الحد الأدنى لعدد الأسطر المرئية بين المؤشر وحافتي المحرر العلوية والسفلية عند التنقل عموديًا باستخدام لوحة المفاتيح، و0 لتعطيل الميزة",
"applicationZoom": "تكبير/تصغير واجهة التطبيق",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 65cd49fd76..d89306f781 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Linkes Dock-Panel ein-/ausblenden",
+ "toggleRightDockPanel": "Rechtes Dock-Panel ein-/ausblenden",
+ "toggleBottomDockPanel": "Unteres Dock-Panel ein-/ausblenden",
"cursorSurroundingLines": "Kontextzeilen um den Cursor",
"cursorSurroundingLinesTip": "Mindestanzahl sichtbarer Zeilen zwischen Cursor und oberem bzw. unterem Editorrand bei vertikaler Tastaturnavigation, 0 deaktiviert die Funktion",
"applicationZoom": "Anwendungsoberfläche skalieren",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 3cd7b44c49..346df62f1c 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Show/Hide Left Dock Panel",
+ "toggleRightDockPanel": "Show/Hide Right Dock Panel",
+ "toggleBottomDockPanel": "Show/Hide Bottom Dock Panel",
"cursorSurroundingLines": "Cursor surrounding lines",
"cursorSurroundingLinesTip": "Minimum number of visible lines between the cursor and the top or bottom edge of the editor when navigating vertically with the keyboard, 0 to disable",
"applicationZoom": "Application Zoom",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 32baecf212..c5b248530c 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Mostrar/ocultar panel de acoplamiento izquierdo",
+ "toggleRightDockPanel": "Mostrar/ocultar panel de acoplamiento derecho",
+ "toggleBottomDockPanel": "Mostrar/ocultar panel de acoplamiento inferior",
"cursorSurroundingLines": "Líneas de contexto alrededor del cursor",
"cursorSurroundingLinesTip": "Número mínimo de líneas visibles entre el cursor y los bordes superior e inferior del editor al desplazarse verticalmente con el teclado, 0 para desactivar",
"applicationZoom": "Escala de la interfaz de la aplicación",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 42f5ee2b64..1474f7fdd6 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Afficher/masquer le panneau d’ancrage gauche",
+ "toggleRightDockPanel": "Afficher/masquer le panneau d’ancrage droit",
+ "toggleBottomDockPanel": "Afficher/masquer le panneau d’ancrage inférieur",
"cursorSurroundingLines": "Lignes de contexte autour du curseur",
"cursorSurroundingLinesTip": "Nombre minimal de lignes visibles entre le curseur et les bords supérieur et inférieur de l’éditeur lors d’un déplacement vertical au clavier, 0 pour désactiver",
"applicationZoom": "Zoom de l’interface de l’application",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 5b1e8c3aad..1faf678035 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "הצג/הסתר את חלונית העגינה השמאלית",
+ "toggleRightDockPanel": "הצג/הסתר את חלונית העגינה הימנית",
+ "toggleBottomDockPanel": "הצג/הסתר את חלונית העגינה התחתונה",
"cursorSurroundingLines": "שורות הקשר סביב הסמן",
"cursorSurroundingLinesTip": "מספר השורות הגלויות המזערי בין הסמן לקצה העליון או התחתון של העורך בעת ניווט אנכי באמצעות המקלדת, 0 להשבתה",
"applicationZoom": "שינוי קנה המידה של ממשק היישום",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index 76f4653580..2ad9a16125 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "बायाँ डॉक पैनल दिखाएँ/छिपाएँ",
+ "toggleRightDockPanel": "दायाँ डॉक पैनल दिखाएँ/छिपाएँ",
+ "toggleBottomDockPanel": "निचला डॉक पैनल दिखाएँ/छिपाएँ",
"cursorSurroundingLines": "कर्सर के आसपास संदर्भ पंक्तियाँ",
"cursorSurroundingLinesTip": "कीबोर्ड से लंबवत नेविगेट करते समय कर्सर और संपादक के ऊपरी या निचले किनारे के बीच दिखाई देने वाली पंक्तियों की न्यूनतम संख्या, अक्षम करने के लिए 0",
"applicationZoom": "एप्लिकेशन इंटरफ़ेस ज़ूम",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 29f2eb3612..11087bee69 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Tampilkan/sembunyikan panel dock kiri",
+ "toggleRightDockPanel": "Tampilkan/sembunyikan panel dock kanan",
+ "toggleBottomDockPanel": "Tampilkan/sembunyikan panel dock bawah",
"cursorSurroundingLines": "Baris konteks di sekitar kursor",
"cursorSurroundingLinesTip": "Jumlah minimum baris yang terlihat antara kursor dan tepi atas atau bawah editor saat bernavigasi secara vertikal dengan papan ketik, 0 untuk menonaktifkan",
"applicationZoom": "Zoom antarmuka aplikasi",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 60312ab1c7..aaeb55b8aa 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Mostra/nascondi il pannello dock sinistro",
+ "toggleRightDockPanel": "Mostra/nascondi il pannello dock destro",
+ "toggleBottomDockPanel": "Mostra/nascondi il pannello dock inferiore",
"cursorSurroundingLines": "Righe di contesto attorno al cursore",
"cursorSurroundingLinesTip": "Numero minimo di righe visibili tra il cursore e il bordo superiore o inferiore dell’editor durante la navigazione verticale con la tastiera, 0 per disattivare",
"applicationZoom": "Zoom dell’interfaccia dell’applicazione",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index dbd7508bc0..bb67bfd8f4 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "左側ドックパネルの表示/非表示",
+ "toggleRightDockPanel": "右側ドックパネルの表示/非表示",
+ "toggleBottomDockPanel": "下側ドックパネルの表示/非表示",
"cursorSurroundingLines": "カーソル周辺のコンテキスト行数",
"cursorSurroundingLinesTip": "キーボードで上下に移動するとき、カーソルとエディターの上端または下端との間に表示する最小行数、0 で無効",
"applicationZoom": "アプリケーションインターフェースのズーム",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index aaf0f030b9..3a292deecb 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "왼쪽 Dock 패널 보이기/숨기기",
+ "toggleRightDockPanel": "오른쪽 Dock 패널 보이기/숨기기",
+ "toggleBottomDockPanel": "아래쪽 Dock 패널 보이기/숨기기",
"cursorSurroundingLines": "커서 주변 문맥 줄 수",
"cursorSurroundingLinesTip": "키보드로 세로 이동할 때 커서와 편집기 위쪽 또는 아래쪽 가장자리 사이에 표시할 최소 줄 수, 0이면 비활성화",
"applicationZoom": "애플리케이션 인터페이스 확대/축소",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index bde8f2aa5d..5ea94fa14c 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Linker dockpaneel tonen/verbergen",
+ "toggleRightDockPanel": "Rechter dockpaneel tonen/verbergen",
+ "toggleBottomDockPanel": "Onderste dockpaneel tonen/verbergen",
"cursorSurroundingLines": "Contextregels rond de cursor",
"cursorSurroundingLinesTip": "Minimumaantal zichtbare regels tussen de cursor en de boven- of onderrand van de editor bij verticale toetsenbordnavigatie, 0 om uit te schakelen",
"applicationZoom": "Zoom van toepassingsinterface",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 9937127dcd..318cfafee9 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Pokaż/ukryj lewy panel dokowania",
+ "toggleRightDockPanel": "Pokaż/ukryj prawy panel dokowania",
+ "toggleBottomDockPanel": "Pokaż/ukryj dolny panel dokowania",
"cursorSurroundingLines": "Wiersze kontekstu wokół kursora",
"cursorSurroundingLinesTip": "Minimalna liczba widocznych wierszy między kursorem a górną lub dolną krawędzią edytora podczas pionowej nawigacji klawiaturą, 0 wyłącza funkcję",
"applicationZoom": "Powiększenie interfejsu aplikacji",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 19e56d31eb..d65e3cf256 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Mostrar/ocultar painel de encaixe esquerdo",
+ "toggleRightDockPanel": "Mostrar/ocultar painel de encaixe direito",
+ "toggleBottomDockPanel": "Mostrar/ocultar painel de encaixe inferior",
"cursorSurroundingLines": "Linhas de contexto ao redor do cursor",
"cursorSurroundingLinesTip": "Número mínimo de linhas visíveis entre o cursor e as bordas superior ou inferior do editor ao navegar verticalmente com o teclado, 0 para desativar",
"applicationZoom": "Zoom da interface do aplicativo",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 7f3cb3bc0b..61ad7fa7f7 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Показать/скрыть левую док-панель",
+ "toggleRightDockPanel": "Показать/скрыть правую док-панель",
+ "toggleBottomDockPanel": "Показать/скрыть нижнюю док-панель",
"cursorSurroundingLines": "Строки контекста вокруг курсора",
"cursorSurroundingLinesTip": "Минимальное количество видимых строк между курсором и верхним или нижним краем редактора при вертикальной навигации с клавиатуры, 0 для отключения",
"applicationZoom": "Масштаб интерфейса приложения",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 8f9c88596b..4d6b05bed2 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Zobraziť/skryť ľavý dokovací panel",
+ "toggleRightDockPanel": "Zobraziť/skryť pravý dokovací panel",
+ "toggleBottomDockPanel": "Zobraziť/skryť spodný dokovací panel",
"cursorSurroundingLines": "Riadky kontextu okolo kurzora",
"cursorSurroundingLinesTip": "Minimálny počet viditeľných riadkov medzi kurzorom a horným alebo dolným okrajom editora pri zvislej navigácii klávesnicou, 0 funkciu vypne",
"applicationZoom": "Priblíženie rozhrania aplikácie",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index cab51751f3..b65bde5b66 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "แสดง/ซ่อนแผงด็อกด้านซ้าย",
+ "toggleRightDockPanel": "แสดง/ซ่อนแผงด็อกด้านขวา",
+ "toggleBottomDockPanel": "แสดง/ซ่อนแผงด็อกด้านล่าง",
"cursorSurroundingLines": "บรรทัดบริบทรอบเคอร์เซอร์",
"cursorSurroundingLinesTip": "จำนวนบรรทัดที่มองเห็นขั้นต่ำระหว่างเคอร์เซอร์กับขอบบนหรือขอบล่างของตัวแก้ไขเมื่อเลื่อนในแนวตั้งด้วยแป้นพิมพ์ โดย 0 คือปิดใช้งาน",
"applicationZoom": "ซูมส่วนติดต่อแอปพลิเคชัน",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 428e4fb39d..2760c34e0b 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Sol dock panelini göster/gizle",
+ "toggleRightDockPanel": "Sağ dock panelini göster/gizle",
+ "toggleBottomDockPanel": "Alt dock panelini göster/gizle",
"cursorSurroundingLines": "İmleç çevresindeki bağlam satırları",
"cursorSurroundingLinesTip": "Klavye ile dikey gezinirken imleç ile düzenleyicinin üst veya alt kenarı arasında görünecek en az satır sayısı, devre dışı bırakmak için 0",
"applicationZoom": "Uygulama arayüzü yakınlaştırması",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index db3dd55741..9f161a2a41 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "Показати/приховати ліву док-панель",
+ "toggleRightDockPanel": "Показати/приховати праву док-панель",
+ "toggleBottomDockPanel": "Показати/приховати нижню док-панель",
"cursorSurroundingLines": "Рядки контексту навколо курсора",
"cursorSurroundingLinesTip": "Мінімальна кількість видимих рядків між курсором і верхнім або нижнім краєм редактора під час вертикальної навігації з клавіатури, 0 для вимкнення",
"applicationZoom": "Масштаб інтерфейсу застосунку",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 6668dc0cc2..b27c806178 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "显示/隐藏左侧停靠栏面板",
+ "toggleRightDockPanel": "显示/隐藏右侧停靠栏面板",
+ "toggleBottomDockPanel": "显示/隐藏下侧停靠栏面板",
"cursorSurroundingLines": "光标上下文行数",
"cursorSurroundingLinesTip": "使用键盘纵向移动光标时,光标与编辑器上下边缘之间至少保留的可见行数,0 表示禁用",
"applicationZoom": "应用界面缩放",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 7d17412229..7840360d9d 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,7 @@
{
+ "toggleLeftDockPanel": "顯示/隱藏左側停靠欄面板",
+ "toggleRightDockPanel": "顯示/隱藏右側停靠欄面板",
+ "toggleBottomDockPanel": "顯示/隱藏下側停靠欄面板",
"cursorSurroundingLines": "游標上下文行數",
"cursorSurroundingLinesTip": "使用鍵盤縱向移動游標時,游標與編輯器上下邊緣之間至少保留的可見行數,0 表示停用",
"applicationZoom": "應用程式介面縮放",
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy
index ff539b76e7..00db0a9465 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy
@@ -7,7 +7,7 @@
"id": "20200924100950-9op5xi1",
"title": "Shortcuts",
"type": "doc",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -89,7 +89,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20201227133532-44ubczo",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -113,7 +113,7 @@
"Properties": {
"colgroup": "||",
"id": "20210106154101-qrojg1b",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -158,6 +158,60 @@
}
]
},
+ {
+ "Type": "NodeTableRow",
+ "Data": "tr",
+ "Children": [
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Show/hide left/right/bottom dock panels"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "-"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Go to "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Settings"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Shortcuts"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " to configure them separately"
+ }
+ ]
+ }
+ ]
+ },
{
"Type": "NodeTableRow",
"Data": "tr",
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy
index 6a0496e7b6..d0ceeb90b6 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy
@@ -7,7 +7,7 @@
"id": "20200813004551-gm0pbn1",
"title": "快捷键",
"type": "doc",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -89,7 +89,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20240112150737-e41yt1y",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -109,7 +109,7 @@
"Properties": {
"colgroup": "||",
"id": "20201227133317-ovwnk1y",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -154,6 +154,60 @@
}
]
},
+ {
+ "Type": "NodeTableRow",
+ "Data": "tr",
+ "Children": [
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "显示/隐藏左侧/右侧/下侧停靠栏面板"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "-"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "可前往 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "设置"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "快捷键"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 中分别配置"
+ }
+ ]
+ }
+ ]
+ },
{
"Type": "NodeTableRow",
"Data": "tr",
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy
index 8edd2136cc..41c0afedcf 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy
@@ -7,7 +7,7 @@
"id": "20211226122549-jktxego",
"title": "快捷鍵",
"type": "doc",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -89,7 +89,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226122652-0t4c1qf",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -109,7 +109,7 @@
"Properties": {
"colgroup": "||",
"id": "20211226122652-4e9hm9i",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -154,6 +154,60 @@
}
]
},
+ {
+ "Type": "NodeTableRow",
+ "Data": "tr",
+ "Children": [
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "顯示/隱藏左側/右側/下側停靠欄面板"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "-"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "可前往 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "設定"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "快捷鍵"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 中分別配置"
+ }
+ ]
+ }
+ ]
+ },
{
"Type": "NodeTableRow",
"Data": "tr",
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy
index c1f1b01939..cf7cbbd7be 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy
@@ -9,7 +9,7 @@
"id": "20240530101000-xsbxokr",
"title": "ショートカット",
"type": "doc",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -92,7 +92,7 @@
"Properties": {
"ID": "20240530101000-0wo4ch4",
"id": "20240530101000-9imgmgf",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -112,7 +112,7 @@
"Properties": {
"colgroup": "||",
"id": "20240530101000-5z0uafx",
- "updated": "20260827000000"
+ "updated": "20260828134448"
},
"Children": [
{
@@ -157,6 +157,56 @@
}
]
},
+ {
+ "Type": "NodeTableRow",
+ "Data": "tr",
+ "Children": [
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "左/右/下側ドックパネルの表示/非表示"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "-"
+ }
+ ]
+ },
+ {
+ "Type": "NodeTableCell",
+ "Data": "td",
+ "Children": [
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "設定"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "ショートカット"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " で個別に設定できます"
+ }
+ ]
+ }
+ ]
+ },
{
"Type": "NodeTableRow",
"Data": "tr",
diff --git a/app/src/boot/globalEvent/command/global.ts b/app/src/boot/globalEvent/command/global.ts
index 6ea6460b7a..05849930de 100644
--- a/app/src/boot/globalEvent/command/global.ts
+++ b/app/src/boot/globalEvent/command/global.ts
@@ -43,6 +43,9 @@ import {openFile} from "../../../editor/util";
import {fetchPost} from "../../../util/fetch";
import {sanitizeClosedTabs, setStorageVal} from "../../../protyle/util/compatibility";
import {adjustEditorFontSize} from "../../../util/editorFontSize";
+/// #if !MOBILE
+import {toggleDockPanel} from "../../../layout/dock/panel";
+/// #endif
export const globalCommand = (command: string, app: App) => {
/// #if MOBILE
@@ -258,6 +261,15 @@ export const globalCommand = (command: string, app: App) => {
case "switchBottomDock":
window.siyuan.layout.bottomDock.togglePin();
return true;
+ case "toggleLeftDockPanel":
+ toggleDockPanel("Left");
+ return true;
+ case "toggleRightDockPanel":
+ toggleDockPanel("Right");
+ return true;
+ case "toggleBottomDockPanel":
+ toggleDockPanel("Bottom");
+ return true;
case "toggleWin":
/// #if !BROWSER
ipcRenderer.send(Constants.SIYUAN_CMD, "hide");
diff --git a/app/src/boot/globalEvent/command/panel.ts b/app/src/boot/globalEvent/command/panel.ts
index 67af4254db..37506d25a3 100644
--- a/app/src/boot/globalEvent/command/panel.ts
+++ b/app/src/boot/globalEvent/command/panel.ts
@@ -74,7 +74,8 @@ export const commandPanel = (app: App) => {
"goToTab5", "goToTab6", "goToTab7", "goToTab8", "goToTab9", "goToTabNext", "goToTabPrev", "lockScreen",
"mainMenu", "move", "newFile", "recentDocs", "replace", "riffCard", "search", "selectOpen1", "syncNow",
"splitLR", "splitMoveB", "splitMoveR", "splitTB", "switchLeftDock", "switchRightDock", "switchBottomDock",
- "tabToWindow", "stickSearch", "toggleDock", "unsplitAll", "unsplit", "recentClosed",
+ "tabToWindow", "stickSearch", "toggleDock", "toggleLeftDockPanel", "toggleRightDockPanel",
+ "toggleBottomDockPanel", "unsplitAll", "unsplit", "recentClosed",
"increaseEditorFontSize", "decreaseEditorFontSize", "resetEditorFontSize"];
/// #if !BROWSER
keys.push("toggleWin");
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index 0fe92cba6d..bb09f82d2d 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -53,6 +53,7 @@ import {isWindow} from "../../util/functions";
import {reloadProtyle} from "../../protyle/util/reload";
import {openRecentDocs} from "../../business/openRecentDocs";
import type {App} from "../../index";
+import {toggleDockPanel} from "../../layout/dock/panel";
import {clearDisallowedTextInputHotkey} from "../../util/hotKeyPolicy";
import {openBacklink, openGraph, openOutline, toggleDockBar} from "../../layout/dock/util";
import {workspaceMenu} from "../../menus/workspace";
@@ -1487,6 +1488,21 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
event.preventDefault();
return;
}
+ if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.toggleLeftDockPanel.custom, event)) {
+ toggleDockPanel("Left");
+ event.preventDefault();
+ return;
+ }
+ if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.toggleRightDockPanel.custom, event)) {
+ toggleDockPanel("Right");
+ event.preventDefault();
+ return;
+ }
+ if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.toggleBottomDockPanel.custom, event)) {
+ toggleDockPanel("Bottom");
+ event.preventDefault();
+ return;
+ }
if (!isTabWindow && !window.siyuan.config.readonly && matchHotKey(window.siyuan.config.keymap.general.config.custom, event)) {
openSetting(app);
event.preventDefault();
diff --git a/app/src/config/entryVisibility/runtime.ts b/app/src/config/entryVisibility/runtime.ts
index 08bffa232a..d635be1ab0 100644
--- a/app/src/config/entryVisibility/runtime.ts
+++ b/app/src/config/entryVisibility/runtime.ts
@@ -241,7 +241,7 @@ export const applyDockEntryVisibility = () => {
if (!visible && item.classList.contains("dock__item--active")) {
const dock = [window.siyuan.layout.leftDock, window.siyuan.layout.rightDock, window.siyuan.layout.bottomDock]
.find((candidate) => candidate?.elements.some((element) => element.contains(item)));
- dock?.toggleModel(type, false, false, false, true);
+ dock?.toggleModel(type, false, false, false, true, false);
}
item.classList.toggle("fn__none", !visible);
});
diff --git a/app/src/constants.ts b/app/src/constants.ts
index b9290033dd..bbd6bd998e 100644
--- a/app/src/constants.ts
+++ b/app/src/constants.ts
@@ -523,6 +523,9 @@ export abstract class Constants {
switchLeftDock: {default: "", custom: ""},
switchRightDock: {default: "", custom: ""},
switchBottomDock: {default: "", custom: ""},
+ toggleLeftDockPanel: {default: "", custom: ""},
+ toggleRightDockPanel: {default: "", custom: ""},
+ toggleBottomDockPanel: {default: "", custom: ""},
toggleDock: {default: "", custom: ""},
splitLR: {default: "", custom: ""},
splitMoveR: {default: "", custom: ""},
diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts
index fe550d8a8a..9e2b4e3e41 100644
--- a/app/src/layout/dock/index.ts
+++ b/app/src/layout/dock/index.ts
@@ -9,7 +9,7 @@ import {Bookmark} from "./Bookmark";
import {Tag} from "./Tag";
import {Graph} from "./Graph";
import {Model} from "../Model";
-import {adjustLayout, saveLayout, setPanelFocus} from "../util";
+import {adjustLayout, getWndByLayout, saveLayout, setPanelFocus} from "../util";
import {getDockByType, resizeTabs, setTabPosition} from "../tabUtil";
import {Inbox} from "./Inbox";
import {Protyle} from "../../protyle";
@@ -28,6 +28,7 @@ import {
updatePluginDockShowStates,
} from "./pluginDockState";
import {getDockHotkey} from "./hotkey";
+import {resolveDockPanelVisibility} from "./panelVisibility";
const TYPES = ["file", "outline", "inbox", "bookmark", "tag", "graph", "globalGraph", "backlink", "agentChat"];
type TDockTabData = Config.IUILayoutDockTab & {entryId?: string};
@@ -43,6 +44,8 @@ export class Dock {
private hideResizeTimeout: number;
private showDockTimeout = 0;
private hideDockTimeout = 0;
+ private panelVisible = true;
+ private collapsedPanelSize = "";
constructor(options: {
app: App,
@@ -91,8 +94,8 @@ export class Dock {
const fileElement = document.querySelector('.dock__item[data-type="file"]');
if (fileElement && !fileElement.classList.contains("dock__item--active") &&
(this.elements[0].contains(fileElement) || this.elements[1].contains(fileElement))) {
- this.toggleModel("file", true, false, false, false);
- this.toggleModel("file", false, false, false, false);
+ this.toggleModel("file", true, false, false, false, false);
+ this.toggleModel("file", false, false, false, false, false);
}
if (!activeElements[0] && !activeElements[1]) {
@@ -107,7 +110,7 @@ export class Dock {
} else {
activeElements.forEach(item => {
if (item) {
- this.toggleModel(item.getAttribute("data-type") as TDock, true, false, false, false);
+ this.toggleModel(item.getAttribute("data-type") as TDock, true, false, false, false, false);
}
});
}
@@ -318,6 +321,79 @@ export class Dock {
}
}
+ public isPanelVisible() {
+ return this.panelVisible && this.hasActive();
+ }
+
+ public getCollapsedPanelSize() {
+ return this.panelVisible || !this.collapsedPanelSize ? undefined : this.collapsedPanelSize;
+ }
+
+ public togglePanel(visible?: boolean) {
+ const hasActive = this.hasActive();
+ const resolution = resolveDockPanelVisibility(this.panelVisible, hasActive, visible);
+ if (!hasActive) {
+ // 空面板不保留隐藏状态,后续打开工具时应正常显示
+ this.panelVisible = resolution.storedVisible;
+ this.collapsedPanelSize = "";
+ this.layout.element.classList.remove("fn__none");
+ this.resizeElement.classList.add("fn__none");
+ return false;
+ }
+
+ if (!resolution.changed) {
+ return resolution.visible;
+ }
+
+ if (!resolution.visible) {
+ const fullscreenElement = this.layout.element.querySelector(".fullscreen");
+ if (fullscreenElement && fullscreenElement.clientHeight > 0) {
+ return true;
+ }
+ }
+ const hadPanelFocus = Boolean(this.layout.element.querySelector(".layout__tab--active") ||
+ document.activeElement && this.layout.element.contains(document.activeElement));
+ if (this.pin) {
+ recordBeforeResizeTop();
+ }
+ if (!resolution.visible) {
+ this.collapsedPanelSize = this.getCurrentLayoutSize();
+ } else {
+ this.collapsedPanelSize = "";
+ }
+ this.panelVisible = resolution.storedVisible;
+ this.layout.element.classList.toggle("fn__none", !resolution.visible);
+ if (resolution.visible && this.pin) {
+ adjustLayout();
+ this.resizeElement.classList.remove("fn__none");
+ } else {
+ this.resizeElement.classList.add("fn__none");
+ }
+ if (!resolution.visible) {
+ this.clearDockHoverTimeout();
+ window.clearTimeout(this.hideResizeTimeout);
+ if (document.activeElement && this.layout.element.contains(document.activeElement)) {
+ (document.activeElement as HTMLElement).blur();
+ }
+ if (hadPanelFocus) {
+ const centerWnd = window.siyuan.layout.centerLayout && getWndByLayout(window.siyuan.layout.centerLayout);
+ if (centerWnd) {
+ setPanelFocus(centerWnd.element.firstElementChild, false);
+ } else {
+ document.querySelectorAll(".layout__tab--active").forEach(item => {
+ item.classList.remove("layout__tab--active");
+ });
+ document.querySelectorAll(".dock__item--activefocus").forEach(item => {
+ item.classList.remove("dock__item--activefocus");
+ });
+ }
+ }
+ }
+ resizeTabs(false);
+ setTabPosition(true);
+ return this.isPanelVisible();
+ }
+
public togglePin() {
this.clearDockHoverTimeout();
this.pin = !this.pin;
@@ -331,7 +407,7 @@ export class Dock {
} else {
this.layout.element.style.transform = "";
this.layout.element.style.zIndex = "";
- if (hasActive) {
+ if (hasActive && this.panelVisible) {
this.resizeElement.classList.remove("fn__none");
}
}
@@ -341,19 +417,20 @@ export class Dock {
}
private resetDockPosition(show: boolean) {
+ const size = this.getCurrentSize();
if (this.position === "Left") {
- this.layout.element.setAttribute("style", `${show ? "margin-right: var(--b3-layout-space);" : ""}width:${this.layout.element.clientWidth}px;opacity:${show ? 1 : 0};min-height:8px;`);
+ this.layout.element.setAttribute("style", `${show ? "margin-right: var(--b3-layout-space);" : ""}width:${size}px;opacity:${show ? 1 : 0};min-height:8px;`);
} else if (this.position === "Right") {
- this.layout.element.setAttribute("style", `${show ? "margin-left: var(--b3-layout-space);" : ""}width:${this.layout.element.clientWidth}px;opacity:${show ? 1 : 0};min-height:8px;`);
+ this.layout.element.setAttribute("style", `${show ? "margin-left: var(--b3-layout-space);" : ""}width:${size}px;opacity:${show ? 1 : 0};min-height:8px;`);
} else {
- this.layout.element.setAttribute("style", `${show ? "margin-top: var(--b3-layout-space);" : ""}height:${this.layout.element.clientHeight}px;opacity:${show ? 1 : 0};`);
+ this.layout.element.setAttribute("style", `${show ? "margin-top: var(--b3-layout-space);" : ""}height:${size}px;opacity:${show ? 1 : 0};`);
}
}
public showDockByHover() {
window.clearTimeout(this.hideDockTimeout);
this.hideDockTimeout = 0;
- if (this.showDockTimeout || this.pin || this.layout.element.style.opacity === "1") {
+ if (!this.panelVisible || this.showDockTimeout || this.pin || this.layout.element.style.opacity === "1") {
return;
}
this.showDockTimeout = window.setTimeout(() => {
@@ -365,7 +442,7 @@ export class Dock {
public hideDockByHover() {
window.clearTimeout(this.showDockTimeout);
this.showDockTimeout = 0;
- if (this.hideDockTimeout || this.pin || this.layout.element.style.opacity === "0") {
+ if (!this.panelVisible || this.hideDockTimeout || this.pin || this.layout.element.style.opacity === "0") {
return;
}
this.hideDockTimeout = window.setTimeout(() => {
@@ -383,7 +460,7 @@ export class Dock {
public showDock(reset = false) {
this.clearDockHoverTimeout();
- if (!reset && (this.pin || this.layout.element.style.opacity === "1") ||
+ if (!this.panelVisible || (!reset && (this.pin || this.layout.element.style.opacity === "1")) ||
(!this.elements[0].querySelector(".dock__item--active") && !this.elements[1].querySelector(".dock__item--active"))
) {
return;
@@ -449,11 +526,11 @@ export class Dock {
return;
}
if (this.position === "Left") {
- this.layout.element.style.transform = `translateX(-${this.layout.element.clientWidth + 8}px)`;
+ this.layout.element.style.transform = `translateX(-${this.getCurrentSize() + 8}px)`;
} else if (this.position === "Right") {
- this.layout.element.style.transform = `translateX(${this.layout.element.clientWidth + 8}px)`;
+ this.layout.element.style.transform = `translateX(${this.getCurrentSize() + 8}px)`;
} else if (this.position === "Bottom") {
- this.layout.element.style.transform = `translateY(${this.layout.element.clientHeight + 8}px)`;
+ this.layout.element.style.transform = `translateY(${this.getCurrentSize() + 8}px)`;
}
if (reset) {
return;
@@ -464,19 +541,38 @@ export class Dock {
this.layout.element.querySelector(".layout__tab--active")?.classList.remove("layout__tab--active");
}
- public toggleModel(type: TDock | string, show = false, close = false, removeDock = false, isSaveLayout = true) {
+ public toggleModel(type: TDock | string, show = false, close = false, removeDock = false, isSaveLayout = true,
+ restorePanel = true) {
if (!type) {
return;
}
- if (this.pin) {
+ const target = document.querySelector(`.dock__item[data-type="${type}"]`) as HTMLElement;
+ const index = parseInt(target.getAttribute("data-index"));
+ const wnd = this.layout.children[index] as Wnd;
+ let restoredPanel = false;
+ if (!this.panelVisible && restorePanel && !removeDock) {
+ this.togglePanel(true);
+ restoredPanel = true;
+ if (target.classList.contains("dock__item--active")) {
+ Array.from(wnd.element.querySelector(".layout-tab-container").children).find(item => {
+ if (item.getAttribute("data-id") === target.getAttribute("data-id")) {
+ setPanelFocus(item);
+ return true;
+ }
+ });
+ if (document.activeElement) {
+ (document.activeElement as HTMLElement).blur();
+ }
+ this.showDock();
+ return;
+ }
+ }
+ if (this.pin && !restoredPanel) {
recordBeforeResizeTop();
}
- const target = document.querySelector(`.dock__item[data-type="${type}"]`) as HTMLElement;
if (show && target.classList.contains("dock__item--active")) {
target.classList.remove("dock__item--active", "dock__item--activefocus");
}
- const index = parseInt(target.getAttribute("data-index"));
- const wnd = this.layout.children[index] as Wnd;
if (target.classList.contains("dock__item--active") || removeDock) {
if (!close) {
let needFocus = false;
@@ -503,6 +599,9 @@ export class Dock {
// dock 隐藏
if (!this.elements[0].querySelector(".dock__item--active") &&
!this.elements[1].querySelector(".dock__item--active")) {
+ this.panelVisible = true;
+ this.collapsedPanelSize = "";
+ this.layout.element.classList.remove("fn__none");
if (this.position === "Left") {
this.layout.element.style.width = "0px";
this.layout.element.style.marginRight = "0px";
@@ -701,8 +800,10 @@ export class Dock {
if (this.pin) {
this.layout.element.style.opacity = "";
this.hideResizeTimeout = window.setTimeout(() => {
- this.resizeElement.classList.remove("fn__none");
- adjustLayout();
+ if (this.panelVisible && this.hasActive()) {
+ this.resizeElement.classList.remove("fn__none");
+ adjustLayout();
+ }
}, Constants.TIMEOUT_TRANSITION); // 需等待动画完毕后再出现,否则会出现滚动条 https://ld246.com/article/1676596622064
}
if (document.activeElement) {
@@ -822,7 +923,7 @@ export class Dock {
}
const hasActive = sourceElement.classList.contains("dock__item--active");
if (hasActive) {
- sourceDock.toggleModel(type, false, false, false, false);
+ sourceDock.toggleModel(type, false, false, false, false, false);
}
delete sourceDock.data[type];
// 目标处理
@@ -837,7 +938,7 @@ export class Dock {
resetFloatDockSize();
this.data[type] = true;
if (hasActive) {
- this.toggleModel(type, true, false, false, false);
+ this.toggleModel(type, true, false, false, false, false);
}
// 保存布局需等待动画完毕 https://github.com/siyuan-note/siyuan/issues/13507
setTimeout(() => {
@@ -879,6 +980,9 @@ export class Dock {
}
public setSize() {
+ if (!this.panelVisible) {
+ return;
+ }
const activesElement = [...this.elements[0].querySelectorAll(".dock__item--active"),
...this.elements[1].querySelectorAll(".dock__item--active")];
activesElement.forEach((item) => {
@@ -920,6 +1024,36 @@ export class Dock {
return max;
}
+ private hasActive() {
+ return Boolean(this.elements[0].querySelector(".dock__item--active") ||
+ this.elements[1].querySelector(".dock__item--active"));
+ }
+
+ private getCurrentSize() {
+ const isBottom = this.position === "Bottom";
+ const clientSize = isBottom ? this.layout.element.clientHeight : this.layout.element.clientWidth;
+ if (clientSize > 0) {
+ return clientSize;
+ }
+ const styleSize = parseInt(this.layout.element.style[isBottom ? "height" : "width"]);
+ return styleSize || this.getMaxSize();
+ }
+
+ private getCurrentLayoutSize() {
+ if (this.layout.element.style.maxWidth && this.position !== "Bottom") {
+ const dockWidth = this.layout.element.getAttribute(Constants.ATTRIBUTE_DOCK_WIDTH);
+ if (dockWidth) {
+ return dockWidth + "px";
+ }
+ }
+ const dimension = this.position === "Bottom" ? "height" : "width";
+ const styleSize = this.layout.element.style[dimension];
+ if (styleSize && parseFloat(styleSize) > 0) {
+ return styleSize;
+ }
+ return this.getCurrentSize() + "px";
+ }
+
public genButton(data: TDockTabData[], index: number, tabIndex?: number) {
let html = "";
const tooltipPosition = this.getTooltipPosition(index);
@@ -958,7 +1092,7 @@ export class Dock {
adjustDockPadding();
}
if (data[0].show) {
- this.toggleModel(data[0].type, true, false, false, false);
+ this.toggleModel(data[0].type, true, false, false, false, false);
}
}
this.adjustSplit();
diff --git a/app/src/layout/dock/panel.ts b/app/src/layout/dock/panel.ts
new file mode 100644
index 0000000000..38f5ae687a
--- /dev/null
+++ b/app/src/layout/dock/panel.ts
@@ -0,0 +1,21 @@
+const getDockPanel = (position: TDockPosition) => {
+ const layout = window.siyuan?.layout;
+ if (!layout) {
+ return undefined;
+ }
+ if (position === "Left") {
+ return layout.leftDock;
+ }
+ if (position === "Right") {
+ return layout.rightDock;
+ }
+ return layout.bottomDock;
+};
+
+export const toggleDockPanel = (position: TDockPosition, visible?: boolean) => {
+ return getDockPanel(position)?.togglePanel(visible) ?? false;
+};
+
+export const isDockPanelVisible = (position: TDockPosition) => {
+ return getDockPanel(position)?.isPanelVisible() ?? false;
+};
diff --git a/app/src/layout/dock/panelVisibility.test.ts b/app/src/layout/dock/panelVisibility.test.ts
new file mode 100644
index 0000000000..c67af85b65
--- /dev/null
+++ b/app/src/layout/dock/panelVisibility.test.ts
@@ -0,0 +1,44 @@
+import {describe, it} from "node:test";
+import * as assert from "node:assert/strict";
+import {resolveDockPanelVisibility} from "./panelVisibility";
+
+describe("dock panel visibility", () => {
+ it("toggles a non-empty panel when visibility is omitted", () => {
+ assert.deepEqual(resolveDockPanelVisibility(true, true), {
+ changed: true,
+ storedVisible: false,
+ visible: false,
+ });
+ assert.deepEqual(resolveDockPanelVisibility(false, true), {
+ changed: true,
+ storedVisible: true,
+ visible: true,
+ });
+ });
+
+ it("sets a non-empty panel idempotently", () => {
+ assert.deepEqual(resolveDockPanelVisibility(true, true, true), {
+ changed: false,
+ storedVisible: true,
+ visible: true,
+ });
+ assert.deepEqual(resolveDockPanelVisibility(false, true, false), {
+ changed: false,
+ storedVisible: false,
+ visible: false,
+ });
+ });
+
+ it("keeps an empty panel closed without retaining a collapsed state", () => {
+ assert.deepEqual(resolveDockPanelVisibility(false, false, true), {
+ changed: true,
+ storedVisible: true,
+ visible: false,
+ });
+ assert.deepEqual(resolveDockPanelVisibility(true, false, false), {
+ changed: false,
+ storedVisible: true,
+ visible: false,
+ });
+ });
+});
diff --git a/app/src/layout/dock/panelVisibility.ts b/app/src/layout/dock/panelVisibility.ts
new file mode 100644
index 0000000000..072e47e753
--- /dev/null
+++ b/app/src/layout/dock/panelVisibility.ts
@@ -0,0 +1,23 @@
+export interface IDockPanelVisibilityResolution {
+ changed: boolean;
+ storedVisible: boolean;
+ visible: boolean;
+}
+
+export const resolveDockPanelVisibility = (storedVisible: boolean, hasActive: boolean,
+ visible?: boolean): IDockPanelVisibilityResolution => {
+ if (!hasActive) {
+ return {
+ changed: !storedVisible,
+ storedVisible: true,
+ visible: false,
+ };
+ }
+
+ const nextVisible = typeof visible === "boolean" ? visible : !storedVisible;
+ return {
+ changed: nextVisible !== storedVisible,
+ storedVisible: nextVisible,
+ visible: nextVisible,
+ };
+};
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index 4a01568f93..a8047e65ea 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -653,7 +653,17 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any, brea
} else if (layout.parent.direction === "tb" && layout.element.style.height.endsWith("%")) {
json.size = layout.element.style.height;
} else {
- if (layout.element.style.maxWidth && layout.parent.direction !== "tb") {
+ let collapsedDockSize: string | undefined;
+ if (layout.type === "left") {
+ collapsedDockSize = window.siyuan.layout.leftDock?.getCollapsedPanelSize();
+ } else if (layout.type === "right") {
+ collapsedDockSize = window.siyuan.layout.rightDock?.getCollapsedPanelSize();
+ } else if (layout.type === "bottom") {
+ collapsedDockSize = window.siyuan.layout.bottomDock?.getCollapsedPanelSize();
+ }
+ if (collapsedDockSize) {
+ json.size = collapsedDockSize;
+ } else if (layout.element.style.maxWidth && layout.parent.direction !== "tb") {
json.size = layout.element.getAttribute(Constants.ATTRIBUTE_DOCK_WIDTH) + "px";
} else {
json.size = (layout.parent.direction === "tb" ? layout.element.clientHeight : layout.element.clientWidth) + "px";
diff --git a/app/src/plugin/API.ts b/app/src/plugin/API.ts
index 003ae3c376..133353e94e 100644
--- a/app/src/plugin/API.ts
+++ b/app/src/plugin/API.ts
@@ -35,6 +35,9 @@ import type {Files} from "../layout/dock/Files";
import {ProtyleMethod} from "./ProtyleMethod";
import {openEmojiPanel} from "../emoji";
import {adjustEditorFontSize, setEditorFontSize} from "../util/editorFontSize";
+/// #if !MOBILE
+import {isDockPanelVisible, toggleDockPanel} from "../layout/dock/panel";
+/// #endif
let openTab;
let openWindow;
@@ -342,6 +345,54 @@ const openEmoji = (options: {
});
};
+const toggleLeftDock = (visible?: boolean) => {
+ /// #if MOBILE
+ return false;
+ /// #else
+ return toggleDockPanel("Left", visible);
+ /// #endif
+};
+
+const toggleRightDock = (visible?: boolean) => {
+ /// #if MOBILE
+ return false;
+ /// #else
+ return toggleDockPanel("Right", visible);
+ /// #endif
+};
+
+const toggleBottomDock = (visible?: boolean) => {
+ /// #if MOBILE
+ return false;
+ /// #else
+ return toggleDockPanel("Bottom", visible);
+ /// #endif
+};
+
+const isLeftDockVisible = () => {
+ /// #if MOBILE
+ return false;
+ /// #else
+ return isDockPanelVisible("Left");
+ /// #endif
+};
+
+const isRightDockVisible = () => {
+ /// #if MOBILE
+ return false;
+ /// #else
+ return isDockPanelVisible("Right");
+ /// #endif
+};
+
+const isBottomDockVisible = () => {
+ /// #if MOBILE
+ return false;
+ /// #else
+ return isDockPanelVisible("Bottom");
+ /// #endif
+};
+
export const API = {
adaptHotkey: updateHotkeyTip,
confirm: confirmDialog,
@@ -381,5 +432,11 @@ export const API = {
saveLayout,
globalCommand,
expandDocTree,
- openEmoji
+ openEmoji,
+ toggleLeftDock,
+ toggleRightDock,
+ toggleBottomDock,
+ isLeftDockVisible,
+ isRightDockVisible,
+ isBottomDockVisible,
};
diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.ts
index d294c3b52a..a0698d4d8b 100644
--- a/app/src/types/config.d.ts
+++ b/app/src/types/config.d.ts
@@ -1407,6 +1407,9 @@ declare namespace Config {
switchLeftDock: IKey;
switchRightDock: IKey;
switchBottomDock: IKey;
+ toggleLeftDockPanel: IKey;
+ toggleRightDockPanel: IKey;
+ toggleBottomDockPanel: IKey;
toggleDock: IKey;
splitLR: IKey;
splitMoveR: IKey;