From 0027ea8f68dac95d9357d092c3d34fb8bcb600f0 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Fri, 26 Jun 2026 21:42:02 +0800 Subject: [PATCH] feat(sidebar): add group-by-type toggle to installed extensions section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add group-by-type button to extensions category header (mirrors the agent group-by-kind pattern) — syncs with the extensions page Switch via shared SidebarDataContext state - Relocate both group and refresh controls to sit left-aligned immediately after the title for both Agent and Extensions sections - Add plugins.groupByTypeShort i18n key to all 8 locales Co-Authored-By: Claude Opus 4.8 --- .../components/home-sidebar/HomeSidebar.tsx | 97 ++++++++++++------- web/src/i18n/locales/en-US.ts | 2 + web/src/i18n/locales/es-ES.ts | 1 + web/src/i18n/locales/ja-JP.ts | 2 + web/src/i18n/locales/ru-RU.ts | 1 + web/src/i18n/locales/th-TH.ts | 1 + web/src/i18n/locales/vi-VN.ts | 1 + web/src/i18n/locales/zh-Hans.ts | 2 + web/src/i18n/locales/zh-Hant.ts | 1 + 9 files changed, 73 insertions(+), 35 deletions(-) diff --git a/web/src/app/home/components/home-sidebar/HomeSidebar.tsx b/web/src/app/home/components/home-sidebar/HomeSidebar.tsx index de36855cb..6204c9d2b 100644 --- a/web/src/app/home/components/home-sidebar/HomeSidebar.tsx +++ b/web/src/app/home/components/home-sidebar/HomeSidebar.tsx @@ -34,7 +34,7 @@ import { RefreshCcw, Bot, Workflow, - Group, + ListTree, } from 'lucide-react'; import { useTheme } from '@/components/providers/theme-provider'; @@ -1112,42 +1112,69 @@ function NavItems({ {config.name} -
- {isAgents && ( - - )} - {isExtensionsCategory && ( - - )} + onClick={(e) => { + e.stopPropagation(); + sidebarData.setAgentsGroupByKind( + !sidebarData.agentsGroupByKind, + ); + }} + > + + {t('agents.groupByKindShort')} + + )} + {isExtensionsCategory && ( + + )} + {isExtensionsCategory && ( + + )} +
+ )} +
{canCreate && (isPlugin ? ( diff --git a/web/src/i18n/locales/en-US.ts b/web/src/i18n/locales/en-US.ts index 8379ce2af..bf7d84bf9 100644 --- a/web/src/i18n/locales/en-US.ts +++ b/web/src/i18n/locales/en-US.ts @@ -540,6 +540,7 @@ const enUS = { kindBadgeAgent: 'Agent', kindBadgePipeline: 'Pipeline', groupByKind: 'Group by type', + groupByKindShort: 'Group', pipelineTypeDescription: 'Keep the existing no-code message pipeline for backward compatibility. It only handles message events.', allEvents: 'Supports all EBA events', @@ -602,6 +603,7 @@ const enUS = { noExtensionInstalled: 'No extensions installed', loadingExtensions: 'Loading extensions...', groupByType: 'Group by format', + groupByTypeShort: 'Group', pluginConfig: 'Plugin Configuration', pluginSort: 'Plugin Sort', pluginSortDescription: diff --git a/web/src/i18n/locales/es-ES.ts b/web/src/i18n/locales/es-ES.ts index 229617018..42162e656 100644 --- a/web/src/i18n/locales/es-ES.ts +++ b/web/src/i18n/locales/es-ES.ts @@ -506,6 +506,7 @@ const esES = { noExtensionInstalled: 'No hay extensiones instaladas', loadingExtensions: 'Cargando extensiones...', groupByType: 'Agrupar por formato', + groupByTypeShort: 'Agrupar', pluginConfig: 'Configuración del plugin', pluginSort: 'Orden de plugins', pluginSortDescription: diff --git a/web/src/i18n/locales/ja-JP.ts b/web/src/i18n/locales/ja-JP.ts index dc62dbdc6..ee81fe276 100644 --- a/web/src/i18n/locales/ja-JP.ts +++ b/web/src/i18n/locales/ja-JP.ts @@ -524,6 +524,7 @@ const jaJP = { kindBadgeAgent: 'Agent', kindBadgePipeline: 'パイプライン', groupByKind: 'タイプ別にグループ化', + groupByKindShort: 'グループ', pipelineTypeDescription: '既存のノーコードメッセージ Pipeline を互換性のため保持します。メッセージイベントのみ処理できます。', allEvents: 'すべての EBA イベントに対応', @@ -584,6 +585,7 @@ const jaJP = { noExtensionInstalled: '拡張機能がインストールされていません', loadingExtensions: '拡張機能を読み込み中...', groupByType: '形式でグループ化', + groupByTypeShort: 'グループ', pluginConfig: 'プラグイン設定', pluginSort: 'プラグインの並び替え', pluginSortDescription: diff --git a/web/src/i18n/locales/ru-RU.ts b/web/src/i18n/locales/ru-RU.ts index 9d7bd2b20..4a0d4fc97 100644 --- a/web/src/i18n/locales/ru-RU.ts +++ b/web/src/i18n/locales/ru-RU.ts @@ -505,6 +505,7 @@ const ruRU = { noExtensionInstalled: 'Расширения не установлены', loadingExtensions: 'Загрузка расширений...', groupByType: 'Группировать по формату', + groupByTypeShort: 'Группа', pluginConfig: 'Настройка плагина', pluginSort: 'Порядок плагинов', pluginSortDescription: diff --git a/web/src/i18n/locales/th-TH.ts b/web/src/i18n/locales/th-TH.ts index f52d9c48d..a6ec1a41f 100644 --- a/web/src/i18n/locales/th-TH.ts +++ b/web/src/i18n/locales/th-TH.ts @@ -490,6 +490,7 @@ const thTH = { noExtensionInstalled: 'ยังไม่มีส่วนขยายที่ติดตั้ง', loadingExtensions: 'กำลังโหลดส่วนขยาย...', groupByType: 'จัดกลุ่มตามรูปแบบ', + groupByTypeShort: 'จัดกลุ่ม', pluginConfig: 'การกำหนดค่าปลั๊กอิน', pluginSort: 'เรียงลำดับปลั๊กอิน', pluginSortDescription: diff --git a/web/src/i18n/locales/vi-VN.ts b/web/src/i18n/locales/vi-VN.ts index 431671726..ac41a09ff 100644 --- a/web/src/i18n/locales/vi-VN.ts +++ b/web/src/i18n/locales/vi-VN.ts @@ -500,6 +500,7 @@ const viVN = { noExtensionInstalled: 'Chưa cài đặt tiện ích mở rộng nào', loadingExtensions: 'Đang tải tiện ích mở rộng...', groupByType: 'Nhóm theo định dạng', + groupByTypeShort: 'Nhóm', pluginConfig: 'Cấu hình Plugin', pluginSort: 'Sắp xếp Plugin', pluginSortDescription: diff --git a/web/src/i18n/locales/zh-Hans.ts b/web/src/i18n/locales/zh-Hans.ts index 2cef40e63..cb23df0dc 100644 --- a/web/src/i18n/locales/zh-Hans.ts +++ b/web/src/i18n/locales/zh-Hans.ts @@ -519,6 +519,7 @@ const zhHans = { kindBadgeAgent: 'Agent', kindBadgePipeline: '流水线', groupByKind: '按类型分组', + groupByKindShort: '分组', pipelineTypeDescription: '保留现有无代码消息流水线,兼容旧配置,只能处理消息事件。', allEvents: '支持全部 EBA 事件', @@ -578,6 +579,7 @@ const zhHans = { noExtensionInstalled: '暂未安装任何扩展', loadingExtensions: '正在加载扩展...', groupByType: '按格式分组', + groupByTypeShort: '分组', pluginSort: '插件排序', pluginSortDescription: '插件顺序会影响同一事件内的处理顺序,请拖动插件卡片排序', diff --git a/web/src/i18n/locales/zh-Hant.ts b/web/src/i18n/locales/zh-Hant.ts index 8a147431d..ab6491e79 100644 --- a/web/src/i18n/locales/zh-Hant.ts +++ b/web/src/i18n/locales/zh-Hant.ts @@ -476,6 +476,7 @@ const zhHant = { noExtensionInstalled: '暫未安裝任何擴充功能', loadingExtensions: '正在載入擴充功能...', groupByType: '依格式分組', + groupByTypeShort: '分組', pluginSort: '外掛排序', pluginSortDescription: '外掛順序會影響同一事件內的處理順序,請拖曳外掛卡片排序',