Skip to content

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

:bug: Avoid cross-site rejection after OIDC login https://github.com/siyuan-note/siyuan/issues/19688

Daniel3f5cdf344c4a
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 570369e8ce..1576300daf 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "إخفاء كتل المراجع في الروابط الخلفية الموروثة",
"backlinkHideReferenceTip": "إخفاء الكتل التي تحتوي فقط على مراجع كتل في الروابط الخلفية الموروثة عندما يبقى محتوى آخر ظاهرًا، وإظهارها مجددًا أثناء التحرير",
"uploadInsertTargetUnavailable": "لم تعد وجهة الرفع الأصلية متاحة. لم تُدرج النتيجة؛ تم الاحتفاظ بالملفات المرفوعة.",
- "mobileToolbarEntryTip": "اضبط ظهور عناصر شريط الأدوات على الأجهزة المحمولة وترتيبها باستخدام ملفات التعريف نفسها لسطح المكتب",
+ "mobileToolbarEntryTip": "اضبط ظهور عناصر شريط الأدوات على الهاتف وترتيبها؛ تُحفظ ملفات التعريف على هذا الجهاز ولا تتم مزامنتها بين الأجهزة",
"keymapAssigned": "مُعيَّن",
"keymapCustomized": "مخصص بواسطتي",
"keymapUnassigned": "غير مُعيَّن",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 236c0cc397..8ada37e5eb 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Referenzblöcke in vererbten Rückverweisen ausblenden",
"backlinkHideReferenceTip": "Blöcke mit ausschließlich Blockreferenzen in vererbten Rückverweisen ausblenden, wenn andere Inhalte sichtbar bleiben, und beim Bearbeiten wieder anzeigen",
"uploadInsertTargetUnavailable": "Das ursprüngliche Upload-Ziel ist nicht mehr verfügbar. Das Ergebnis wurde nicht eingefügt; hochgeladene Dateien bleiben erhalten.",
- "mobileToolbarEntryTip": "Sichtbarkeit und Reihenfolge der mobilen Werkzeugleiste mit denselben Profilen wie auf dem Desktop konfigurieren",
+ "mobileToolbarEntryTip": "Sichtbarkeit und Reihenfolge der mobilen Werkzeugleisteneinträge konfigurieren; Profile werden auf diesem Gerät gespeichert und nicht zwischen Geräten synchronisiert",
"keymapAssigned": "Zugewiesen",
"keymapCustomized": "Von mir angepasst",
"keymapUnassigned": "Nicht zugewiesen",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index f39e9b2ae0..b89f208aac 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Hide reference blocks in propagated backlinks",
"backlinkHideReferenceTip": "Hide blocks containing only block references in propagated backlinks when other content remains visible, and show them again while editing",
"uploadInsertTargetUnavailable": "The original upload target is no longer available. The result was not inserted; uploaded files are retained.",
- "mobileToolbarEntryTip": "Configure mobile toolbar visibility and order using the same profiles as desktop",
+ "mobileToolbarEntryTip": "Configure mobile toolbar visibility and order; profiles are saved on this device and are not synced across devices",
"keymapAssigned": "Assigned",
"keymapCustomized": "Customized by me",
"keymapUnassigned": "Unassigned",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index b98a6ceef6..6507db0cd1 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Ocultar bloques de referencia en enlaces inversos propagados",
"backlinkHideReferenceTip": "Ocultar los bloques que solo contienen referencias a bloques en los enlaces inversos propagados cuando queda otro contenido visible y mostrarlos de nuevo al editar",
"uploadInsertTargetUnavailable": "El destino original de la carga ya no está disponible. No se insertó el resultado; los archivos cargados se conservan.",
- "mobileToolbarEntryTip": "Configura la visibilidad y el orden de la barra de herramientas móvil con los mismos perfiles que en escritorio",
+ "mobileToolbarEntryTip": "Configurar la visibilidad y el orden de los elementos de la barra de herramientas móvil; los perfiles se guardan en este dispositivo y no se sincronizan entre dispositivos",
"keymapAssigned": "Asignados",
"keymapCustomized": "Personalizados por mí",
"keymapUnassigned": "Sin asignar",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index ae7696c2cc..744aeb22c9 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Masquer les blocs de référence dans les liens retour propagés",
"backlinkHideReferenceTip": "Masquer les blocs contenant uniquement des références de bloc dans les liens retour propagés si un autre contenu reste visible, et les réafficher pendant la modification",
"uploadInsertTargetUnavailable": "La cible initiale du téléversement n’est plus disponible. Le résultat n’a pas été inséré ; les fichiers téléversés sont conservés.",
- "mobileToolbarEntryTip": "Configurer la visibilité et l’ordre de la barre d’outils mobile avec les mêmes profils que sur ordinateur",
+ "mobileToolbarEntryTip": "Configurer la visibilité et l’ordre des éléments de la barre d’outils mobile ; les profils sont enregistrés sur cet appareil et ne sont pas synchronisés entre les appareils",
"keymapAssigned": "Attribués",
"keymapCustomized": "Personnalisés par moi",
"keymapUnassigned": "Non attribués",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index ce6348793e..b6ca6a7be2 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "הסתרת בלוקי הפניה בקישורים נכנסים מועברים",
"backlinkHideReferenceTip": "הסתרת בלוקים המכילים רק הפניות לבלוקים בקישורים נכנסים מועברים כאשר תוכן אחר נשאר גלוי, והצגתם מחדש בזמן עריכה",
"uploadInsertTargetUnavailable": "יעד ההעלאה המקורי אינו זמין עוד. התוצאה לא הוכנסה; הקבצים שהועלו נשמרים.",
- "mobileToolbarEntryTip": "הגדרת הנראות והסדר של סרגל הכלים בנייד באמצעות אותם פרופילים כמו במחשב",
+ "mobileToolbarEntryTip": "הגדרת הנראות והסדר של פריטי סרגל הכלים בנייד; הפרופילים נשמרים במכשיר זה ואינם מסונכרנים בין מכשירים",
"keymapAssigned": "מוקצים",
"keymapCustomized": "מותאמים אישית על ידי",
"keymapUnassigned": "לא מוקצים",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index 8390083bfc..76ed217380 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "प्रसारित बैकलिंक में संदर्भ ब्लॉक छिपाएँ",
"backlinkHideReferenceTip": "प्रसारित बैकलिंक में केवल ब्लॉक संदर्भ वाले ब्लॉक छिपाएँ जब अन्य सामग्री दिखाई देती रहे, और संपादन के दौरान उन्हें फिर से दिखाएँ",
"uploadInsertTargetUnavailable": "अपलोड का मूल लक्ष्य अब उपलब्ध नहीं है। परिणाम सम्मिलित नहीं किया गया; अपलोड की गई फ़ाइलें सुरक्षित रखी गई हैं।",
- "mobileToolbarEntryTip": "डेस्कटॉप वाली प्रोफ़ाइल का उपयोग करके मोबाइल टूलबार की दृश्यता और क्रम कॉन्फ़िगर करें",
+ "mobileToolbarEntryTip": "मोबाइल टूलबार की मदों की दृश्यता और क्रम सेट करें; प्रोफ़ाइल इस डिवाइस पर सहेजी जाती हैं और डिवाइसों के बीच सिंक नहीं होतीं",
"keymapAssigned": "असाइन किए गए",
"keymapCustomized": "मेरे द्वारा अनुकूलित",
"keymapUnassigned": "असाइन नहीं किए गए",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index cec298c5c8..06486a9b8f 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Sembunyikan blok referensi pada tautan balik yang diteruskan",
"backlinkHideReferenceTip": "Sembunyikan blok yang hanya berisi referensi blok pada tautan balik yang diteruskan jika konten lain tetap terlihat, dan tampilkan kembali saat mengedit",
"uploadInsertTargetUnavailable": "Tujuan unggahan awal tidak lagi tersedia. Hasil tidak disisipkan; berkas yang diunggah tetap disimpan.",
- "mobileToolbarEntryTip": "Atur visibilitas dan urutan bilah alat seluler menggunakan profil yang sama dengan desktop",
+ "mobileToolbarEntryTip": "Atur visibilitas dan urutan item bilah alat seluler; profil disimpan di perangkat ini dan tidak disinkronkan antarperangkat",
"keymapAssigned": "Ditetapkan",
"keymapCustomized": "Disesuaikan oleh saya",
"keymapUnassigned": "Belum ditetapkan",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index b3bc5dc537..44320e393f 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Nascondi i blocchi di riferimento nei backlink propagati",
"backlinkHideReferenceTip": "Nascondi i blocchi contenenti solo riferimenti a blocchi nei backlink propagati quando rimangono altri contenuti visibili e mostrali di nuovo durante la modifica",
"uploadInsertTargetUnavailable": "La destinazione originale del caricamento non è più disponibile. Il risultato non è stato inserito; i file caricati vengono conservati.",
- "mobileToolbarEntryTip": "Configura visibilità e ordine della barra degli strumenti mobile usando gli stessi profili del desktop",
+ "mobileToolbarEntryTip": "Configura la visibilità e l’ordine degli elementi della barra degli strumenti mobile; i profili vengono salvati su questo dispositivo e non vengono sincronizzati tra dispositivi",
"keymapAssigned": "Assegnate",
"keymapCustomized": "Personalizzate da me",
"keymapUnassigned": "Non assegnate",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index ad805f4923..dfd584fd70 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "伝播型バックリンクの参照ブロックを非表示",
"backlinkHideReferenceTip": "伝播型バックリンクで、ほかに表示できる内容がある場合はブロック参照のみのブロックを非表示にし、編集中は再表示します",
"uploadInsertTargetUnavailable": "アップロード元の挿入先が無効になったため、結果を挿入しませんでした。アップロード済みのファイルは保持されます。",
- "mobileToolbarEntryTip": "デスクトップと共通のプロファイルで、モバイルのツールバー項目の表示と順序を設定",
+ "mobileToolbarEntryTip": "モバイル版ツールバー項目の表示・非表示と順序を設定します。プロファイルはこの端末に保存され、端末間では同期されません",
"keymapAssigned": "割り当て済み",
"keymapCustomized": "自分でカスタマイズ",
"keymapUnassigned": "未割り当て",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index ec6055a485..80d8e3d413 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "전파된 백링크의 참조 블록 숨기기",
"backlinkHideReferenceTip": "전파된 백링크에서 다른 표시할 내용이 있으면 블록 참조만 포함된 블록을 숨기고 편집 중에는 다시 표시",
"uploadInsertTargetUnavailable": "원래 업로드 대상이 더 이상 유효하지 않습니다. 결과를 삽입하지 않았으며 업로드된 파일은 유지됩니다.",
- "mobileToolbarEntryTip": "데스크톱과 동일한 프로필로 모바일 도구 모음 항목의 표시 여부와 순서 설정",
+ "mobileToolbarEntryTip": "모바일 도구 모음 항목의 표시 여부와 순서를 설정합니다. 프로필은 이 기기에 저장되며 기기 간에 동기화되지 않습니다",
"keymapAssigned": "할당됨",
"keymapCustomized": "내가 사용자 지정함",
"keymapUnassigned": "할당되지 않음",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 0098249dcb..0547dcbc57 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Verwijzingsblokken in doorgegeven backlinks verbergen",
"backlinkHideReferenceTip": "Verberg blokken met uitsluitend blokverwijzingen in doorgegeven backlinks als andere inhoud zichtbaar blijft en toon ze weer tijdens het bewerken",
"uploadInsertTargetUnavailable": "Het oorspronkelijke uploaddoel is niet meer beschikbaar. Het resultaat is niet ingevoegd; geüploade bestanden blijven behouden.",
- "mobileToolbarEntryTip": "Configureer de zichtbaarheid en volgorde van de mobiele werkbalk met dezelfde profielen als op de desktop",
+ "mobileToolbarEntryTip": "Configureer de zichtbaarheid en volgorde van mobiele werkbalkitems; profielen worden op dit apparaat opgeslagen en niet tussen apparaten gesynchroniseerd",
"keymapAssigned": "Toegewezen",
"keymapCustomized": "Door mij aangepast",
"keymapUnassigned": "Niet toegewezen",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 3909870b82..72e089f606 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Ukryj bloki odwołań w propagowanych linkach zwrotnych",
"backlinkHideReferenceTip": "Ukrywaj bloki zawierające wyłącznie odwołania do bloków w propagowanych linkach zwrotnych, gdy pozostaje inna widoczna treść, i pokazuj je ponownie podczas edycji",
"uploadInsertTargetUnavailable": "Pierwotny cel przesyłania nie jest już dostępny. Wynik nie został wstawiony; przesłane pliki zostały zachowane.",
- "mobileToolbarEntryTip": "Skonfiguruj widoczność i kolejność mobilnego paska narzędzi przy użyciu tych samych profili co na komputerze",
+ "mobileToolbarEntryTip": "Skonfiguruj widoczność i kolejność elementów mobilnego paska narzędzi; profile są zapisywane na tym urządzeniu i nie są synchronizowane między urządzeniami",
"keymapAssigned": "Przypisane",
"keymapCustomized": "Dostosowane przeze mnie",
"keymapUnassigned": "Nieprzypisane",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index f0ef298ece..7fa1a95d61 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Ocultar blocos de referência em backlinks propagados",
"backlinkHideReferenceTip": "Ocultar blocos que contêm apenas referências a blocos em backlinks propagados quando houver outro conteúdo visível e exibi-los novamente durante a edição",
"uploadInsertTargetUnavailable": "O destino original do envio não está mais disponível. O resultado não foi inserido; os arquivos enviados foram mantidos.",
- "mobileToolbarEntryTip": "Configure a visibilidade e a ordem da barra de ferramentas móvel usando os mesmos perfis da versão para computador",
+ "mobileToolbarEntryTip": "Configure a visibilidade e a ordem dos itens da barra de ferramentas móvel; os perfis são salvos neste dispositivo e não são sincronizados entre dispositivos",
"keymapAssigned": "Atribuídos",
"keymapCustomized": "Personalizados por mim",
"keymapUnassigned": "Não atribuídos",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index d8ef7472b7..592e204c45 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Скрывать блоки ссылок в наследуемых обратных ссылках",
"backlinkHideReferenceTip": "Скрывать блоки, содержащие только ссылки на блоки, в наследуемых обратных ссылках, если остаётся другое содержимое, и показывать их при редактировании",
"uploadInsertTargetUnavailable": "Исходное место вставки больше недоступно. Результат не вставлен; загруженные файлы сохранены.",
- "mobileToolbarEntryTip": "Настройте видимость и порядок элементов мобильной панели инструментов, используя общие с настольной версией профили",
+ "mobileToolbarEntryTip": "Настройте видимость и порядок элементов мобильной панели инструментов; профили сохраняются на этом устройстве и не синхронизируются между устройствами",
"keymapAssigned": "Назначенные",
"keymapCustomized": "Настроенные мной",
"keymapUnassigned": "Неназначенные",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 53ac22719c..9539646b55 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Skryť bloky odkazov v prenesených spätných odkazoch",
"backlinkHideReferenceTip": "Skryť bloky obsahujúce iba odkazy na bloky v prenesených spätných odkazoch, ak zostáva viditeľný iný obsah, a znova ich zobraziť pri úpravách",
"uploadInsertTargetUnavailable": "Pôvodný cieľ nahrávania už nie je dostupný. Výsledok nebol vložený; nahrané súbory zostávajú zachované.",
- "mobileToolbarEntryTip": "Nastavte viditeľnosť a poradie mobilného panela nástrojov pomocou rovnakých profilov ako na počítači",
+ "mobileToolbarEntryTip": "Nastavte viditeľnosť a poradie položiek mobilného panela nástrojov; profily sa ukladajú v tomto zariadení a nesynchronizujú sa medzi zariadeniami",
"keymapAssigned": "Priradené",
"keymapCustomized": "Upravené mnou",
"keymapUnassigned": "Nepriradené",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index a5288eba1c..77d64daf54 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Sakrij blokove referenci u prenetim povratnim vezama",
"backlinkHideReferenceTip": "Sakrij blokove koji sadrže samo reference na blokove u prenetim povratnim vezama kada ostali sadržaj ostaje vidljiv, i prikaži ih ponovo tokom uređivanja",
"uploadInsertTargetUnavailable": "Prvobitno odredište otpremanja više nije dostupno. Rezultat nije umetnut; otpremljeni fajlovi su sačuvani.",
- "mobileToolbarEntryTip": "Podesite vidljivost i redosled palete alatki na telefonu istim profilima kao na računaru",
+ "mobileToolbarEntryTip": "Подесите видљивост и редослед ставки мобилне траке са алаткама; профили се чувају на овом уређају и не синхронизују се између уређаја",
"keymapAssigned": "Dodeljeno",
"keymapCustomized": "Moje izmene",
"keymapUnassigned": "Nedodeljeno",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 092a71325d..cd4ece360a 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "ซ่อนบล็อกอ้างอิงในลิงก์ย้อนกลับที่ส่งต่อ",
"backlinkHideReferenceTip": "ซ่อนบล็อกที่มีเฉพาะการอ้างอิงบล็อกในลิงก์ย้อนกลับที่ส่งต่อเมื่อยังมีเนื้อหาอื่นให้แสดง และแสดงอีกครั้งขณะแก้ไข",
"uploadInsertTargetUnavailable": "ปลายทางเดิมของการอัปโหลดไม่พร้อมใช้งานแล้ว จึงไม่ได้แทรกผลลัพธ์ แต่ไฟล์ที่อัปโหลดแล้วจะยังคงอยู่",
- "mobileToolbarEntryTip": "กำหนดการแสดงและลำดับรายการในแถบเครื่องมือบนมือถือโดยใช้โปรไฟล์เดียวกับเดสก์ท็อป",
+ "mobileToolbarEntryTip": "กำหนดการแสดงผลและลำดับของรายการในแถบเครื่องมือบนมือถือ โปรไฟล์จะบันทึกไว้ในอุปกรณ์นี้และไม่ซิงค์ระหว่างอุปกรณ์",
"keymapAssigned": "กำหนดแล้ว",
"keymapCustomized": "ปรับแต่งโดยฉัน",
"keymapUnassigned": "ยังไม่ได้กำหนด",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 999a9fd4dd..00244cd888 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Aktarılan geri bağlantılarda referans bloklarını gizle",
"backlinkHideReferenceTip": "Başka içerik görünür kaldığında aktarılan geri bağlantılarda yalnızca blok referansları içeren blokları gizle ve düzenleme sırasında yeniden göster",
"uploadInsertTargetUnavailable": "Özgün yükleme hedefi artık kullanılamıyor. Sonuç eklenmedi; yüklenen dosyalar korunuyor.",
- "mobileToolbarEntryTip": "Masaüstü ile aynı profilleri kullanarak mobil araç çubuğunun görünürlüğünü ve sırasını yapılandırın",
+ "mobileToolbarEntryTip": "Mobil araç çubuğu öğelerinin görünürlüğünü ve sırasını yapılandırın; profiller bu cihazda kaydedilir ve cihazlar arasında eşitlenmez",
"keymapAssigned": "Atanmış",
"keymapCustomized": "Benim özelleştirdiklerim",
"keymapUnassigned": "Atanmamış",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 4f1ac4a9bf..52ce412da6 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "Приховувати блоки посилань в успадкованих зворотних посиланнях",
"backlinkHideReferenceTip": "Приховувати блоки, що містять лише посилання на блоки, в успадкованих зворотних посиланнях, якщо залишається інший вміст, і показувати їх під час редагування",
"uploadInsertTargetUnavailable": "Початкове місце вставлення більше недоступне. Результат не вставлено; завантажені файли збережено.",
- "mobileToolbarEntryTip": "Налаштуйте видимість і порядок елементів мобільної панелі інструментів, використовуючи спільні з настільною версією профілі",
+ "mobileToolbarEntryTip": "Налаштуйте видимість і порядок елементів мобільної панелі інструментів; профілі зберігаються на цьому пристрої та не синхронізуються між пристроями",
"keymapAssigned": "Призначені",
"keymapCustomized": "Налаштовані мною",
"keymapUnassigned": "Непризначені",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 2b7d623fb8..24f14877a6 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "隐藏传递型反链的引用块",
"backlinkHideReferenceTip": "在反链面板中隐藏仅含块引用且仍有其他内容可展示的传递型引用块,编辑时恢复显示",
"uploadInsertTargetUnavailable": "原上传目标已失效,未回填结果;已上传的文件会保留。",
- "mobileToolbarEntryTip": "配置移动端工具栏项的显隐与排序,与桌面端共用方案",
+ "mobileToolbarEntryTip": "配置移动端工具栏项的显隐与排序,方案保存在本设备,不跨设备同步",
"keymapAssigned": "已分配",
"keymapCustomized": "由我分配",
"keymapUnassigned": "未分配",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index e09401aee5..c4d818337a 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -130,7 +130,7 @@
"backlinkHideReference": "隱藏傳遞型反向連結的引用區塊",
"backlinkHideReferenceTip": "在反向連結面板中隱藏僅含區塊引用且仍有其他內容可顯示的傳遞型引用區塊,編輯時恢復顯示",
"uploadInsertTargetUnavailable": "原上傳目標已失效,未填入結果;已上傳的檔案會保留。",
- "mobileToolbarEntryTip": "設定行動端工具列項目的顯示與排序,與桌面端共用方案",
+ "mobileToolbarEntryTip": "設定行動端工具列項目的顯隱與排序,方案儲存在本裝置,不跨裝置同步",
"keymapAssigned": "已指派",
"keymapCustomized": "由我指派",
"keymapUnassigned": "未指派",
diff --git a/app/src/assets/scss/business/_config.scss b/app/src/assets/scss/business/_config.scss
index 6fce5a4629..0ac736ec64 100644
--- a/app/src/assets/scss/business/_config.scss
+++ b/app/src/assets/scss/business/_config.scss
@@ -1202,6 +1202,10 @@
&-entry-visibility {
&__view--mobile {
+ .config-entry-visibility__search {
+ margin: 0 8px;
+ }
+
.config-entry-visibility__column {
flex: 1 0 100%;
}
diff --git a/app/src/config/entryVisibility/ui.ts b/app/src/config/entryVisibility/ui.ts
index d836ac6458..245295efac 100644
--- a/app/src/config/entryVisibility/ui.ts
+++ b/app/src/config/entryVisibility/ui.ts
@@ -250,8 +250,8 @@ const orderEntryNodes = (profile: Config.IEntryVisibilityProfile, parentPath: st
};
const renderEntrySwitch = (profile: Config.IEntryVisibilityProfile, path: string, item: IEntryCatalogNode,
- parentEnabled: boolean, readOnly: boolean) => {
- const label = item.type === "separator" ? window.siyuan.languages.entrySeparator : item.label();
+ parentEnabled: boolean, readOnly: boolean,
+ label = item.type === "separator" ? window.siyuan.languages.entrySeparator : item.label()) => {
return `<input class="b3-switch" type="checkbox"
aria-label="${escapeAttr(label)}" data-entry-path="${escapeAttr(path)}"${readOnly ? ' data-entry-readonly aria-disabled="true"' : ""}
${!parentEnabled && !readOnly ? " disabled" : ""}${getProfileEntryVisibility(profile, path,
@@ -266,12 +266,16 @@ const renderEntryRows = (profile: Config.IEntryVisibilityProfile, prefix: string
const configurable = isEntryCatalogNodeConfigurable(item);
const draggable = sortable && parentEnabled && configurable;
if (item.type === "separator") {
+ const separatorIndex = (getEntryCatalogChildren(prefix) || nodes)
+ .filter(node => node.type === "separator").findIndex(node => node.key === item.key) + 1;
+ const label = window.siyuan.languages.entrySeparator +
+ (prefix === TOOLBAR_ENTRY_ROOT_PATH ? ` ${separatorIndex}` : "");
return `<div class="config-entry-visibility__row config-entry-visibility__row--separator${parentEnabled ? "" : " config-entry-visibility__row--disabled"}${readOnly ? " config-entry-visibility__row--readonly" : ""}"
data-entry-row data-entry-key="${escapeAttr(item.key)}" data-entry-parent="${escapeAttr(prefix)}">
${draggable ? '<span class="config-entry-visibility__drag" draggable="true"><svg><use xlink:href="#iconDrag"></use></svg></span>' : ""}
- <span class="config-entry-visibility__label">${window.siyuan.languages.entrySeparator}</span>
+ <span class="config-entry-visibility__label">${escapeHtml(label)}</span>
+ ${renderEntrySwitch(profile, path, item, parentEnabled, readOnly, label)}
${renderTouchOrderButtons(draggable && !readOnly)}
- ${renderEntrySwitch(profile, path, item, parentEnabled, readOnly)}
<span class="config-entry-visibility__arrow-space"></span>
</div>`;
}
@@ -574,7 +578,7 @@ const openProfileEditor = (root: HTMLElement, profileID?: string) => {
</div>`}
<div class="config-group">
${builtin ? `<div class="config-title">${escapeHtml(draft.name)}</div>` : ""}
- <div class="fn__flex">
+ <div class="fn__flex config-entry-visibility__search">
<input spellcheck="false" class="b3-text-field fn__flex-1" data-type="entry-search" placeholder="${escapeAttr(window.siyuan.languages.searchPlaceholder)}">
</div>
</div>
diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.ts
index 0a46c50d9e..1fa3043bb2 100644
--- a/app/src/mobile/util/initFramework.ts
+++ b/app/src/mobile/util/initFramework.ts
@@ -134,8 +134,6 @@ export const renderMobileSidePanelLayout = (
const pluginDockLayouts = getMobilePluginDockLayouts(pluginDockEntries);
const resolvedConfig = normalizeMobileSidePanelConfig(
config || getMobileSidePanelConfig(pluginDockLayouts), pluginDockLayouts);
- getDockTabElement("agent").classList.toggle("fn__none",
- window.siyuan.config.readonly || window.siyuan.isPublish || isDisabledFeature("ai"));
const sidePanelElements = {
left: document.getElementById("sidebar"),
right: document.getElementById("sidebarRight"),
@@ -165,6 +163,8 @@ export const renderMobileSidePanelLayout = (
if (!tabElement || !dockContentElement) {
return;
}
+ tabElement.classList.toggle("fn__none", resolvedConfig.hidden.includes(type) ||
+ (type === "agent" && (window.siyuan.config.readonly || window.siyuan.isPublish || isDisabledFeature("ai"))));
toolbarScrollElement.append(tabElement);
contentElement.append(dockContentElement);
sideDockIds[side].push(type);
@@ -182,6 +182,9 @@ export const renderMobileSidePanelLayout = (
getDockContentElement(type).classList.toggle("fn__none", type !== activeDockId);
});
if (!activeDockId) {
+ if (sidePanelElement.style.transform === "translateX(0px)") {
+ closePanel();
+ }
sidePanelElement.style.transform = "";
}
});
@@ -262,7 +265,7 @@ const initSidePanelTabs = (app: App, sidePanelElement: HTMLElement) => {
} else {
svgElement = hasTopClosestByTag(target, "svg") as HTMLElement;
}
- if (!svgElement) {
+ if (!svgElement || svgElement.classList.contains("fn__none")) {
return;
}
const tabType = svgElement.getAttribute("data-type");
diff --git a/app/src/mobile/util/mobileSidePanelConfig.test.ts b/app/src/mobile/util/mobileSidePanelConfig.test.ts
index 68ff1025c2..4ebdae6495 100644
--- a/app/src/mobile/util/mobileSidePanelConfig.test.ts
+++ b/app/src/mobile/util/mobileSidePanelConfig.test.ts
@@ -30,13 +30,62 @@ const assertCompleteConfig = (config: ReturnType<typeof normalizeMobileSidePanel
};
describe("mobile side panel config", () => {
+ it("migrates version 3 without changing positions or hiding docks", () => {
+ const stored = {
+ version: 3,
+ left: ["inbox", "pluginRight", "file", "bookmark", "tag"],
+ right: ["outline", "backlink", "agent"],
+ pluginDockIds: ["pluginRight"],
+ };
+ const config = normalizeMobileSidePanelConfig(stored);
+ assert.deepEqual(config.left, stored.left);
+ assert.deepEqual(config.right, stored.right);
+ assert.deepEqual(config.pluginDockIds, stored.pluginDockIds);
+ assert.deepEqual(config.hidden, []);
+ });
+
+ it("hides every dock without losing layout and restores visibility and reset defaults", () => {
+ const initial = createDefaultMobileSidePanelConfig(pluginDocks);
+ let config = initial;
+ [...initial.left, ...initial.right].forEach(id => {
+ config = reduceMobileSidePanelConfig(config, {type: "visibility", id, visible: false}, pluginDocks);
+ });
+ assert.deepEqual(config.left, initial.left);
+ assert.deepEqual(config.right, initial.right);
+ assert.deepEqual(config.hidden, [...initial.left, ...initial.right]);
+ assert.deepEqual(initial.hidden, []);
+ config = normalizeMobileSidePanelConfig(JSON.stringify(config), pluginDocks);
+ config = reduceMobileSidePanelConfig(config, {type: "visibility", id: "inbox", visible: true}, pluginDocks);
+ assert.equal(config.hidden.includes("inbox"), false);
+ assert.deepEqual(config.left, initial.left);
+ assert.deepEqual(reduceMobileSidePanelConfig(config, {type: "reset"}, pluginDocks), initial);
+ });
+
+ it("retains hidden plugin preferences while unavailable and across moves", () => {
+ let config = reduceMobileSidePanelConfig(createDefaultMobileSidePanelConfig(pluginDocks), {
+ type: "visibility", id: "pluginLeft", visible: false,
+ }, pluginDocks);
+ const missing = normalizeMobileSidePanelConfig(config);
+ assert.deepEqual(missing.hidden, ["pluginLeft"]);
+ config = reduceMobileSidePanelConfig(missing, {
+ type: "move", id: "pluginLeft", side: "right", index: 0,
+ }, pluginDocks);
+ assert.deepEqual(config.hidden, ["pluginLeft"]);
+ assert.equal(config.right[0], "pluginLeft");
+ const normalized = normalizeMobileSidePanelConfig({...config, hidden: ["pluginLeft", "pluginLeft", "unknown", null]});
+ assert.deepEqual(normalized.hidden, ["pluginLeft"]);
+ assert.deepEqual(reduceMobileSidePanelConfig(config, {
+ type: "visibility", id: "unknown", visible: false,
+ }, pluginDocks), config);
+ });
+
it("falls back to a fresh default for malformed storage values", () => {
[
null,
false,
"not json",
[],
- {version: 4, left: ["file"], right: ["outline"], pluginDockIds: []},
+ {version: 5, left: ["file"], right: ["outline"], pluginDockIds: []},
{version: MOBILE_SIDE_PANEL_CONFIG_VERSION, left: "file", right: ["outline"], pluginDockIds: []},
{version: MOBILE_SIDE_PANEL_CONFIG_VERSION, left: ["file"], right: null, pluginDockIds: []},
{version: MOBILE_SIDE_PANEL_CONFIG_VERSION, left: ["file"], right: ["outline"]},
diff --git a/app/src/mobile/util/mobileSidePanelConfig.ts b/app/src/mobile/util/mobileSidePanelConfig.ts
index 93e8c0a371..86a3444759 100644
--- a/app/src/mobile/util/mobileSidePanelConfig.ts
+++ b/app/src/mobile/util/mobileSidePanelConfig.ts
@@ -1,4 +1,4 @@
-export const MOBILE_SIDE_PANEL_CONFIG_VERSION = 3 as const;
+export const MOBILE_SIDE_PANEL_CONFIG_VERSION = 4 as const;
export const MOBILE_SIDE_PANEL_CONFIG_CHANGE_EVENT = "siyuan-mobile-side-panel-config-change";
export const MOBILE_SIDE_PANEL_DOCK_IDS = [
@@ -26,9 +26,14 @@ export interface IMobileSidePanelConfig {
left: MobileSidePanelDockId[],
right: MobileSidePanelDockId[],
pluginDockIds: string[],
+ hidden: MobileSidePanelDockId[],
}
export type MobileSidePanelConfigEvent = {
+ type: "visibility",
+ id: MobileSidePanelDockId,
+ visible: boolean,
+} | {
type: "move",
id: MobileSidePanelDockId,
side: MobileSidePanelSide,
@@ -60,6 +65,7 @@ export const DEFAULT_MOBILE_SIDE_PANEL_CONFIG: Readonly<IMobileSidePanelConfig>
left: [...DEFAULT_MOBILE_SIDE_PANEL_LEFT],
right: [...DEFAULT_MOBILE_SIDE_PANEL_RIGHT],
pluginDockIds: [],
+ hidden: [],
};
const mobileSidePanelDockIdSet = new Set<string>(MOBILE_SIDE_PANEL_DOCK_IDS);
@@ -91,6 +97,7 @@ export const createDefaultMobileSidePanelConfig = (
left: [...DEFAULT_MOBILE_SIDE_PANEL_LEFT],
right: [...DEFAULT_MOBILE_SIDE_PANEL_RIGHT],
pluginDockIds: [],
+ hidden: [],
};
normalizePluginDocks(pluginDocks).forEach((dock) => {
config[dock.side].push(dock.id);
@@ -145,16 +152,16 @@ export const normalizeMobileSidePanelConfig = (
}
const record = value as Record<string, unknown>;
- if ((record.version !== 1 && record.version !== 2 && record.version !== MOBILE_SIDE_PANEL_CONFIG_VERSION) ||
+ if ((record.version !== 1 && record.version !== 2 && record.version !== 3 && record.version !== MOBILE_SIDE_PANEL_CONFIG_VERSION) ||
!Array.isArray(record.left) || !Array.isArray(record.right) ||
- (record.version === MOBILE_SIDE_PANEL_CONFIG_VERSION && !Array.isArray(record.pluginDockIds))) {
+ ((record.version === 3 || record.version === MOBILE_SIDE_PANEL_CONFIG_VERSION) && !Array.isArray(record.pluginDockIds))) {
return createDefaultMobileSidePanelConfig(pluginDocks);
}
const activePluginDocks = normalizePluginDocks(pluginDocks);
const activePluginDockIds = new Set(activePluginDocks.map(item => item.id));
const rememberedPluginDockIds = new Set<string>();
- if (record.version === MOBILE_SIDE_PANEL_CONFIG_VERSION) {
+ if (record.version === 3 || record.version === MOBILE_SIDE_PANEL_CONFIG_VERSION) {
(record.pluginDockIds as unknown[]).forEach((value) => {
if (typeof value === "string" && value && !isMobileSidePanelBuiltInDockId(value)) {
rememberedPluginDockIds.add(value);
@@ -167,6 +174,7 @@ export const normalizeMobileSidePanelConfig = (
left: [],
right: [],
pluginDockIds: [],
+ hidden: [],
};
const used = new Set<MobileSidePanelDockId>();
addValidDockIds(config.left, record.left, validPluginDockIds, used);
@@ -201,6 +209,9 @@ export const normalizeMobileSidePanelConfig = (
}
});
config.pluginDockIds = [...config.left, ...config.right].filter((id) => validPluginDockIds.has(id));
+ if (record.version === MOBILE_SIDE_PANEL_CONFIG_VERSION && Array.isArray(record.hidden)) {
+ config.hidden = [...new Set(record.hidden.filter((id): id is string => typeof id === "string" && used.has(id)))];
+ }
moveDefaultDockToEmptySide(config, "left");
moveDefaultDockToEmptySide(config, "right");
return config;
@@ -235,8 +246,19 @@ export const reduceMobileSidePanelConfig = (
left: [...currentState.left],
right: [...currentState.right],
pluginDockIds: [...currentState.pluginDockIds],
+ hidden: [...currentState.hidden],
};
const availableDockIds = getAvailableDockIds(pluginDocks);
+ if (event.type === "visibility") {
+ if (!availableDockIds.has(event.id)) {
+ return currentState;
+ }
+ config.hidden = config.hidden.filter(id => id !== event.id);
+ if (!event.visible) {
+ config.hidden.push(event.id);
+ }
+ return config;
+ }
if (event.type === "reorder") {
const docks = config[event.side];
const visibleDocks = docks.filter(id => availableDockIds.has(id));
diff --git a/app/src/mobile/util/mobileSidePanelLayout.test.ts b/app/src/mobile/util/mobileSidePanelLayout.test.ts
new file mode 100644
index 0000000000..23ab965caf
--- /dev/null
+++ b/app/src/mobile/util/mobileSidePanelLayout.test.ts
@@ -0,0 +1,92 @@
+import * as assert from "node:assert/strict";
+import {readFileSync} from "node:fs";
+import {test} from "node:test";
+import {runInNewContext} from "node:vm";
+import {ModuleKind, transpileModule} from "typescript";
+import {createDefaultMobileSidePanelConfig, MOBILE_SIDE_PANEL_DOCK_IDS, normalizeMobileSidePanelConfig} from "./mobileSidePanelConfig";
+
+test("side panel rendering hides docks, selects a visible fallback and closes an empty panel", () => {
+ const element = (type: string) => {
+ const classes = new Set<string>();
+ return {
+ dataset: {},
+ getAttribute: () => type,
+ classList: {
+ contains: (name: string) => classes.has(name),
+ toggle: (name: string, enabled: boolean) => enabled ? classes.add(name) : classes.delete(name),
+ },
+ };
+ };
+ const tabs = new Map(MOBILE_SIDE_PANEL_DOCK_IDS.map(id => [id, element(`sidebar-${id}-tab`)]));
+ const contents = new Map(MOBILE_SIDE_PANEL_DOCK_IDS.map(id => [id, element(`sidebar-${id}`)]));
+ type DockElement = ReturnType<typeof element>;
+ const panel = () => {
+ const children: DockElement[] = [];
+ return {
+ style: {transform: ""},
+ firstElementChild: {
+ firstElementChild: {append: (item: DockElement) => {
+ const index = children.indexOf(item);
+ if (index >= 0) {
+ children.splice(index, 1);
+ }
+ children.push(item);
+ }},
+ querySelector: () => children.find(item => item.classList.contains("toolbar__icon--active")),
+ },
+ lastElementChild: {append: (): void => undefined},
+ };
+ };
+ const left = panel();
+ const right = panel();
+ let closed = 0;
+ let aiDisabled = false;
+ const moduleExports = {} as {renderMobileSidePanelLayout: (app: unknown, config: unknown) => void};
+ const compiled = transpileModule(readFileSync("src/mobile/util/initFramework.ts", "utf8"), {
+ compilerOptions: {module: ModuleKind.CommonJS},
+ }).outputText;
+ runInNewContext(compiled, {
+ exports: moduleExports,
+ CSS: {escape: (value: string) => value},
+ window: {siyuan: {config: {readonly: false}, isPublish: false}},
+ document: {
+ getElementById: (id: string) => id === "sidebar" ? left : right,
+ querySelectorAll: (): DockElement[] => [],
+ querySelector: (selector: string) => {
+ const type = selector.match(/sidebar-(.*?)(-tab)?"/);
+ return (type[2] ? tabs : contents).get(type[1] as typeof MOBILE_SIDE_PANEL_DOCK_IDS[number]);
+ },
+ },
+ require: () => ({
+ normalizeMobileSidePanelConfig, MOBILE_SIDE_PANEL_DOCK_IDS,
+ getMobilePluginDockEntries: (): unknown[] => [],
+ getMobilePluginDockLayouts: (): unknown[] => [],
+ isDisabledFeature: () => aiDisabled,
+ closePanel: () => closed++,
+ }),
+ });
+ const render = (hidden: string[]) => moduleExports.renderMobileSidePanelLayout({}, {
+ ...createDefaultMobileSidePanelConfig(), hidden,
+ });
+ render([]);
+ assert.equal(tabs.get("file").classList.contains("toolbar__icon--active"), true);
+ render(["file", "inbox"]);
+ assert.equal(tabs.get("file").classList.contains("fn__none"), true);
+ assert.equal(contents.get("file").classList.contains("fn__none"), true);
+ assert.equal(tabs.get("inbox").classList.contains("fn__none"), true);
+ assert.equal(tabs.get("bookmark").classList.contains("toolbar__icon--active"), true);
+ left.style.transform = "translateX(0px)";
+ render([...MOBILE_SIDE_PANEL_DOCK_IDS]);
+ assert.equal(closed, 1);
+ assert.equal(left.style.transform, "");
+ tabs.forEach(tab => assert.equal(tab.classList.contains("toolbar__icon--active"), false));
+ contents.forEach(content => assert.equal(content.classList.contains("fn__none"), true));
+ aiDisabled = true;
+ render([]);
+ assert.equal(tabs.get("file").classList.contains("fn__none"), false);
+ assert.equal(tabs.get("file").classList.contains("toolbar__icon--active"), true);
+ assert.equal(tabs.get("agent").classList.contains("fn__none"), true);
+ aiDisabled = false;
+ render([]);
+ assert.equal(tabs.get("agent").classList.contains("fn__none"), false);
+});
diff --git a/app/src/mobile/util/mobileSidePanelSetting.ts b/app/src/mobile/util/mobileSidePanelSetting.ts
index a6842b7b87..71e8dd9de9 100644
--- a/app/src/mobile/util/mobileSidePanelSetting.ts
+++ b/app/src/mobile/util/mobileSidePanelSetting.ts
@@ -101,6 +101,7 @@ const genDockItemHtml = (
side: MobileSidePanelSide,
index: number,
length: number,
+ visible: boolean,
pluginEntriesById: ReadonlyMap<string, IMobilePluginDockEntry>,
) => {
const pluginEntry = pluginEntriesById.get(dockId);
@@ -115,6 +116,8 @@ const genDockItemHtml = (
return `<div class="b3-list-item" data-dock-id="${escapeAttr(dockId)}">
<svg class="b3-list-item__graphic"><use xlink:href="#${escapeAttr(icon)}"></use></svg>
<span class="b3-list-item__text">${escapeHtml(label)}</span>
+ <input class="b3-switch" type="checkbox" data-action="visibility" aria-label="${escapeAttr(label)}"${visible ? " checked" : ""}${disabled ? " disabled" : ""}>
+ <span class="fn__space"></span>
<button class="block__icon block__icon--show ariaLabel" data-action="up" data-position="north" aria-label="${escapeAttr(window.siyuan.languages.up)}" type="button"${disabled || index === 0 ? " disabled" : ""}><svg><use xlink:href="#iconUp"></use></svg></button>
<button class="block__icon block__icon--show ariaLabel" data-action="down" data-position="north" aria-label="${escapeAttr(window.siyuan.languages.down)}" type="button"${disabled || index === length - 1 ? " disabled" : ""}><svg><use xlink:href="#iconDown"></use></svg></button>
<button class="block__icon block__icon--show ariaLabel" data-action="move" data-position="north" aria-label="${escapeAttr(moveLabel)}" type="button"${disabled || length === 1 ? " disabled" : ""}><svg><use xlink:href="#${moveIcon}"></use></svg></button>
@@ -130,7 +133,7 @@ const genSideHtml = (
const dockIds = getVisibleDockIds(config, side, pluginEntriesById);
return `<div class="b3-label__text">${escapeHtml(label)}</div>
<div class="b3-list b3-list--background" data-side="${side}">${dockIds.map((dockId, index) =>
- genDockItemHtml(dockId, side, index, dockIds.length, pluginEntriesById)).join("")}</div>`;
+ genDockItemHtml(dockId, side, index, dockIds.length, !config.hidden.includes(dockId), pluginEntriesById)).join("")}</div>`;
};
const genMobileSidePanelListsHtml = (
@@ -170,7 +173,7 @@ export const mountMobileSidePanelSetting = (root: HTMLElement) => {
};
render();
settingElement.addEventListener("click", (event) => {
- const actionElement = (event.target as HTMLElement).closest<HTMLButtonElement>("[data-action]");
+ const actionElement = (event.target as HTMLElement).closest<HTMLButtonElement | HTMLInputElement>("[data-action]");
if (!actionElement || actionElement.disabled) {
return;
}
@@ -190,7 +193,13 @@ export const mountMobileSidePanelSetting = (root: HTMLElement) => {
if (!dockId || index < 0) {
return;
}
- if (actionElement.dataset.action === "move") {
+ if (actionElement.dataset.action === "visibility") {
+ config = reduceMobileSidePanelConfig(config, {
+ type: "visibility",
+ id: dockId,
+ visible: (actionElement as HTMLInputElement).checked,
+ }, pluginDockContext.layouts);
+ } else if (actionElement.dataset.action === "move") {
config = reduceMobileSidePanelConfig(config, {
type: "move",
id: dockId,
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index ec6ed0d941..57df65eb4f 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -2364,7 +2364,7 @@ export interface APIGETRoutes {
response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
body: "none";
output: "binary";
- contentVariants: [{"status":200,"contentType":"text/html"},{"status":302,"contentType":"text/html"}];
+ contentVariants: [{"status":200,"contentType":"text/html"}];
};
"/api/system/version": {
request: EmptyRequestInput;
diff --git a/docs/API-CONTRACTS.md b/docs/API-CONTRACTS.md
index 3028a7b69b..72877af450 100644
--- a/docs/API-CONTRACTS.md
+++ b/docs/API-CONTRACTS.md
@@ -46,6 +46,8 @@ At migration completion on September 14, 2026, all 629 method/path registrations
System contracts retain complete configuration, workspace management, uploads, authentication, OIDC response variants, boot streams, and empty or binary responses. Persisted layout and shortcut values are narrowed where the frontend consumes them, preserving existing default repair, obsolete-key cleanup, and binding filtering. Configuration export, import, and shutdown keep their existing lifecycle and encryption behavior.
+The OIDC web callback returns HTTP 200 HTML after authentication, including repeated successful callbacks. It reuses the shared result page and starts a same-origin navigation with a meta refresh and a fallback link, ending the provider's cross-site HTTP redirect chain without relaxing session origin checks. Desktop and validation callbacks retain their result pages. `TestOIDCWebCallbackContract`, `TestOIDCRepeatedWebCallbackContractSession`, and `TestRenderOAuthRedirectPage` cover the response contract, target escaping, session cookies, and continued cross-site rejection; the full kernel CI suite includes them. Run focused checks with `go test -tags "fts5 sqlcipher" ./model ./util ./api -run 'Test(OIDC|WriteOIDC|RenderOAuth|IsSessionOriginAllowed|IsCrossSiteFetchSite|CheckAuthRemoteSessionOrigin|APIContractSystem|APIContractRouterCoverage)' -count=1` and `go test ./apicontract/...`.
+
Transaction contracts discriminate all 98 known operation actions and exclude those names from the explicit unknown-action compatibility branch. The frontend uses the same finite operation union. Private raw input preserves historical fields, ignored values, asynchronous model errors, and echoed payloads; schema declarations do not move model validation into HTTP admission. Undo, redo, heading operations, response leases, and transaction persistence formats retain their existing behavior.
The editor submits a standalone `swapBlockRef` transaction with the reference in `id`, the definition in `blockID`, and the boolean options `includeChildren` and `originalToEmbed` in `data`. The kernel returns affected document IDs in `retData` and records an inverse operation with a private in-memory snapshot of affected top-level blocks. Snapshots are never serialized to clients or accepted from requests. Replay preserves block IDs and database bindings, rejects changed content or positions, and compensates document writes after a commit failure. `TestBlockSwapTransaction` covers persisted undo/redo, cross-document history, conflict rejection, and write-failure recovery; it runs in the full kernel command below. Run it separately with `go test -tags "fts5 sqlcipher" ./model -run 'Test(SwapBlockRefNodes|BlockSwapTransaction)' -count=1`.
diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.go
index c75ae9c38d..7e3a9d5508 100644
--- a/kernel/apicontract/contracts.go
+++ b/kernel/apicontract/contracts.go
@@ -977,7 +977,7 @@ var ExtensionCopy = define[ExtensionCopyRequest, *ExtensionCopyData]("extensionC
var SystemBootProgressSSE = define[EmptyRequest, Null]("bootProgressSSE", "/api/system/bootProgressSSE", NoBody, SSEOptions(SSEEvent[BootProgressData]("")), "GET")
var SystemGetBootAppearance = define[EmptyRequest, *SettingBootAppearance]("getBootAppearance", "/api/system/getBootAppearance", NoBody, ResponseOptions{EmptyResponseStatuses: []int{403}}, "GET")
var SystemGetCaptcha = define[EmptyRequest, BinaryContent]("getCaptcha", "/api/system/getCaptcha", NoBody, ResponseOptions{Output: BinaryOutput, ErrorStatus: 200, ContentVariants: []HTTPContentVariant{{Status: 200, ContentType: "image/png"}}, EmptyResponseStatuses: []int{500}}, "GET")
-var SystemOIDCCallback = define[SystemOIDCCallbackRequest, BinaryContent]("oidcCallback", "/api/system/oidc/callback", NoBody, HTTPContentOptions(HTTPContentVariant{Status: 200, ContentType: "text/html"}, HTTPContentVariant{Status: 302, ContentType: "text/html"}), "GET")
+var SystemOIDCCallback = define[SystemOIDCCallbackRequest, BinaryContent]("oidcCallback", "/api/system/oidc/callback", NoBody, HTTPContentOptions(HTTPContentVariant{Status: 200, ContentType: "text/html"}), "GET")
var SystemAddCustomEmoji = define[SystemCustomEmojiRequest, SystemPathData]("addCustomEmoji", "/api/system/addCustomEmoji", FormBody, ResponseOptions{AdditionalCodes: []int{400, 413}}, "POST")
var SystemCheckUpdate = define[SystemCheckUpdateRequest, Null]("checkUpdate", "/api/system/checkUpdate", JSONBody, ResponseOptions{}, "POST")
var SystemCheckWorkspaceDir = define[SystemPathRequest, SystemWorkspaceCheckData]("checkWorkspaceDir", "/api/system/checkWorkspaceDir", JSONBody, ResponseOptions{}, "POST")
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index 595252fc3c..ba95ebc8d5 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -106840,10 +106840,6 @@
{
"status": 200,
"contentType": "text/html"
- },
- {
- "status": 302,
- "contentType": "text/html"
}
]
},
diff --git a/kernel/model/oidc.go b/kernel/model/oidc.go
index 797724fb5c..4c8f4a8409 100644
--- a/kernel/model/oidc.go
+++ b/kernel/model/oidc.go
@@ -279,7 +279,7 @@ func OIDCCallback(c *gin.Context, request apicontract.SystemOIDCCallbackRequest)
return writeOIDCCallbackPage(c, false, oidcUserMessage())
}
completeOIDCTransaction(transaction.State, true, "")
- return apicontract.RedirectHTTPContent(http.StatusFound, safeOIDCRedirectTarget(transaction.To))
+ return writeOIDCWebCallbackPage(c, transaction.To)
}
func OIDCMobileCallback(c *gin.Context, request apicontract.SystemOIDCMobileRequest) (ret apicontract.Response[apicontract.SystemOIDCMobileData]) {
@@ -826,7 +826,7 @@ func respondRepeatedOIDCCallback(c *gin.Context, transaction *oidcTransaction) a
if err := authenticateOIDCSession(c, transaction.RememberMe); err != nil {
return writeOIDCCallbackPage(c, false, oidcUserMessage())
}
- return apicontract.RedirectHTTPContent(http.StatusFound, safeOIDCRedirectTarget(transaction.To))
+ return writeOIDCWebCallbackPage(c, transaction.To)
}
func cleanupOIDCTransactionsLocked() {
@@ -973,6 +973,18 @@ func writeOIDCCallbackPage(c *gin.Context, success bool, message string) apicont
if success {
title = oidcLanguage(366, "OIDC login completed")
}
+ lang := setOIDCCallbackPageHeaders(c)
+ return apicontract.SuccessHTTPContent(http.StatusOK, "text/html; charset=utf-8", util.RenderOAuthCallbackPage(lang, title, message, success))
+}
+
+func writeOIDCWebCallbackPage(c *gin.Context, target string) apicontract.Response[apicontract.BinaryContent] {
+ lang := setOIDCCallbackPageHeaders(c)
+ title := oidcLanguage(366, "OIDC login completed")
+ return apicontract.SuccessHTTPContent(http.StatusOK, "text/html; charset=utf-8",
+ util.RenderOAuthRedirectPage(lang, title, safeOIDCRedirectTarget(target)))
+}
+
+func setOIDCCallbackPageHeaders(c *gin.Context) string {
c.Header("Cache-Control", "no-store")
c.Header("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'; base-uri 'none'; frame-ancestors 'none'")
c.Header("Referrer-Policy", "no-referrer")
@@ -981,7 +993,7 @@ func writeOIDCCallbackPage(c *gin.Context, success bool, message string) apicont
if Conf != nil {
lang = util.LangToBCP47(Conf.Lang)
}
- return apicontract.SuccessHTTPContent(http.StatusOK, "text/html; charset=utf-8", util.RenderOAuthCallbackPage(lang, title, message, success))
+ return lang
}
func OIDCStartPreflight(c *gin.Context) *apicontract.Response[apicontract.SystemOIDCStartData] {
diff --git a/kernel/model/oidc_test.go b/kernel/model/oidc_test.go
index 7a642092ce..2bb38d7c35 100644
--- a/kernel/model/oidc_test.go
+++ b/kernel/model/oidc_test.go
@@ -21,6 +21,7 @@ import (
ginSessions "github.com/gin-contrib/sessions"
"github.com/gin-contrib/sessions/cookie"
"github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
"github.com/siyuan-note/siyuan/kernel/conf"
"github.com/siyuan-note/siyuan/kernel/util"
)
@@ -455,6 +456,64 @@ func TestWriteOIDCCallbackPageUsesSharedOAuthStyle(t *testing.T) {
}
}
+func TestOIDCWebCallbackContract(t *testing.T) {
+ setupOIDCTest(t)
+ for _, target := range []string{"/stage/build/desktop/?a=1&b=2", "https://foreign.example/", "//foreign.example/"} {
+ recorder := httptest.NewRecorder()
+ c, _ := gin.CreateTestContext(recorder)
+ response := writeOIDCWebCallbackPage(c, target)
+ if apicontract.SystemOIDCCallback.Status(response) != http.StatusOK || response.Binary() == nil {
+ t.Fatal("web callback must commit a document instead of an HTTP redirect")
+ }
+ page := string(response.Binary().Bytes)
+ if !strings.Contains(page, `<meta http-equiv="refresh" content="0;url=/`) || strings.Contains(page, "foreign.example") {
+ t.Fatalf("unexpected web callback navigation: %s", page)
+ }
+ if recorder.Header().Get("Cache-Control") != "no-store" || recorder.Header().Get("Referrer-Policy") != "no-referrer" ||
+ !strings.Contains(recorder.Header().Get("Content-Security-Policy"), "default-src 'none'") {
+ t.Fatalf("missing callback security headers: %v", recorder.Header())
+ }
+ }
+}
+
+func TestOIDCRepeatedWebCallbackContractSession(t *testing.T) {
+ setupOIDCTest(t)
+ engine := gin.New()
+ engine.Use(ginSessions.Sessions("siyuan", cookie.NewStore([]byte("oidc-web-callback-test-key"))))
+ engine.GET("/callback", func(c *gin.Context) {
+ response := respondRepeatedOIDCCallback(c, &oidcTransaction{Flow: oidcFlowWeb, Success: true, To: "/workspace"})
+ if apicontract.SystemOIDCCallback.Status(response) != http.StatusOK || response.Binary() == nil {
+ t.Fatal("repeated callback must return a navigation page")
+ }
+ c.Data(http.StatusOK, response.Binary().ContentType, response.Binary().Bytes)
+ })
+ engine.GET("/workspace", CheckAuth, func(c *gin.Context) { c.Status(http.StatusNoContent) })
+ callback := httptest.NewRecorder()
+ request := httptest.NewRequest(http.MethodGet, "https://notes.example/callback", nil)
+ request.Header.Set("Sec-Fetch-Site", "cross-site")
+ engine.ServeHTTP(callback, request)
+ if callback.Code != http.StatusOK || callback.Header().Get("Location") != "" ||
+ !strings.Contains(callback.Body.String(), `content="0;url=/workspace"`) {
+ t.Fatalf("unexpected repeated callback: %d %s", callback.Code, callback.Body.String())
+ }
+ for _, site := range []string{"same-origin", "cross-site", "same-site"} {
+ request = httptest.NewRequest(http.MethodGet, "https://notes.example/workspace", nil)
+ request.Header.Set("Sec-Fetch-Site", site)
+ for _, cookie := range callback.Result().Cookies() {
+ request.AddCookie(cookie)
+ }
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, request)
+ want := http.StatusUnauthorized
+ if site == "same-origin" {
+ want = http.StatusNoContent
+ }
+ if recorder.Code != want {
+ t.Fatalf("workspace request with %s returned %d, want %d: %s", site, recorder.Code, want, recorder.Body.String())
+ }
+ }
+}
+
func TestOIDCTransactionLimitsRejectWithoutEviction(t *testing.T) {
setupOIDCTest(t)
newTransaction := func(state, binding, clientIP string) *oidcTransaction {
diff --git a/kernel/util/oauth_callback.go b/kernel/util/oauth_callback.go
index 8466f6c658..bcff3028c4 100644
--- a/kernel/util/oauth_callback.go
+++ b/kernel/util/oauth_callback.go
@@ -20,12 +20,26 @@ import "html"
// RenderOAuthCallbackPage 渲染 OAuth 和 OIDC 共用的回调结果页面。
func RenderOAuthCallbackPage(lang, title, message string, success bool) []byte {
+ return renderOAuthCallbackPage(lang, title, message, success, "")
+}
+
+// RenderOAuthRedirectPage 在同源结果页加载后进入已校验的站内目标,结束身份提供方的重定向链。
+func RenderOAuthRedirectPage(lang, title, target string) []byte {
+ return renderOAuthCallbackPage(lang, title, "", true, target)
+}
+
+func renderOAuthCallbackPage(lang, title, message string, success bool, target string) []byte {
+ navigation, content := "", html.EscapeString(message)
+ if target != "" {
+ navigation = `<meta http-equiv="refresh" content="0;url=` + html.EscapeString(target) + `">`
+ content = `<a href="` + html.EscapeString(target) + `">SiYuan</a>`
+ }
markClass, mark := " mark--error", "!"
if success {
markClass, mark = "", "✓"
}
return []byte(`<!doctype html><html lang="` + html.EscapeString(lang) + `"><head><meta charset="utf-8">` +
- `<meta name="viewport" content="width=device-width,initial-scale=1"><title>` + html.EscapeString(title) + `</title>` +
+ `<meta name="viewport" content="width=device-width,initial-scale=1"><title>` + html.EscapeString(title) + `</title>` + navigation +
`<style>body{margin:0;min-height:100vh;display:grid;place-items:center;background:#f5f5f5;color:#202124;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}` +
`main{box-sizing:border-box;width:min(480px,calc(100vw - 32px));padding:40px 32px;text-align:center;background:#fff;border:1px solid #ddd;border-radius:12px;box-shadow:0 8px 24px #00000014}` +
`.brand{margin:0 0 28px;font-size:28px;font-weight:700;letter-spacing:-.5px}` +
@@ -33,5 +47,5 @@ func RenderOAuthCallbackPage(lang, title, message string, success bool) []byte {
`h1{margin:0 0 12px;font-size:24px;font-weight:600}p{margin:0;color:#5f6368;font-size:15px;line-height:1.7}` +
`@media(prefers-color-scheme:dark){body{background:#171717;color:#eee}main{background:#242424;border-color:#3c3c3c;box-shadow:none}p{color:#bbb}}</style>` +
`</head><body><main><div class="brand">SiYuan</div><div class="mark` + markClass + `" aria-hidden="true">` + mark + `</div><h1>` + html.EscapeString(title) +
- `</h1><p>` + html.EscapeString(message) + `</p></main></body></html>`)
+ `</h1><p>` + content + `</p></main></body></html>`)
}
diff --git a/kernel/util/oauth_callback_test.go b/kernel/util/oauth_callback_test.go
index 0d57330cba..6a308065db 100644
--- a/kernel/util/oauth_callback_test.go
+++ b/kernel/util/oauth_callback_test.go
@@ -36,3 +36,22 @@ func TestRenderOAuthCallbackPage(t *testing.T) {
t.Fatalf("OAuth failure callback page does not use the error state: %s", failurePage)
}
}
+
+func TestRenderOAuthRedirectPage(t *testing.T) {
+ page := string(RenderOAuthRedirectPage("en", "OIDC login completed", `/stage/build/desktop/?a=1&b="<script>`))
+ for _, expected := range []string{
+ `<meta http-equiv="refresh" content="0;url=/stage/build/desktop/?a=1&amp;b=&#34;&lt;script&gt;">`,
+ `<a href="/stage/build/desktop/?a=1&amp;b=&#34;&lt;script&gt;">SiYuan</a>`,
+ `class="mark"`,
+ } {
+ if !strings.Contains(page, expected) {
+ t.Fatalf("redirect page does not contain %q: %s", expected, page)
+ }
+ }
+ if strings.Contains(page, "<script>") {
+ t.Fatal("redirect target introduced executable markup")
+ }
+ if page := string(RenderOAuthCallbackPage("en", "Done", "Close this window", true)); strings.Contains(page, `http-equiv="refresh"`) {
+ t.Fatal("ordinary callback page unexpectedly navigates")
+ }
+}