Skip to content

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

:art: Improve keyboard navigation in desktop settings https://github.com/siyuan-note/siyuan/issues/19800

Daniel9b3b47432010
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 2313b3c26d..86f183e693 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": "20260923221935"
+ "updated": "20260923233001"
},
"Children": [
{
@@ -51,6 +51,65 @@
}
]
},
+ {
+ "ID": "20260923233001-pfoov15",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260923233001-pfoov15",
+ "updated": "20260923233001"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "In the desktop "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Settings"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " dialog, press "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " from the search field to focus each visible category in order, then the controls on the right. Press "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Shift+Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " to move backward and "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Enter"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " or "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Space"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " to open the focused category."
+ }
+ ]
+ },
{
"ID": "20201227133532-44ubczo",
"Type": "NodeHeading",
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 928393fd63..a32f1dee98 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": "20260923221935"
+ "updated": "20260923233001"
},
"Children": [
{
@@ -51,6 +51,65 @@
}
]
},
+ {
+ "ID": "20260923233001-fcalbnf",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260923233001-fcalbnf",
+ "updated": "20260923233001"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "在桌面端 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "设置"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 窗口中,从搜索框按 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 可依次聚焦可见分类,再进入右侧设置控件。按 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Shift+Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 反向移动,按 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Enter"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 或 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Space"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 打开当前聚焦的分类。"
+ }
+ ]
+ },
{
"ID": "20240112150737-e41yt1y",
"Type": "NodeHeading",
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 48c30f23b5..5c60f53952 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": "20260923221935"
+ "updated": "20260923233001"
},
"Children": [
{
@@ -51,6 +51,65 @@
}
]
},
+ {
+ "ID": "20260923233001-dx1k6zh",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260923233001-dx1k6zh",
+ "updated": "20260923233001"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "在桌面端 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "設定"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 視窗中,從搜尋框按 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 可依序聚焦可見分類,再進入右側設定控制項。按 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Shift+Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 反向移動,按 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Enter"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 或 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Space"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 開啟目前聚焦的分類。"
+ }
+ ]
+ },
{
"ID": "20211226122652-0t4c1qf",
"Type": "NodeHeading",
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 a796c5e836..0ff41a6999 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": "20260923221935"
+ "updated": "20260923233001"
},
"Children": [
{
@@ -49,6 +49,65 @@
}
]
},
+ {
+ "ID": "20260923233001-0vynujv",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260923233001-0vynujv",
+ "updated": "20260923233001"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "デスクトップ版の "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "設定"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " ウィンドウでは、検索欄から "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " を押すと、表示中のカテゴリに順番にフォーカスが移り、その後、右側の設定項目に移ります。"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Shift+Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " で逆方向に移動し、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Enter"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " または "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Space"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " でフォーカス中のカテゴリを開きます。"
+ }
+ ]
+ },
{
"ID": "20240530101000-9imgmgf",
"Type": "NodeHeading",
diff --git a/app/src/config/index.ts b/app/src/config/index.ts
index 2d725ea86a..ff46e97894 100644
--- a/app/src/config/index.ts
+++ b/app/src/config/index.ts
@@ -33,7 +33,7 @@ const openSettingDialog = (app: App, initialTab: TSettingTab = "editor") => {
const tabPanels: string[] = [];
for (const def of getSettingTabDefs()) {
const isActive = def.id === initialTab;
- tabListItems.push(`<li data-name="${def.id}" class="b3-list-item${isActive ? " b3-list-item--focus" : ""}${def.hidden ? " fn__none" : ""}"><svg class="b3-list-item__graphic"><use xlink:href="#${def.icon}"></use></svg><span class="b3-list-item__text">${def.title}</span></li>`);
+ tabListItems.push(`<li data-name="${def.id}" tabindex="0" role="button" class="b3-list-item${isActive ? " b3-list-item--focus" : ""}${def.hidden ? " fn__none" : ""}"><svg class="b3-list-item__graphic"><use xlink:href="#${def.icon}"></use></svg><span class="b3-list-item__text">${def.title}</span></li>`);
tabPanels.push(`<div class="config__tab-container${isActive ? "" : " fn__none"}" data-name="${def.id}"></div>`);
}
const settingDialogRef: {element?: HTMLElement} = {};
@@ -47,7 +47,7 @@ const openSettingDialog = (app: App, initialTab: TSettingTab = "editor") => {
</div>
<input spellcheck="false" placeholder="${window.siyuan.languages.searchPlaceholder}" class="b3-text-field fn__block">
</div>
- <ul class="config__tab-scroll">
+ <ul class="config__tab-scroll" tabindex="-1">
${tabListItems.join("")}
</ul>
</div>
@@ -88,6 +88,13 @@ const openSettingDialog = (app: App, initialTab: TSettingTab = "editor") => {
const tabId = item.getAttribute("data-name") as TSettingTab;
switchSettingTab(dialog.element, app, tabId);
});
+ item.addEventListener("keydown", (event: KeyboardEvent) => {
+ if (!event.isComposing && (event.key === "Enter" || event.key === " ")) {
+ event.preventDefault();
+ event.stopPropagation();
+ (item as HTMLElement).click();
+ }
+ });
});
switchSettingTab(dialog.element, app, initialTab);
return dialog;