An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Extend mobile bottom bar navigation https://github.com/siyuan-note/siyuan/issues/14542
Daniel7c5bacf87307
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 203d79c6c7..32bfc4b352 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "التنقل","mobileBottomBar": "الشريط السفلي","insertSuperBlockLeft": "إدراج عمود إلى اليسار","insertSuperBlockRight": "إدراج عمود إلى اليمين",@@ -226,7 +227,6 @@"entryCustomProfile": "ملف تعريف مخصص","entryCreateProfile": "إنشاء ملف تعريف","entryImportInvalid": "ملف تعريف القوائم وشريط الإرساء غير صالح",- "mobileMenuQuickActions": "إجراءات سريعة","mobileMenuCreate": "إنشاء","mobileMenuDataManagement": "إدارة البيانات","mobileMenuSettingsAndHelp": "الإعدادات والمساعدة",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex 4f54bc4d07..87ae8a705c 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navigation","mobileBottomBar": "Untere Leiste","insertSuperBlockLeft": "Spalte links einfügen","insertSuperBlockRight": "Spalte rechts einfügen",@@ -226,7 +227,6 @@"entryCustomProfile": "Benutzerdefiniertes Profil","entryCreateProfile": "Profil erstellen","entryImportInvalid": "Ungültige Menü- und Dock-Profildatei",- "mobileMenuQuickActions": "Schnellaktionen","mobileMenuCreate": "Erstellen","mobileMenuDataManagement": "Datenverwaltung","mobileMenuSettingsAndHelp": "Einstellungen und Hilfe",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex ba0dfbd49d..9994928b05 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navigation","mobileBottomBar": "Bottom bar","insertSuperBlockLeft": "Insert column to the left","insertSuperBlockRight": "Insert column to the right",@@ -226,7 +227,6 @@"entryCustomProfile": "Custom profile","entryCreateProfile": "Create profile","entryImportInvalid": "Invalid menu and dock profile file",- "mobileMenuQuickActions": "Quick actions","mobileMenuCreate": "Create","mobileMenuDataManagement": "Data management","mobileMenuSettingsAndHelp": "Settings and help",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex c1606ce589..6c90198f0b 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navegación","mobileBottomBar": "Barra inferior","insertSuperBlockLeft": "Insertar columna a la izquierda","insertSuperBlockRight": "Insertar columna a la derecha",@@ -226,7 +227,6 @@"entryCustomProfile": "Perfil personalizado","entryCreateProfile": "Crear perfil","entryImportInvalid": "El archivo de perfil de menús y panel acoplable no es válido",- "mobileMenuQuickActions": "Acciones rápidas","mobileMenuCreate": "Crear","mobileMenuDataManagement": "Gestión de datos","mobileMenuSettingsAndHelp": "Configuración y ayuda",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 61b1bce709..79e75844dc 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navigation","mobileBottomBar": "Barre inférieure","insertSuperBlockLeft": "Insérer une colonne à gauche","insertSuperBlockRight": "Insérer une colonne à droite",@@ -226,7 +227,6 @@"entryCustomProfile": "Profil personnalisé","entryCreateProfile": "Créer un profil","entryImportInvalid": "Fichier de profil des menus et de la barre d'ancrage non valide",- "mobileMenuQuickActions": "Actions rapides","mobileMenuCreate": "Créer","mobileMenuDataManagement": "Gestion des données","mobileMenuSettingsAndHelp": "Paramètres et aide",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 77f1c1cd26..196842067e 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "ניווט","mobileBottomBar": "סרגל תחתון","insertSuperBlockLeft": "הוספת עמודה משמאל","insertSuperBlockRight": "הוספת עמודה מימין",@@ -226,7 +227,6 @@"entryCustomProfile": "פרופיל מותאם אישית","entryCreateProfile": "יצירת פרופיל","entryImportInvalid": "קובץ פרופיל התפריטים וסרגל העגינה אינו תקין",- "mobileMenuQuickActions": "פעולות מהירות","mobileMenuCreate": "יצירה","mobileMenuDataManagement": "ניהול נתונים","mobileMenuSettingsAndHelp": "הגדרות ועזרה",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex da29649d2d..50a799cf40 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "नेविगेशन","mobileBottomBar": "निचली पट्टी","insertSuperBlockLeft": "बाईं ओर कॉलम डालें","insertSuperBlockRight": "दाईं ओर कॉलम डालें",@@ -226,7 +227,6 @@"entryCustomProfile": "कस्टम प्रोफ़ाइल","entryCreateProfile": "प्रोफ़ाइल बनाएँ","entryImportInvalid": "मेनू और डॉक प्रोफ़ाइल फ़ाइल अमान्य है",- "mobileMenuQuickActions": "त्वरित कार्रवाइयाँ","mobileMenuCreate": "बनाएँ","mobileMenuDataManagement": "डेटा प्रबंधन","mobileMenuSettingsAndHelp": "सेटिंग्स और सहायता",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex f763091eaa..577ff14604 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navigasi","mobileBottomBar": "Bilah bawah","insertSuperBlockLeft": "Sisipkan kolom di sebelah kiri","insertSuperBlockRight": "Sisipkan kolom di sebelah kanan",@@ -226,7 +227,6 @@"entryCustomProfile": "Profil kustom","entryCreateProfile": "Buat profil","entryImportInvalid": "Berkas profil menu dan dok tidak valid",- "mobileMenuQuickActions": "Tindakan cepat","mobileMenuCreate": "Buat","mobileMenuDataManagement": "Pengelolaan data","mobileMenuSettingsAndHelp": "Pengaturan dan bantuan",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex fda3a4c77b..f1bbb5a258 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navigazione","mobileBottomBar": "Barra inferiore","insertSuperBlockLeft": "Inserisci colonna a sinistra","insertSuperBlockRight": "Inserisci colonna a destra",@@ -226,7 +227,6 @@"entryCustomProfile": "Profilo personalizzato","entryCreateProfile": "Crea profilo","entryImportInvalid": "File del profilo di menu e barra di ancoraggio non valido",- "mobileMenuQuickActions": "Azioni rapide","mobileMenuCreate": "Crea","mobileMenuDataManagement": "Gestione dei dati","mobileMenuSettingsAndHelp": "Impostazioni e aiuto",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex c52a7e84d7..6f5033c060 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "ナビゲーション","mobileBottomBar": "下部バー","insertSuperBlockLeft": "左側に列を挿入","insertSuperBlockRight": "右側に列を挿入",@@ -226,7 +227,6 @@"entryCustomProfile": "カスタムプロファイル","entryCreateProfile": "プロファイルを作成","entryImportInvalid": "メニューとドックのプロファイルファイルが無効です",- "mobileMenuQuickActions": "クイック操作","mobileMenuCreate": "作成","mobileMenuDataManagement": "データ管理","mobileMenuSettingsAndHelp": "設定とヘルプ",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex 0b921d8fa4..5f6ea16c60 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "내비게이션","mobileBottomBar": "하단 바","insertSuperBlockLeft": "왼쪽에 열 삽입","insertSuperBlockRight": "오른쪽에 열 삽입",@@ -226,7 +227,6 @@"entryCustomProfile": "사용자 지정 프로필","entryCreateProfile": "프로필 만들기","entryImportInvalid": "메뉴 및 도크 프로필 파일이 올바르지 않습니다",- "mobileMenuQuickActions": "빠른 작업","mobileMenuCreate": "만들기","mobileMenuDataManagement": "데이터 관리","mobileMenuSettingsAndHelp": "설정 및 도움말",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 9d28b13b39..04bafb307d 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navigatie","mobileBottomBar": "Onderste balk","insertSuperBlockLeft": "Kolom links invoegen","insertSuperBlockRight": "Kolom rechts invoegen",@@ -226,7 +227,6 @@"entryCustomProfile": "Aangepast profiel","entryCreateProfile": "Profiel maken","entryImportInvalid": "Ongeldig profielbestand voor menu's en dock",- "mobileMenuQuickActions": "Snelle acties","mobileMenuCreate": "Maken","mobileMenuDataManagement": "Gegevensbeheer","mobileMenuSettingsAndHelp": "Instellingen en hulp",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex ca2f82ca2b..2e164b5903 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Nawigacja","mobileBottomBar": "Dolny pasek","insertSuperBlockLeft": "Wstaw kolumnę po lewej","insertSuperBlockRight": "Wstaw kolumnę po prawej",@@ -226,7 +227,6 @@"entryCustomProfile": "Profil niestandardowy","entryCreateProfile": "Utwórz profil","entryImportInvalid": "Nieprawidłowy plik profilu menu i doku",- "mobileMenuQuickActions": "Szybkie działania","mobileMenuCreate": "Utwórz","mobileMenuDataManagement": "Zarządzanie danymi","mobileMenuSettingsAndHelp": "Ustawienia i pomoc",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex c7bb656144..eb5de5a847 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navegação","mobileBottomBar": "Barra inferior","insertSuperBlockLeft": "Inserir coluna à esquerda","insertSuperBlockRight": "Inserir coluna à direita",@@ -226,7 +227,6 @@"entryCustomProfile": "Perfil personalizado","entryCreateProfile": "Criar perfil","entryImportInvalid": "Arquivo de perfil de menus e dock inválido",- "mobileMenuQuickActions": "Ações rápidas","mobileMenuCreate": "Criar","mobileMenuDataManagement": "Gerenciamento de dados","mobileMenuSettingsAndHelp": "Configurações e ajuda",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 9b034ed863..d3f66e0925 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Навигация","mobileBottomBar": "Нижняя панель","insertSuperBlockLeft": "Вставить столбец слева","insertSuperBlockRight": "Вставить столбец справа",@@ -226,7 +227,6 @@"entryCustomProfile": "Пользовательский профиль","entryCreateProfile": "Создать профиль","entryImportInvalid": "Недопустимый файл профиля меню и док-панели",- "mobileMenuQuickActions": "Быстрые действия","mobileMenuCreate": "Создание","mobileMenuDataManagement": "Управление данными","mobileMenuSettingsAndHelp": "Настройки и помощь",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex 547dd9ecf3..6c85c007ad 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Navigácia","mobileBottomBar": "Spodná lišta","insertSuperBlockLeft": "Vložiť stĺpec vľavo","insertSuperBlockRight": "Vložiť stĺpec vpravo",@@ -226,7 +227,6 @@"entryCustomProfile": "Vlastný profil","entryCreateProfile": "Vytvoriť profil","entryImportInvalid": "Neplatný súbor profilu ponúk a doku",- "mobileMenuQuickActions": "Rýchle akcie","mobileMenuCreate": "Vytvoriť","mobileMenuDataManagement": "Správa údajov","mobileMenuSettingsAndHelp": "Nastavenia a pomoc",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex 21a739918c..bc2ca1356b 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "การนำทาง","mobileBottomBar": "แถบด้านล่าง","insertSuperBlockLeft": "แทรกคอลัมน์ทางซ้าย","insertSuperBlockRight": "แทรกคอลัมน์ทางขวา",@@ -226,7 +227,6 @@"entryCustomProfile": "โปรไฟล์กำหนดเอง","entryCreateProfile": "สร้างโปรไฟล์","entryImportInvalid": "ไฟล์โปรไฟล์เมนูและแถบเชื่อมต่อไม่ถูกต้อง",- "mobileMenuQuickActions": "การดำเนินการด่วน","mobileMenuCreate": "สร้าง","mobileMenuDataManagement": "การจัดการข้อมูล","mobileMenuSettingsAndHelp": "การตั้งค่าและความช่วยเหลือ",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 99349751ed..ebd73cbf83 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Gezinme","mobileBottomBar": "Alt çubuk","insertSuperBlockLeft": "Sola sütun ekle","insertSuperBlockRight": "Sağa sütun ekle",@@ -226,7 +227,6 @@"entryCustomProfile": "Özel profil","entryCreateProfile": "Profil oluştur","entryImportInvalid": "Menü ve yuva profil dosyası geçersiz",- "mobileMenuQuickActions": "Hızlı işlemler","mobileMenuCreate": "Oluştur","mobileMenuDataManagement": "Veri yönetimi","mobileMenuSettingsAndHelp": "Ayarlar ve yardım",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex 3133d12888..6066bd1e5c 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "Навігація","mobileBottomBar": "Нижня панель","insertSuperBlockLeft": "Вставити стовпець ліворуч","insertSuperBlockRight": "Вставити стовпець праворуч",@@ -226,7 +227,6 @@"entryCustomProfile": "Користувацький профіль","entryCreateProfile": "Створити профіль","entryImportInvalid": "Недійсний файл профілю меню та док-панелі",- "mobileMenuQuickActions": "Швидкі дії","mobileMenuCreate": "Створення","mobileMenuDataManagement": "Керування даними","mobileMenuSettingsAndHelp": "Налаштування та довідка",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 8df13af450..3adcf8b528 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "导航","mobileBottomBar": "底栏","insertSuperBlockLeft": "左侧插入分栏","insertSuperBlockRight": "右侧插入分栏",@@ -226,7 +227,6 @@"entryCustomProfile": "自定义方案","entryCreateProfile": "新建方案","entryImportInvalid": "菜单与停靠栏方案文件无效",- "mobileMenuQuickActions": "快捷操作","mobileMenuCreate": "创建","mobileMenuDataManagement": "数据管理","mobileMenuSettingsAndHelp": "设置与帮助",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex df2a531a8a..54017325ec 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,5 @@{+ "mobileMenuNavigation": "導航","mobileBottomBar": "底欄","insertSuperBlockLeft": "左側插入分欄","insertSuperBlockRight": "右側插入分欄",@@ -226,7 +227,6 @@"entryCustomProfile": "自訂方案","entryCreateProfile": "新增方案","entryImportInvalid": "選單與停靠欄方案檔案無效",- "mobileMenuQuickActions": "快速操作","mobileMenuCreate": "建立","mobileMenuDataManagement": "資料管理","mobileMenuSettingsAndHelp": "設定與幫助",diff --git a/app/src/assets/scss/main/_mobile.scss b/app/src/assets/scss/main/_mobile.scssindex d8e2103cda..fc4d2ea3fb 100644--- a/app/src/assets/scss/main/_mobile.scss+++ b/app/src/assets/scss/main/_mobile.scss@@ -342,14 +342,19 @@ body.mobile-keyboard--open {position: absolute;top: -5px;left: 14px;- min-width: 13px;- padding: 0 2px;+ box-sizing: border-box;+ display: flex;+ align-items: center;+ justify-content: center;+ min-width: 14px;+ height: 14px;+ padding: 0 3px;border: 1px solid var(--b3-theme-background);border-radius: 8px;color: var(--b3-theme-on-primary);background-color: var(--b3-theme-primary);font-size: 9px;- line-height: 13px;+ line-height: 1;text-align: center;}}diff --git a/app/src/assets/template/mobile/index.tpl b/app/src/assets/template/mobile/index.tplindex 6272a7c403..3d2f2da263 100644--- a/app/src/assets/template/mobile/index.tpl+++ b/app/src/assets/template/mobile/index.tpl@@ -110,6 +110,14 @@<svg><use xlink:href="#iconInbox"></use></svg><span class="mobile-bottom-bar__label"></span></button>+ <button id="mobileBottomBarAgent" class="mobile-bottom-bar__item fn__none" data-action="agent" type="button">+ <svg><use xlink:href="#iconSparkles"></use></svg>+ <span class="mobile-bottom-bar__label"></span>+ </button>+ <button id="mobileBottomBarSpacedRepetition" class="mobile-bottom-bar__item fn__none" data-action="spacedRepetition" type="button">+ <svg><use xlink:href="#iconRiffCard"></use></svg>+ <span class="mobile-bottom-bar__label"></span>+ </button><button id="mobileBottomBarCommand" class="mobile-bottom-bar__item fn__none" data-action="command" type="button"><svg><use xlink:href="#iconTerminal"></use></svg><span class="mobile-bottom-bar__label"></span>diff --git a/app/src/mobile/menu/index.ts b/app/src/mobile/menu/index.tsindex c85f9650dd..1544c7640f 100644--- a/app/src/mobile/menu/index.ts+++ b/app/src/mobile/menu/index.ts@@ -230,7 +230,7 @@ export const initRightMenu = (app: App) => {</div><div class="b3-menu__items b3-menu__groups"><div class="b3-menu__group">- <div class="b3-menu__group-title">${window.siyuan.languages.mobileBottomBar}</div>+ <div class="b3-menu__group-title">${window.siyuan.languages.mobileMenuNavigation}</div><div class="b3-menu__group-items"><div id="menuDocuments" class="b3-menu__item"><svg class="b3-menu__icon"><use xlink:href="#iconFiles"></use></svg><span class="b3-menu__label">${window.siyuan.languages.fileTree}</span>@@ -253,11 +253,6 @@ export const initRightMenu = (app: App) => {<div id="menuInbox" class="b3-menu__item"><svg class="b3-menu__icon"><use xlink:href="#iconInbox"></use></svg><span class="b3-menu__label">${window.siyuan.languages.inbox}</span></div>- </div>- </div>- <div class="b3-menu__group">- <div class="b3-menu__group-title">${window.siyuan.languages.mobileMenuQuickActions}</div>- <div class="b3-menu__group-items"><div id="menuRecent" class="b3-menu__item"><svg class="b3-menu__icon"><use xlink:href="#iconList"></use></svg><span class="b3-menu__label">${window.siyuan.languages.recentDocs}</span></div>diff --git a/app/src/mobile/util/mobileBottomBar.ts b/app/src/mobile/util/mobileBottomBar.tsindex 678293ddbb..2bed6a1426 100644--- a/app/src/mobile/util/mobileBottomBar.ts+++ b/app/src/mobile/util/mobileBottomBar.ts@@ -1,8 +1,9 @@import type {App} from "../../index";import {Constants} from "../../constants";-import {setStorageVal} from "../../protyle/util/compatibility";+import {isDisabledFeature, setStorageVal} from "../../protyle/util/compatibility";import {escapeAttr, escapeHtml} from "../../util/escape";import {newFile} from "../../util/newFile";+import {openCard} from "../../card/openCard";import {commandPanel} from "../../boot/globalEvent/command/panel";import {popSearch} from "../menu/search";import {getRecentDocs} from "../menu/getRecentDocs";@@ -42,6 +43,10 @@ const getActionLabel = (action: MobileBottomBarAction) => {return window.siyuan.languages.backlinks;case "inbox":return window.siyuan.languages.inbox;+ case "agent":+ return window.siyuan.languages.agentChat;+ case "spacedRepetition":+ return window.siyuan.languages.spaceRepetition;case "command":return window.siyuan.languages.commandPanel;}@@ -49,10 +54,22 @@ const getActionLabel = (action: MobileBottomBarAction) => {const getBottomBarConfig = () => {const config = normalizeMobileBottomBarConfig(window.siyuan.storage[Constants.LOCAL_MOBILE_BOTTOM_BAR]);- if (!window.siyuan.config.readonly && !window.siyuan.isPublish) {+ const unavailableActions = new Set<MobileBottomBarAction>();+ if (window.siyuan.config.readonly) {+ unavailableActions.add("newDoc");+ unavailableActions.add("agent");+ unavailableActions.add("spacedRepetition");+ } else if (window.siyuan.isPublish) {+ unavailableActions.add("newDoc");+ unavailableActions.add("agent");+ }+ if (isDisabledFeature("ai")) {+ unavailableActions.add("agent");+ }+ if (unavailableActions.size === 0) {return config;}- return resolveMobileBottomBarAvailability(config, ["newDoc"]);+ return resolveMobileBottomBarAvailability(config, [...unavailableActions]);};const setBottomBarConfig = (config: IMobileBottomBarConfig) => {@@ -164,6 +181,21 @@ export const initMobileBottomBar = (app: App) => {openDock("inbox");}});+ bindBottomBarAction("mobileBottomBarAgent", () => {+ if (isMobileBlockSelecting()) {+ return;+ }+ activeBlur();+ void import("../agent/MobileAgentChat").then(({openMobileAgent}) => openMobileAgent(app));+ });+ bindBottomBarAction("mobileBottomBarSpacedRepetition", () => {+ if (isMobileBlockSelecting()) {+ return;+ }+ activeBlur();+ openCard(app);+ closePanel();+ });bindBottomBarAction("mobileBottomBarCommand", () => {if (isMobileBlockSelecting()) {return;@@ -175,7 +207,7 @@ export const initMobileBottomBar = (app: App) => {};const genBottomBarOptions = () => MOBILE_BOTTOM_BAR_ACTIONS.map((action) =>- `<option value="${action}">${escapeHtml(getActionLabel(action))}</option>`+ `<option value="${action}"${action === "agent" && isDisabledFeature("ai") ? " disabled" : ""}>${escapeHtml(getActionLabel(action))}</option>`).join("");export const genMobileBottomBarSettingHTML = () => {diff --git a/app/src/mobile/util/mobileBottomBarConfig.test.ts b/app/src/mobile/util/mobileBottomBarConfig.test.tsindex c42a46cde9..988bcfe1fe 100644--- a/app/src/mobile/util/mobileBottomBarConfig.test.ts+++ b/app/src/mobile/util/mobileBottomBarConfig.test.ts@@ -46,13 +46,13 @@ describe("mobile bottom bar config", () => {assert.deepEqual(config.actions, ["tabs", "search", "newDoc", "documents"]);});- it("supports inbox and backlinks as configurable actions", () => {+ it("supports inbox, backlinks, the agent, and spaced repetition as configurable actions", () => {const config = normalizeMobileBottomBarConfig({version: MOBILE_BOTTOM_BAR_CONFIG_VERSION,- actions: ["inbox", "backlink", "bookmark", "tag"],+ actions: ["inbox", "backlink", "agent", "spacedRepetition"],});- assert.deepEqual(config.actions, ["inbox", "backlink", "bookmark", "tag"]);+ assert.deepEqual(config.actions, ["inbox", "backlink", "agent", "spacedRepetition"]);});it("replaces a slot when selecting an unused action", () => {@@ -83,4 +83,22 @@ describe("mobile bottom bar config", () => {assert.deepEqual(config.actions, ["documents", "search", "recent", "tabs"]);assert.equal(config.actions.includes("newDoc"), false);});++ it("replaces the agent when AI is unavailable", () => {+ const config = resolveMobileBottomBarAvailability({+ version: MOBILE_BOTTOM_BAR_CONFIG_VERSION,+ actions: ["documents", "agent", "newDoc", "tabs"],+ }, ["agent"]);++ assert.deepEqual(config.actions, ["documents", "search", "newDoc", "tabs"]);+ });++ it("replaces spaced repetition in read-only mode", () => {+ const config = resolveMobileBottomBarAvailability({+ version: MOBILE_BOTTOM_BAR_CONFIG_VERSION,+ actions: ["documents", "spacedRepetition", "search", "tabs"],+ }, ["spacedRepetition"]);++ assert.deepEqual(config.actions, ["documents", "newDoc", "search", "tabs"]);+ });});diff --git a/app/src/mobile/util/mobileBottomBarConfig.ts b/app/src/mobile/util/mobileBottomBarConfig.tsindex f16118e452..d3ccb6d992 100644--- a/app/src/mobile/util/mobileBottomBarConfig.ts+++ b/app/src/mobile/util/mobileBottomBarConfig.ts@@ -11,6 +11,8 @@ export const MOBILE_BOTTOM_BAR_ACTIONS = ["tag","backlink","inbox",+ "agent",+ "spacedRepetition","command",] as const;