feat(frontend): replace standalone search page with global command palette

Reworks search from a siloed /platform/knowledge-search page into a
universal ⌘K palette plus natural, in-context entry points.

Why the old page felt out of place:
- "Search" was an action pinned next to entity routes (knowledge base,
  agent, organization), mixing noun- and verb-level navigation items.
- Its two tabs (knowledge vs. chat messages) forced users to pick a
  mental model before they knew what they wanted.
- It was also the only way to search at all — no global shortcut, no
  context-aware entry.

What this replaces it with:
- A new ⌘K/Ctrl+K command palette (GlobalCommandPalette.vue) mounted
  once in views/platform/index.vue. Results are grouped by type
  (files, messages, knowledge bases, agents, chat titles, commands)
  so users never need to pre-filter. Debounced, identity-keyed
  selection survives async arrivals (slow KB results no longer yank
  the highlight off the user's current row). ⌘1-9 jump shortcuts are
  rendered inline on each row for discoverability.
- Sidebar gets a visible "Search" entry at the top — clicking it
  opens the palette (no route change), with a platform-aware kbd hint
  (⌘K on Mac, Ctrl K elsewhere).
- KB detail page: opening ⌘K there auto-scopes the search to the
  current KB via a removable chip (Backspace in empty input also
  clears it); no separate embedded search bar needed.
- The legacy route /platform/knowledge-search now redirects to the KB
  list with ?cmdk= set, so existing bookmarks still work.
- KnowledgeBase.vue now handles both route-query changes and a
  window event (weknora:open-knowledge) for intra-KB navigation,
  fixing the silent-no-op when the palette jumps to a chunk in the
  already-open KB.

Dropped:
- frontend/src/views/knowledge/KnowledgeSearch.vue (1163 lines).
- The exploratory SessionSearchBar mode-switching widget in the chat
  submenu; ⌘K covers its use cases without a two-mode UI.

i18n: zh-CN / en-US / ko-KR / ru-RU updated together — new
commandPalette.*, kb.*, and menu.search keys; obsolete session.search.*
and menu.knowledgeSearch removed.
This commit is contained in:
wizardchen
2026-05-06 16:20:50 +08:00
committed by lyingbug
parent 0be4572bd5
commit 2d3f32de5c
18 changed files with 2229 additions and 1197 deletions
+51 -1
View File
@@ -20,7 +20,7 @@ export default {
unpinFailed: 'Не удалось открепить, попробуйте позже',
confirmLogout: 'Вы уверены, что хотите выйти?',
systemInfo: 'Информация о системе',
knowledgeSearch: 'Поиск',
search: 'Поиск',
collapseSidebar: 'Свернуть боковую панель',
expandSidebar: 'Развернуть боковую панель',
logoutSuccess: 'Вы вышли из системы',
@@ -127,6 +127,11 @@ export default {
channelDingtalk: 'DingTalk',
channelSlack: 'Slack',
channelIm: 'IM канал',
channelNotion: 'Notion',
channelYuque: 'Yuque',
channelUpload: 'Загрузка',
channelManual: 'Вручную',
channelUrl: 'Веб',
channelUnknown: 'Неизвестно',
urlSource: 'Исходный URL',
documentTitle: 'Название документа',
@@ -227,6 +232,7 @@ export default {
columnTag: 'Тег',
columnSize: 'Размер',
columnType: 'Тип',
columnSource: 'Источник',
columnStatus: 'Статус',
columnUpdatedAt: 'Обновлено',
columnActions: 'Действия',
@@ -3041,6 +3047,50 @@ export default {
audioLoading: 'Загрузка аудио…',
audioNotSupported: 'Ваш браузер не поддерживает воспроизведение аудио',
},
commandPalette: {
placeholder: 'Поиск по базам знаний, файлам, диалогам…',
searching: 'Поиск…',
clearRecent: 'Очистить',
retrieval: 'Параметры поиска',
untitledSession: 'Безымянный диалог',
scope: {
placeholder: 'Поиск в этой базе знаний…',
remove: 'Убрать область (Backspace)',
},
group: {
chunks: 'Файлы базы знаний',
messages: 'Сообщения',
kbs: 'Базы знаний',
agents: 'Агенты',
sessionsByTitle: 'Диалоги (по названию)',
commands: 'Команды',
recent: 'Недавние',
quickActions: 'Быстрые действия',
},
match: {
vector: 'Вектор',
keyword: 'Ключ.',
},
quick: {
newChat: 'Новый диалог',
knowledgeBases: 'Открыть базы знаний',
agents: 'Открыть агенты',
organizations: 'Открыть общие пространства',
settings: 'Открыть настройки',
},
empty: {
noResults: 'Совпадений не найдено',
askAi: 'Спросить ИИ',
adjustRetrieval: 'Настроить поиск',
},
hotkey: {
select: 'Навигация',
enter: 'Открыть',
cmdNumber: 'Быстрый переход',
cmdEnter: 'Начать диалог',
esc: 'Закрыть',
},
},
knowledgeSearch: {
title: 'Поиск',
subtitle: 'Семантический поиск по базам знаний и истории сообщений для быстрого нахождения релевантного контента',