Skip to content

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

:art: Improve menu and dock configuration https://github.com/siyuan-note/siyuan/issues/18810

Daniel6fc4f66f4632
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 1a111f3d28..e4fa74f7c4 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "قائمة علامات التبويب",
+ "entrySingleBlock": "كتلة واحدة",
+ "entryMultipleBlocks": "كتل متعددة",
+ "entryPixelWidth": "العرض بالبكسل",
+ "entryPercentageWidth": "العرض بالنسبة المئوية",
+ "entryPixelHeight": "الارتفاع بالبكسل",
+ "entryPercentageHeight": "الارتفاع بالنسبة المئوية",
"dragTipSelectedNotebooks": "تم تحديد ${count} من دفاتر الملاحظات",
"formatPainterDoubleClickTip": "نسخ التنسيق؛ انقر نقرًا مزدوجًا للاستخدام المستمر",
"dragTipSelectedDocs": "تم تحديد ${count} من المستندات",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 65d3106e6d..00c2dffcbd 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Tab-Menü",
+ "entrySingleBlock": "Einzelner Block",
+ "entryMultipleBlocks": "Mehrere Blöcke",
+ "entryPixelWidth": "Breite in Pixeln",
+ "entryPercentageWidth": "Breite in Prozent",
+ "entryPixelHeight": "Höhe in Pixeln",
+ "entryPercentageHeight": "Höhe in Prozent",
"dragTipSelectedNotebooks": "${count} Notizbücher ausgewählt",
"formatPainterDoubleClickTip": "Format übertragen; für fortlaufende Verwendung doppelklicken",
"dragTipSelectedDocs": "${count} Dokumente ausgewählt",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 2041cd1aef..b7cb538c5f 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Tab menu",
+ "entrySingleBlock": "Single block",
+ "entryMultipleBlocks": "Multiple blocks",
+ "entryPixelWidth": "Pixel width",
+ "entryPercentageWidth": "Percentage width",
+ "entryPixelHeight": "Pixel height",
+ "entryPercentageHeight": "Percentage height",
"dragTipSelectedNotebooks": "Selected ${count} notebooks",
"formatPainterDoubleClickTip": "Format Painter; double-click for continuous use",
"dragTipSelectedDocs": "Selected ${count} documents",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 2903a56424..e7487279be 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Menú de pestañas",
+ "entrySingleBlock": "Bloque individual",
+ "entryMultipleBlocks": "Varios bloques",
+ "entryPixelWidth": "Ancho en píxeles",
+ "entryPercentageWidth": "Ancho en porcentaje",
+ "entryPixelHeight": "Alto en píxeles",
+ "entryPercentageHeight": "Alto en porcentaje",
"dragTipSelectedNotebooks": "${count} cuadernos de notas seleccionados",
"formatPainterDoubleClickTip": "Copiar formato; haz doble clic para usarlo continuamente",
"dragTipSelectedDocs": "${count} documentos seleccionados",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 5f51f9084f..111358e09c 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Menu des onglets",
+ "entrySingleBlock": "Bloc unique",
+ "entryMultipleBlocks": "Plusieurs blocs",
+ "entryPixelWidth": "Largeur en pixels",
+ "entryPercentageWidth": "Largeur en pourcentage",
+ "entryPixelHeight": "Hauteur en pixels",
+ "entryPercentageHeight": "Hauteur en pourcentage",
"dragTipSelectedNotebooks": "${count} carnets de notes sélectionnés",
"formatPainterDoubleClickTip": "Reproduire la mise en forme ; double-cliquez pour une utilisation continue",
"dragTipSelectedDocs": "${count} documents sélectionnés",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 0fef3e15ac..f79e9b59ca 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "תפריט כרטיסיות",
+ "entrySingleBlock": "בלוק יחיד",
+ "entryMultipleBlocks": "בלוקים מרובים",
+ "entryPixelWidth": "רוחב בפיקסלים",
+ "entryPercentageWidth": "רוחב באחוזים",
+ "entryPixelHeight": "גובה בפיקסלים",
+ "entryPercentageHeight": "גובה באחוזים",
"dragTipSelectedNotebooks": "נבחרו ${count} מחברות",
"formatPainterDoubleClickTip": "מברשת עיצוב; לחיצה כפולה לשימוש רציף",
"dragTipSelectedDocs": "נבחרו ${count} מסמכים",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index 039eef5048..d655a55911 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "टैब मेनू",
+ "entrySingleBlock": "एक ब्लॉक",
+ "entryMultipleBlocks": "कई ब्लॉक",
+ "entryPixelWidth": "पिक्सेल में चौड़ाई",
+ "entryPercentageWidth": "प्रतिशत में चौड़ाई",
+ "entryPixelHeight": "पिक्सेल में ऊंचाई",
+ "entryPercentageHeight": "प्रतिशत में ऊंचाई",
"dragTipSelectedNotebooks": "${count} नोटबुक चयनित",
"formatPainterDoubleClickTip": "फ़ॉर्मैट पेंटर; लगातार उपयोग के लिए डबल-क्लिक करें",
"dragTipSelectedDocs": "${count} दस्तावेज़ चयनित",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index c965a64a10..5d34f3356c 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Menu tab",
+ "entrySingleBlock": "Blok tunggal",
+ "entryMultipleBlocks": "Beberapa blok",
+ "entryPixelWidth": "Lebar piksel",
+ "entryPercentageWidth": "Lebar persentase",
+ "entryPixelHeight": "Tinggi piksel",
+ "entryPercentageHeight": "Tinggi persentase",
"dragTipSelectedNotebooks": "${count} buku catatan dipilih",
"formatPainterDoubleClickTip": "Salin format; klik dua kali untuk penggunaan berkelanjutan",
"dragTipSelectedDocs": "${count} dokumen dipilih",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index d2d86c65a5..1f0d151dd1 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Menu delle schede",
+ "entrySingleBlock": "Blocco singolo",
+ "entryMultipleBlocks": "Più blocchi",
+ "entryPixelWidth": "Larghezza in pixel",
+ "entryPercentageWidth": "Larghezza percentuale",
+ "entryPixelHeight": "Altezza in pixel",
+ "entryPercentageHeight": "Altezza percentuale",
"dragTipSelectedNotebooks": "${count} taccuini selezionati",
"formatPainterDoubleClickTip": "Copia formato; fai doppio clic per l'uso continuo",
"dragTipSelectedDocs": "${count} documenti selezionati",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 3b586280d9..f9c31c6175 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "タブメニュー",
+ "entrySingleBlock": "単一のブロック",
+ "entryMultipleBlocks": "複数のブロック",
+ "entryPixelWidth": "ピクセル単位の幅",
+ "entryPercentageWidth": "パーセント単位の幅",
+ "entryPixelHeight": "ピクセル単位の高さ",
+ "entryPercentageHeight": "パーセント単位の高さ",
"dragTipSelectedNotebooks": "${count} 件のノートブックを選択",
"formatPainterDoubleClickTip": "書式のコピー。ダブルクリックで連続使用",
"dragTipSelectedDocs": "${count} 件の文書を選択",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index 5041999d90..c118c3a315 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "탭 메뉴",
+ "entrySingleBlock": "단일 블록",
+ "entryMultipleBlocks": "여러 블록",
+ "entryPixelWidth": "픽셀 너비",
+ "entryPercentageWidth": "백분율 너비",
+ "entryPixelHeight": "픽셀 높이",
+ "entryPercentageHeight": "백분율 높이",
"dragTipSelectedNotebooks": "노트북 ${count}개 선택됨",
"formatPainterDoubleClickTip": "서식 복사; 연속 사용하려면 두 번 클릭",
"dragTipSelectedDocs": "문서 ${count}개 선택됨",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 9d2ea1d954..6b37c8c1a0 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Tabbladmenu",
+ "entrySingleBlock": "Eén blok",
+ "entryMultipleBlocks": "Meerdere blokken",
+ "entryPixelWidth": "Breedte in pixels",
+ "entryPercentageWidth": "Breedte in procenten",
+ "entryPixelHeight": "Hoogte in pixels",
+ "entryPercentageHeight": "Hoogte in procenten",
"dragTipSelectedNotebooks": "${count} notitieboeken geselecteerd",
"formatPainterDoubleClickTip": "Opmaak kopiëren; dubbelklik voor doorlopend gebruik",
"dragTipSelectedDocs": "${count} documenten geselecteerd",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 42964abc43..9d0eed746c 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Menu kart",
+ "entrySingleBlock": "Pojedynczy blok",
+ "entryMultipleBlocks": "Wiele bloków",
+ "entryPixelWidth": "Szerokość w pikselach",
+ "entryPercentageWidth": "Szerokość procentowa",
+ "entryPixelHeight": "Wysokość w pikselach",
+ "entryPercentageHeight": "Wysokość procentowa",
"dragTipSelectedNotebooks": "Wybrane notesy: ${count}",
"formatPainterDoubleClickTip": "Malarz formatów; kliknij dwukrotnie, aby używać w trybie ciągłym",
"dragTipSelectedDocs": "Wybrane dokumenty: ${count}",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 565c753062..ccf9cb29ea 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Menu de abas",
+ "entrySingleBlock": "Bloco único",
+ "entryMultipleBlocks": "Vários blocos",
+ "entryPixelWidth": "Largura em pixels",
+ "entryPercentageWidth": "Largura percentual",
+ "entryPixelHeight": "Altura em pixels",
+ "entryPercentageHeight": "Altura percentual",
"dragTipSelectedNotebooks": "${count} blocos de notas selecionados",
"formatPainterDoubleClickTip": "Pincel de formatação; clique duas vezes para uso contínuo",
"dragTipSelectedDocs": "${count} documentos selecionados",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 104411e877..ac3f88660b 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Меню вкладок",
+ "entrySingleBlock": "Один блок",
+ "entryMultipleBlocks": "Несколько блоков",
+ "entryPixelWidth": "Ширина в пикселях",
+ "entryPercentageWidth": "Ширина в процентах",
+ "entryPixelHeight": "Высота в пикселях",
+ "entryPercentageHeight": "Высота в процентах",
"dragTipSelectedNotebooks": "Выбрано блокнотов: ${count}",
"formatPainterDoubleClickTip": "Формат по образцу; дважды щёлкните для непрерывного использования",
"dragTipSelectedDocs": "Выбрано документов: ${count}",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 3c3f13e649..ac7581d7a6 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Ponuka kariet",
+ "entrySingleBlock": "Jeden blok",
+ "entryMultipleBlocks": "Viac blokov",
+ "entryPixelWidth": "Šírka v pixeloch",
+ "entryPercentageWidth": "Šírka v percentách",
+ "entryPixelHeight": "Výška v pixeloch",
+ "entryPercentageHeight": "Výška v percentách",
"dragTipSelectedNotebooks": "Vybrané zápisníky: ${count}",
"formatPainterDoubleClickTip": "Kopírovať formát; dvojklikom zapnete nepretržité použitie",
"dragTipSelectedDocs": "Vybrané dokumenty: ${count}",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 6908ce36ac..4cef34e40b 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "เมนูแท็บ",
+ "entrySingleBlock": "บล็อกเดียว",
+ "entryMultipleBlocks": "หลายบล็อก",
+ "entryPixelWidth": "ความกว้างเป็นพิกเซล",
+ "entryPercentageWidth": "ความกว้างเป็นเปอร์เซ็นต์",
+ "entryPixelHeight": "ความสูงเป็นพิกเซล",
+ "entryPercentageHeight": "ความสูงเป็นเปอร์เซ็นต์",
"dragTipSelectedNotebooks": "เลือกสมุด ${count} เล่ม",
"formatPainterDoubleClickTip": "คัดลอกรูปแบบ; ดับเบิลคลิกเพื่อใช้งานต่อเนื่อง",
"dragTipSelectedDocs": "เลือกเอกสาร ${count} ฉบับ",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index a2b507fbdd..1071fc9066 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Sekme menüsü",
+ "entrySingleBlock": "Tek blok",
+ "entryMultipleBlocks": "Birden fazla blok",
+ "entryPixelWidth": "Piksel genişliği",
+ "entryPercentageWidth": "Yüzde genişliği",
+ "entryPixelHeight": "Piksel yüksekliği",
+ "entryPercentageHeight": "Yüzde yüksekliği",
"dragTipSelectedNotebooks": "${count} not defteri seçildi",
"formatPainterDoubleClickTip": "Biçim Boyacısı; sürekli kullanım için çift tıklayın",
"dragTipSelectedDocs": "${count} belge seçildi",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 4504ad1fc1..83d1ecc170 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "Меню вкладок",
+ "entrySingleBlock": "Один блок",
+ "entryMultipleBlocks": "Кілька блоків",
+ "entryPixelWidth": "Ширина в пікселях",
+ "entryPercentageWidth": "Ширина у відсотках",
+ "entryPixelHeight": "Висота в пікселях",
+ "entryPercentageHeight": "Висота у відсотках",
"dragTipSelectedNotebooks": "Вибрано блокнотів: ${count}",
"formatPainterDoubleClickTip": "Формат за зразком; двічі клацніть для безперервного використання",
"dragTipSelectedDocs": "Вибрано документів: ${count}",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 08fe129bf7..fc73dc7fbc 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "页签菜单",
+ "entrySingleBlock": "单个块",
+ "entryMultipleBlocks": "多个块",
+ "entryPixelWidth": "像素宽度",
+ "entryPercentageWidth": "百分比宽度",
+ "entryPixelHeight": "像素高度",
+ "entryPercentageHeight": "百分比高度",
"dragTipSelectedNotebooks": "选中 ${count} 个笔记本",
"formatPainterDoubleClickTip": "格式刷,双击可连续使用",
"dragTipSelectedDocs": "选中 ${count} 个文档",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 127a892cfa..a231d879a0 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,11 @@
{
+ "entryTabMenu": "頁籤選單",
+ "entrySingleBlock": "單個區塊",
+ "entryMultipleBlocks": "多個區塊",
+ "entryPixelWidth": "像素寬度",
+ "entryPercentageWidth": "百分比寬度",
+ "entryPixelHeight": "像素高度",
+ "entryPercentageHeight": "百分比高度",
"dragTipSelectedNotebooks": "選中 ${count} 個筆記本",
"formatPainterDoubleClickTip": "格式刷,雙擊可連續使用",
"dragTipSelectedDocs": "選中 ${count} 個文件",
diff --git a/app/src/config/entryVisibility/catalog.test.ts b/app/src/config/entryVisibility/catalog.test.ts
index 9068b927f0..dd8d613cf1 100644
--- a/app/src/config/entryVisibility/catalog.test.ts
+++ b/app/src/config/entryVisibility/catalog.test.ts
@@ -426,6 +426,93 @@ test("multiple document and notebook entries follow their document tree menus",
assert.ok(getEntryCatalogChildren("docTree.multi").some((item) => item.key === "delete"));
});
+test("document tree configuration groups notebook scopes before document scopes", () => {
+ const panelIndex = entryCatalog.findIndex((item) => item.key === "docTree.panel");
+ assert.deepEqual(entryCatalog.slice(panelIndex, panelIndex + 5).map((item) => item.key), [
+ "docTree.panel",
+ "docTree.notebook",
+ "docTree.notebooks",
+ "docTree.document",
+ "docTree.multi",
+ ]);
+});
+
+test("tab menu catalog follows its conditional menu declarations", () => {
+ assert.deepEqual(getEntryCatalogChildren("tab").map((item) => item.key), [
+ "close",
+ "closeOthers",
+ "closeAll",
+ "closeUnmodified",
+ "closeLeft",
+ "closeRight",
+ "separator_1",
+ "split",
+ "copy",
+ "pin",
+ "unpin",
+ "tabToWindow",
+ ]);
+ assert.deepEqual(getEntryCatalogChildren("tab.split").map((item) => item.key), [
+ "splitLR",
+ "splitMoveR",
+ "splitTB",
+ "splitMoveB",
+ "unsplit",
+ "unsplitAll",
+ ]);
+ assert.deepEqual(getEntryCatalogChildren("tab.copy").map((item) => item.key), [
+ "copyBlockRef",
+ "copyBlockEmbed",
+ "copyProtocol",
+ "copyProtocolInMd",
+ "copyWebURL",
+ "copyHPath",
+ "copyID",
+ ]);
+});
+
+test("tab menu is connected to its entry visibility scope", () => {
+ const source = readFileSync(resolve(process.cwd(), "src/config/entryVisibility/runtime.ts"), "utf8");
+ assert.match(source, /case Constants\.MENU_TAB:\s*return "tab";/);
+});
+
+test("configuration labels distinguish block scopes and size controls", () => {
+ const windowDescriptor = Object.getOwnPropertyDescriptor(globalThis, "window");
+ Object.defineProperty(globalThis, "window", {
+ configurable: true,
+ value: {
+ siyuan: {
+ languages: {
+ editor: "Editor",
+ entryGutterMenu: "Block icon menu",
+ entrySingleBlock: "Single block",
+ entryMultipleBlocks: "Multiple blocks",
+ entryPixelWidth: "Pixel width",
+ entryPercentageWidth: "Percentage width",
+ entryPixelHeight: "Pixel height",
+ entryPercentageHeight: "Percentage height",
+ },
+ },
+ },
+ });
+ try {
+ assert.equal(getEntryCatalogSection("gutter.single")?.label(),
+ "Editor - Block icon menu - Single block");
+ assert.equal(getEntryCatalogSection("gutter.multi")?.label(),
+ "Editor - Block icon menu - Multiple blocks");
+ assert.equal(getEntryCatalogNode("gutter.single.width.widthInput")?.label(), "Pixel width");
+ assert.equal(getEntryCatalogNode("gutter.single.width.widthDrag")?.label(), "Percentage width");
+ assert.equal(getEntryCatalogNode("inline.image.height.heightInput")?.label(), "Pixel height");
+ assert.equal(getEntryCatalogNode("inline.image.height.heightDrag")?.label(), "Percentage height");
+ } finally {
+ if (windowDescriptor) {
+ Object.defineProperty(globalThis, "window", windowDescriptor);
+ } else {
+ Reflect.deleteProperty(globalThis, "window");
+ }
+ }
+});
+
test("document tree sort menus follow their scope inheritance options", () => {
const documentEntries = getEntryCatalogChildren("docTree.document");
const attrIndex = documentEntries.findIndex((item) => item.key === "attr");
diff --git a/app/src/config/entryVisibility/catalog.ts b/app/src/config/entryVisibility/catalog.ts
index 3b70b44aa4..8b2d802025 100644
--- a/app/src/config/entryVisibility/catalog.ts
+++ b/app/src/config/entryVisibility/catalog.ts
@@ -232,7 +232,7 @@ const gutterLayout = (includeSuperBlockAlignment = false) => node("layout", lang
]);
const gutterWidth = () => node("width", lang("width"), true, [
- node("widthInput", lang("width")),
+ node("widthInput", lang("entryPixelWidth")),
node("width_25%", literal("25%")),
node("width_33%", literal("33%")),
node("width_50%", literal("50%")),
@@ -240,7 +240,7 @@ const gutterWidth = () => node("width", lang("width"), true, [
node("width_75%", literal("75%")),
node("width_100%", literal("100%")),
separator("separator_1"),
- node("widthDrag", lang("width")),
+ node("widthDrag", lang("entryPercentageWidth")),
separator("separator_2"),
node("default", lang("default")),
]);
@@ -540,16 +540,6 @@ export const entryCatalog: IEntryCatalogSection[] = [
]),
],
},
- {
- key: "docTree.document",
- label: location(lang("entryDocPanel"), lang("doc"), lang("more")),
- children: docTreeDocument(),
- },
- {
- key: "docTree.multi",
- label: location(lang("entryDocPanel"), lang("agentCatDoc"), lang("multiSelect"), lang("more")),
- children: docTreeMultiple(),
- },
{
key: "docTree.notebooks",
label: location(lang("entryDocPanel"), lang("agentCatNotebook"), lang("multiSelect"), lang("more")),
@@ -567,6 +557,41 @@ export const entryCatalog: IEntryCatalogSection[] = [
]),
],
},
+ {
+ key: "docTree.document",
+ label: location(lang("entryDocPanel"), lang("doc"), lang("more")),
+ children: docTreeDocument(),
+ },
+ {
+ key: "docTree.multi",
+ label: location(lang("entryDocPanel"), lang("agentCatDoc"), lang("multiSelect"), lang("more")),
+ children: docTreeMultiple(),
+ },
+ {
+ key: "tab",
+ label: lang("entryTabMenu"),
+ children: [
+ node("close", lang("close")),
+ node("closeOthers", lang("closeOthers")),
+ node("closeAll", lang("closeAll")),
+ node("closeUnmodified", lang("closeUnmodified")),
+ node("closeLeft", lang("closeLeft")),
+ node("closeRight", lang("closeRight")),
+ separator("separator_1"),
+ node("split", lang("split"), true, [
+ node("splitLR", lang("splitLR")),
+ node("splitMoveR", lang("splitMoveR")),
+ node("splitTB", lang("splitTB")),
+ node("splitMoveB", lang("splitMoveB")),
+ node("unsplit", lang("unsplit")),
+ node("unsplitAll", lang("unsplitAll")),
+ ]),
+ node("copy", lang("copy"), true, copyChildren()),
+ node("pin", lang("pin")),
+ node("unpin", lang("unpin")),
+ node("tabToWindow", lang("tabToWindow")),
+ ],
+ },
{
key: "document.title",
label: location(lang("editor"), lang("entryDocumentMenu")),
@@ -650,12 +675,12 @@ export const entryCatalog: IEntryCatalogSection[] = [
},
{
key: "gutter.single",
- label: location(lang("editor"), lang("entryGutterMenu"), lang("blockCount")),
+ label: location(lang("editor"), lang("entryGutterMenu"), lang("entrySingleBlock")),
children: gutterSingle(),
},
{
key: "gutter.multi",
- label: location(lang("editor"), lang("entryGutterMenu"), lang("multiSelect")),
+ label: location(lang("editor"), lang("entryGutterMenu"), lang("entryMultipleBlocks")),
children: gutterMultiple(),
},
{
@@ -729,7 +754,7 @@ export const entryCatalog: IEntryCatalogSection[] = [
node("alignCenter", lang("alignCenter")),
node("alignLeft", lang("alignLeft")),
node("width", lang("width"), true, [
- node("widthInput", lang("width")),
+ node("widthInput", lang("entryPixelWidth")),
node("width_25%", literal("25%")),
node("width_33%", literal("33%")),
node("width_50%", literal("50%")),
@@ -737,12 +762,12 @@ export const entryCatalog: IEntryCatalogSection[] = [
node("width_75%", literal("75%")),
node("width_100%", literal("100%")),
separator("separator_1"),
- node("widthDrag", lang("width")),
+ node("widthDrag", lang("entryPercentageWidth")),
separator("separator_2"),
node("default", lang("default")),
]),
node("height", lang("height"), true, [
- node("heightInput", lang("height")),
+ node("heightInput", lang("entryPixelHeight")),
node("width_25%", literal("25%")),
node("width_33%", literal("33%")),
node("width_50%", literal("50%")),
@@ -750,7 +775,7 @@ export const entryCatalog: IEntryCatalogSection[] = [
node("width_75%", literal("75%")),
node("width_100%", literal("100%")),
separator("separator_1"),
- node("heightDrag", lang("height")),
+ node("heightDrag", lang("entryPercentageHeight")),
separator("separator_2"),
node("default", lang("default")),
]),
diff --git a/app/src/config/entryVisibility/order.test.ts b/app/src/config/entryVisibility/order.test.ts
index 65bd8e1b5a..ca6f61e377 100644
--- a/app/src/config/entryVisibility/order.test.ts
+++ b/app/src/config/entryVisibility/order.test.ts
@@ -119,3 +119,31 @@ test("entry order preserves plugin registration slots", () => {
assert.deepEqual(reorderEntrySlots(items, ["b", "separator", "a"], (item) => item.key),
[{key: "b"}, {key: "plugin"}, {key: "separator"}, {key: "a"}]);
});
+
+test("tab menu ordering handles mutually exclusive and conditional entries", () => {
+ const order = [
+ "copy",
+ "split",
+ "unpin",
+ "pin",
+ "tabToWindow",
+ "separator_1",
+ "closeRight",
+ "closeLeft",
+ "closeUnmodified",
+ "closeAll",
+ "closeOthers",
+ "close",
+ ];
+ const reorder = (pinKey: "pin" | "unpin") => reorderEntrySlots([
+ {key: "close"},
+ {key: "separator_1"},
+ {key: "split"},
+ {key: "copy"},
+ {key: pinKey},
+ {key: "tabToWindow"},
+ ], order, (item) => item.key).map((item) => item.key);
+
+ assert.deepEqual(reorder("pin"), ["copy", "split", "pin", "tabToWindow", "separator_1", "close"]);
+ assert.deepEqual(reorder("unpin"), ["copy", "split", "unpin", "tabToWindow", "separator_1", "close"]);
+});
diff --git a/app/src/config/entryVisibility/runtime.ts b/app/src/config/entryVisibility/runtime.ts
index 9afd952d7c..bfd9c21a3b 100644
--- a/app/src/config/entryVisibility/runtime.ts
+++ b/app/src/config/entryVisibility/runtime.ts
@@ -110,6 +110,8 @@ const entryScope = (menuElement: HTMLElement): string => {
docs: Constants.MENU_FROM_DOC_TREE_MORE_DOCS,
items: Constants.MENU_FROM_DOC_TREE_MORE_ITEMS,
});
+ case Constants.MENU_TAB:
+ return "tab";
case Constants.MENU_TITLE:
return "document.title";
case Constants.MENU_BREADCRUMB_MORE: