Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style: add knowledge base mansory layout [LOB-496] (#9722)

René Wang69f21da3e12c
diff --git a/locales/ar/common.json b/locales/ar/common.json
index 1ae60833e74..a1790c9f237 100644
--- a/locales/ar/common.json
+++ b/locales/ar/common.json
@@ -338,6 +338,7 @@
"chat": "الدردشة",
"discover": "اكتشاف",
"files": "ملفات",
+ "knowledgeBase": "قاعدة المعرفة",
"me": "أنا",
"setting": "الإعدادات"
},
diff --git a/locales/ar/components.json b/locales/ar/components.json
index 14ecd7139d3..b30a1273d8a 100644
--- a/locales/ar/components.json
+++ b/locales/ar/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "إجمالي {{count}} عنصر",
"selectedCount": "تم تحديد {{count}} عنصر"
+ },
+ "view": {
+ "list": "عرض القائمة",
+ "masonry": "عرض الشبكة"
}
},
"FileParsingStatus": {
diff --git a/locales/ar/file.json b/locales/ar/file.json
index b3342c44db8..795fafbee12 100644
--- a/locales/ar/file.json
+++ b/locales/ar/file.json
@@ -1,5 +1,5 @@
{
- "desc": "إدارة ملفاتك ومكتبتك المعرفية",
+ "desc": "إدارة معرفتك",
"detail": {
"basic": {
"createdAt": "تاريخ الإنشاء",
@@ -70,7 +70,7 @@
"videos": "الفيديوهات",
"websites": "المواقع"
},
- "title": "الملفات",
+ "title": "قاعدة المعرفة",
"toggleLeftPanel": {
"title": "عرض/إخفاء اللوحة الجانبية اليسرى"
},
diff --git a/locales/bg-BG/common.json b/locales/bg-BG/common.json
index 2de9c1448f7..3e3ce97c5db 100644
--- a/locales/bg-BG/common.json
+++ b/locales/bg-BG/common.json
@@ -338,6 +338,7 @@
"chat": "Чат",
"discover": "Открий",
"files": "Файлове",
+ "knowledgeBase": "База знания",
"me": "аз",
"setting": "Настройки"
},
diff --git a/locales/bg-BG/components.json b/locales/bg-BG/components.json
index 03fdea5ba95..4c0af01828b 100644
--- a/locales/bg-BG/components.json
+++ b/locales/bg-BG/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Общо {{count}} елемента",
"selectedCount": "Избрани {{count}} елемента"
+ },
+ "view": {
+ "list": "Изглед като списък",
+ "masonry": "Изглед като мрежа"
}
},
"FileParsingStatus": {
diff --git a/locales/bg-BG/file.json b/locales/bg-BG/file.json
index 1c48a8110bb..33291da79bd 100644
--- a/locales/bg-BG/file.json
+++ b/locales/bg-BG/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Управлявайте вашите файлове и база знания",
+ "desc": "Управлявайте своите знания",
"detail": {
"basic": {
"createdAt": "Дата на създаване",
@@ -70,7 +70,7 @@
"videos": "Видеа",
"websites": "Уебсайтове"
},
- "title": "Файлове",
+ "title": "База знания",
"toggleLeftPanel": {
"title": "Покажи/Скрий лявото панел"
},
diff --git a/locales/de-DE/common.json b/locales/de-DE/common.json
index e80e0a24677..be7eb6dcc01 100644
--- a/locales/de-DE/common.json
+++ b/locales/de-DE/common.json
@@ -338,6 +338,7 @@
"chat": "Chat",
"discover": "Entdecken",
"files": "Dateien",
+ "knowledgeBase": "Wissensdatenbank",
"me": "Ich",
"setting": "Einstellung"
},
diff --git a/locales/de-DE/components.json b/locales/de-DE/components.json
index d14ead8d0ae..b50cdfda18c 100644
--- a/locales/de-DE/components.json
+++ b/locales/de-DE/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Insgesamt {{count}} Elemente",
"selectedCount": "Ausgewählt {{count}} Elemente"
+ },
+ "view": {
+ "list": "Listenansicht",
+ "masonry": "Kachelansicht"
}
},
"FileParsingStatus": {
diff --git a/locales/de-DE/file.json b/locales/de-DE/file.json
index e91bf9c5a08..4285d5a5a1a 100644
--- a/locales/de-DE/file.json
+++ b/locales/de-DE/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Verwalten Sie Ihre Dateien und Wissensdatenbank",
+ "desc": "Verwalte dein Wissen",
"detail": {
"basic": {
"createdAt": "Erstellungszeit",
@@ -70,7 +70,7 @@
"videos": "Videos",
"websites": "Webseiten"
},
- "title": "Dateien",
+ "title": "Wissensdatenbank",
"toggleLeftPanel": {
"title": "Linkes Panel einblenden/ausblenden"
},
diff --git a/locales/en-US/common.json b/locales/en-US/common.json
index afc44a060d5..2ee8064f404 100644
--- a/locales/en-US/common.json
+++ b/locales/en-US/common.json
@@ -338,6 +338,7 @@
"chat": "Chat",
"discover": "Discover",
"files": "Files",
+ "knowledgeBase": "Knowledge Base",
"me": "Me",
"setting": "Settings"
},
diff --git a/locales/en-US/components.json b/locales/en-US/components.json
index af4481eec02..1c35ec27abb 100644
--- a/locales/en-US/components.json
+++ b/locales/en-US/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Total {{count}} items",
"selectedCount": "Selected {{count}} items"
+ },
+ "view": {
+ "list": "List View",
+ "masonry": "Grid View"
}
},
"FileParsingStatus": {
diff --git a/locales/en-US/file.json b/locales/en-US/file.json
index 46025ce88df..989509eba32 100644
--- a/locales/en-US/file.json
+++ b/locales/en-US/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Manage files and knowledge base",
+ "desc": "Manage your knowledge",
"detail": {
"basic": {
"createdAt": "Creation Time",
@@ -70,7 +70,7 @@
"videos": "Videos",
"websites": "Websites"
},
- "title": "Files",
+ "title": "Knowledge Base",
"toggleLeftPanel": {
"title": "Show/Hide Left Panel"
},
diff --git a/locales/es-ES/common.json b/locales/es-ES/common.json
index dc658b925ac..e9d1bbc7a97 100644
--- a/locales/es-ES/common.json
+++ b/locales/es-ES/common.json
@@ -338,6 +338,7 @@
"chat": "Chat",
"discover": "Descubrir",
"files": "Archivos",
+ "knowledgeBase": "Base de conocimientos",
"me": "Yo",
"setting": "Configuración"
},
diff --git a/locales/es-ES/components.json b/locales/es-ES/components.json
index ebed3081615..f679f77318c 100644
--- a/locales/es-ES/components.json
+++ b/locales/es-ES/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Total {{count}} elementos",
"selectedCount": "Seleccionados {{count}} elementos"
+ },
+ "view": {
+ "list": "Vista de lista",
+ "masonry": "Vista de cuadrícula"
}
},
"FileParsingStatus": {
diff --git a/locales/es-ES/file.json b/locales/es-ES/file.json
index d2bcd4595b9..ed829242c18 100644
--- a/locales/es-ES/file.json
+++ b/locales/es-ES/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Gestiona tus archivos y tu base de conocimientos",
+ "desc": "Gestiona tu conocimiento",
"detail": {
"basic": {
"createdAt": "Fecha de creación",
@@ -70,7 +70,7 @@
"videos": "Videos",
"websites": "Sitios web"
},
- "title": "Archivos",
+ "title": "Base de conocimientos",
"toggleLeftPanel": {
"title": "Mostrar/Ocultar panel izquierdo"
},
diff --git a/locales/fa-IR/common.json b/locales/fa-IR/common.json
index cf733b769ea..32b347d3707 100644
--- a/locales/fa-IR/common.json
+++ b/locales/fa-IR/common.json
@@ -338,6 +338,7 @@
"chat": "گفتگو",
"discover": "کشف",
"files": "فایل‌ها",
+ "knowledgeBase": "پایگاه دانش",
"me": "من",
"setting": "تنظیمات"
},
diff --git a/locales/fa-IR/components.json b/locales/fa-IR/components.json
index fb9507eb078..8c938b2f223 100644
--- a/locales/fa-IR/components.json
+++ b/locales/fa-IR/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "مجموعاً {{count}} مورد",
"selectedCount": "{{count}} مورد انتخاب شده"
+ },
+ "view": {
+ "list": "نمای فهرست",
+ "masonry": "نمای شبکه‌ای"
}
},
"FileParsingStatus": {
diff --git a/locales/fa-IR/file.json b/locales/fa-IR/file.json
index a7fde7e5ab0..852d5d52109 100644
--- a/locales/fa-IR/file.json
+++ b/locales/fa-IR/file.json
@@ -1,5 +1,5 @@
{
- "desc": "مدیریت فایل‌ها و مخزن دانش خود",
+ "desc": "مدیریت دانش شما",
"detail": {
"basic": {
"createdAt": "زمان ایجاد",
@@ -70,7 +70,7 @@
"videos": "ویدیوها",
"websites": "وب‌سایت‌ها"
},
- "title": "فایل",
+ "title": "پایگاه دانش",
"toggleLeftPanel": {
"title": "نمایش/پنهان کردن پانل سمت چپ"
},
diff --git a/locales/fr-FR/common.json b/locales/fr-FR/common.json
index 76f20d0e902..e60c42e7cbe 100644
--- a/locales/fr-FR/common.json
+++ b/locales/fr-FR/common.json
@@ -338,6 +338,7 @@
"chat": "Conversation",
"discover": "Découvrir",
"files": "Fichiers",
+ "knowledgeBase": "Base de connaissances",
"me": "moi",
"setting": "Paramètre"
},
diff --git a/locales/fr-FR/components.json b/locales/fr-FR/components.json
index f46bdd6ca84..e1895cb3366 100644
--- a/locales/fr-FR/components.json
+++ b/locales/fr-FR/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Total {{count}} éléments",
"selectedCount": "Sélectionné {{count}} éléments"
+ },
+ "view": {
+ "list": "Vue en liste",
+ "masonry": "Vue en grille"
}
},
"FileParsingStatus": {
diff --git a/locales/fr-FR/file.json b/locales/fr-FR/file.json
index 27517a2ccf5..6e9e5d3b089 100644
--- a/locales/fr-FR/file.json
+++ b/locales/fr-FR/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Gérez vos fichiers et votre base de connaissances",
+ "desc": "Gérez vos connaissances",
"detail": {
"basic": {
"createdAt": "Date de création",
@@ -70,7 +70,7 @@
"videos": "Vidéos",
"websites": "Sites web"
},
- "title": "Fichiers",
+ "title": "Base de connaissances",
"toggleLeftPanel": {
"title": "Afficher/Masquer le panneau de gauche"
},
diff --git a/locales/it-IT/common.json b/locales/it-IT/common.json
index 5957434d894..01d5947a8b5 100644
--- a/locales/it-IT/common.json
+++ b/locales/it-IT/common.json
@@ -338,6 +338,7 @@
"chat": "Chat",
"discover": "Scopri",
"files": "File",
+ "knowledgeBase": "Base di conoscenza",
"me": "io",
"setting": "Impostazioni"
},
diff --git a/locales/it-IT/components.json b/locales/it-IT/components.json
index bf3a08d5490..66681245995 100644
--- a/locales/it-IT/components.json
+++ b/locales/it-IT/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Totale {{count}} elementi",
"selectedCount": "Selezionati {{count}} elementi"
+ },
+ "view": {
+ "list": "Vista elenco",
+ "masonry": "Vista griglia"
}
},
"FileParsingStatus": {
diff --git a/locales/it-IT/file.json b/locales/it-IT/file.json
index c89805c2440..a6dc3dad206 100644
--- a/locales/it-IT/file.json
+++ b/locales/it-IT/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Gestisci i tuoi file e il tuo knowledge base",
+ "desc": "Gestisci le tue conoscenze",
"detail": {
"basic": {
"createdAt": "Data di creazione",
@@ -70,7 +70,7 @@
"videos": "Video",
"websites": "Siti web"
},
- "title": "File",
+ "title": "Archivio di Conoscenza",
"toggleLeftPanel": {
"title": "Mostra/Nascondi il pannello sinistro"
},
diff --git a/locales/ja-JP/common.json b/locales/ja-JP/common.json
index 3d16ac3067d..8428af48f3f 100644
--- a/locales/ja-JP/common.json
+++ b/locales/ja-JP/common.json
@@ -338,6 +338,7 @@
"chat": "チャット",
"discover": "発見",
"files": "ファイル",
+ "knowledgeBase": "ナレッジベース",
"me": "私",
"setting": "設定"
},
diff --git a/locales/ja-JP/components.json b/locales/ja-JP/components.json
index 7ca69e1c880..9882aa84249 100644
--- a/locales/ja-JP/components.json
+++ b/locales/ja-JP/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "合計 {{count}} 件",
"selectedCount": "選択済み {{count}} 件"
+ },
+ "view": {
+ "list": "リスト表示",
+ "masonry": "グリッド表示"
}
},
"FileParsingStatus": {
diff --git a/locales/ja-JP/file.json b/locales/ja-JP/file.json
index 2099d862efd..6c81608ab54 100644
--- a/locales/ja-JP/file.json
+++ b/locales/ja-JP/file.json
@@ -1,5 +1,5 @@
{
- "desc": "ファイルと知識ベースを管理する",
+ "desc": "あなたの知識を管理する",
"detail": {
"basic": {
"createdAt": "作成日時",
@@ -70,7 +70,7 @@
"videos": "動画",
"websites": "ウェブサイト"
},
- "title": "ファイル",
+ "title": "ナレッジベース",
"toggleLeftPanel": {
"title": "左側パネルの表示/非表示"
},
diff --git a/locales/ko-KR/common.json b/locales/ko-KR/common.json
index 4b01d8d4345..2dfcbe3c16b 100644
--- a/locales/ko-KR/common.json
+++ b/locales/ko-KR/common.json
@@ -338,6 +338,7 @@
"chat": "채팅",
"discover": "탐색",
"files": "파일",
+ "knowledgeBase": "지식 베이스",
"me": "내 정보",
"setting": "설정"
},
diff --git a/locales/ko-KR/components.json b/locales/ko-KR/components.json
index 437b37d3f08..a27b6a991ea 100644
--- a/locales/ko-KR/components.json
+++ b/locales/ko-KR/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "총 {{count}}개 항목",
"selectedCount": "{{count}}개 선택됨"
+ },
+ "view": {
+ "list": "목록 보기",
+ "masonry": "그리드 보기"
}
},
"FileParsingStatus": {
diff --git a/locales/ko-KR/file.json b/locales/ko-KR/file.json
index 280d2905dff..046f1fd2296 100644
--- a/locales/ko-KR/file.json
+++ b/locales/ko-KR/file.json
@@ -1,5 +1,5 @@
{
- "desc": "파일과 지식베이스를 관리하세요",
+ "desc": "지식을 관리하세요",
"detail": {
"basic": {
"createdAt": "생성 시간",
@@ -70,7 +70,7 @@
"videos": "비디오",
"websites": "웹사이트"
},
- "title": "파일",
+ "title": "지식 베이스",
"toggleLeftPanel": {
"title": "왼쪽 패널 표시/숨기기"
},
diff --git a/locales/nl-NL/common.json b/locales/nl-NL/common.json
index 56d01fd4169..c24aa1d17c7 100644
--- a/locales/nl-NL/common.json
+++ b/locales/nl-NL/common.json
@@ -338,6 +338,7 @@
"chat": "Chat",
"discover": "Ontdekken",
"files": "Bestanden",
+ "knowledgeBase": "Kennisbank",
"me": "Ik",
"setting": "Instellingen"
},
diff --git a/locales/nl-NL/components.json b/locales/nl-NL/components.json
index 5c21c6e4a4e..ffe319cfeb6 100644
--- a/locales/nl-NL/components.json
+++ b/locales/nl-NL/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Totaal {{count}} items",
"selectedCount": "Geselecteerd {{count}} items"
+ },
+ "view": {
+ "list": "Lijstweergave",
+ "masonry": "Rasterweergave"
}
},
"FileParsingStatus": {
diff --git a/locales/nl-NL/file.json b/locales/nl-NL/file.json
index df5faae64ee..389b3622451 100644
--- a/locales/nl-NL/file.json
+++ b/locales/nl-NL/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Beheer je bestanden en kennisbank",
+ "desc": "Beheer je kennis",
"detail": {
"basic": {
"createdAt": "Aanmaakdatum",
@@ -70,7 +70,7 @@
"videos": "Video's",
"websites": "Websites"
},
- "title": "Bestanden",
+ "title": "Kennisbank",
"toggleLeftPanel": {
"title": "Toon/Verberg het linkerpaneel"
},
diff --git a/locales/pl-PL/common.json b/locales/pl-PL/common.json
index 32e97e4c240..cc76190f8e0 100644
--- a/locales/pl-PL/common.json
+++ b/locales/pl-PL/common.json
@@ -338,6 +338,7 @@
"chat": "Czat",
"discover": "Odkryj",
"files": "Pliki",
+ "knowledgeBase": "Baza wiedzy",
"me": "ja",
"setting": "Ustawienia"
},
diff --git a/locales/pl-PL/components.json b/locales/pl-PL/components.json
index 1698ed54a19..ed969449e83 100644
--- a/locales/pl-PL/components.json
+++ b/locales/pl-PL/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Łącznie {{count}} pozycji",
"selectedCount": "Wybrano {{count}} pozycji"
+ },
+ "view": {
+ "list": "Widok listy",
+ "masonry": "Widok siatki"
}
},
"FileParsingStatus": {
diff --git a/locales/pl-PL/file.json b/locales/pl-PL/file.json
index a8329171e49..0ef9bb8d6a7 100644
--- a/locales/pl-PL/file.json
+++ b/locales/pl-PL/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Zarządzaj swoimi plikami i bazą wiedzy",
+ "desc": "Zarządzaj swoją wiedzą",
"detail": {
"basic": {
"createdAt": "Data utworzenia",
@@ -70,7 +70,7 @@
"videos": "Wideo",
"websites": "Strony internetowe"
},
- "title": "Pliki",
+ "title": "Baza wiedzy",
"toggleLeftPanel": {
"title": "Pokaż/ukryj panel po lewej stronie"
},
diff --git a/locales/pt-BR/common.json b/locales/pt-BR/common.json
index e635250e2c8..5a9df266e78 100644
--- a/locales/pt-BR/common.json
+++ b/locales/pt-BR/common.json
@@ -338,6 +338,7 @@
"chat": "Chat",
"discover": "Descobrir",
"files": "Arquivos",
+ "knowledgeBase": "Base de Conhecimento",
"me": "eu",
"setting": "Configuração"
},
diff --git a/locales/pt-BR/components.json b/locales/pt-BR/components.json
index aa8fcefb771..f0308798c4f 100644
--- a/locales/pt-BR/components.json
+++ b/locales/pt-BR/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Total de {{count}} itens",
"selectedCount": "Selecionados {{count}} itens"
+ },
+ "view": {
+ "list": "Visualização em lista",
+ "masonry": "Visualização em grade"
}
},
"FileParsingStatus": {
diff --git a/locales/pt-BR/file.json b/locales/pt-BR/file.json
index b7c1b5c7ab6..334e43c6e02 100644
--- a/locales/pt-BR/file.json
+++ b/locales/pt-BR/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Gerencie seus arquivos e repositórios de conhecimento",
+ "desc": "Gerencie seu conhecimento",
"detail": {
"basic": {
"createdAt": "Data de criação",
@@ -70,7 +70,7 @@
"videos": "Vídeos",
"websites": "Sites"
},
- "title": "Arquivos",
+ "title": "Base de Conhecimento",
"toggleLeftPanel": {
"title": "Mostrar/Ocultar painel esquerdo"
},
diff --git a/locales/ru-RU/common.json b/locales/ru-RU/common.json
index c05a64df7cf..99e824857fb 100644
--- a/locales/ru-RU/common.json
+++ b/locales/ru-RU/common.json
@@ -338,6 +338,7 @@
"chat": "Чат",
"discover": "Открыть",
"files": "Файлы",
+ "knowledgeBase": "База знаний",
"me": "я",
"setting": "Настройки"
},
diff --git a/locales/ru-RU/components.json b/locales/ru-RU/components.json
index df9527196d4..ae1797337d7 100644
--- a/locales/ru-RU/components.json
+++ b/locales/ru-RU/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Всего {{count}} элементов",
"selectedCount": "Выбрано {{count}} элементов"
+ },
+ "view": {
+ "list": "Список",
+ "masonry": "Сетка"
}
},
"FileParsingStatus": {
diff --git a/locales/ru-RU/file.json b/locales/ru-RU/file.json
index 9c7b8ee101a..4f62a71dc74 100644
--- a/locales/ru-RU/file.json
+++ b/locales/ru-RU/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Управляйте своими файлами и базой знаний",
+ "desc": "Управляйте своими знаниями",
"detail": {
"basic": {
"createdAt": "Дата создания",
@@ -70,7 +70,7 @@
"videos": "Видео",
"websites": "Веб-сайты"
},
- "title": "Файлы",
+ "title": "База знаний",
"toggleLeftPanel": {
"title": "Показать/Скрыть левую панель"
},
diff --git a/locales/tr-TR/common.json b/locales/tr-TR/common.json
index da75300a4d5..a9e3c038ec5 100644
--- a/locales/tr-TR/common.json
+++ b/locales/tr-TR/common.json
@@ -338,6 +338,7 @@
"chat": "Chat",
"discover": "Keşfet",
"files": "Dosyalar",
+ "knowledgeBase": "Bilgi Tabanı",
"me": "ben",
"setting": "Ayarlar"
},
diff --git a/locales/tr-TR/components.json b/locales/tr-TR/components.json
index aa84ab631a5..e1810e3fbd9 100644
--- a/locales/tr-TR/components.json
+++ b/locales/tr-TR/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Toplam {{count}} öğe",
"selectedCount": "Seçilen {{count}} öğe"
+ },
+ "view": {
+ "list": "Liste Görünümü",
+ "masonry": "Karo Görünümü"
}
},
"FileParsingStatus": {
diff --git a/locales/tr-TR/file.json b/locales/tr-TR/file.json
index 4b16fb6c9d7..229d84f03cc 100644
--- a/locales/tr-TR/file.json
+++ b/locales/tr-TR/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Dosyalarınızı ve bilgi tabanınızı yönetin",
+ "desc": "Bilgini yönet",
"detail": {
"basic": {
"createdAt": "Oluşturulma Zamanı",
@@ -70,7 +70,7 @@
"videos": "Videolar",
"websites": "Web Siteleri"
},
- "title": "Dosya",
+ "title": "Bilgi Bankası",
"toggleLeftPanel": {
"title": "Sol Panelini Göster/Gizle"
},
diff --git a/locales/vi-VN/common.json b/locales/vi-VN/common.json
index 97370cc4a7a..78b4b582e1a 100644
--- a/locales/vi-VN/common.json
+++ b/locales/vi-VN/common.json
@@ -338,6 +338,7 @@
"chat": "Trò chuyện",
"discover": "Khám phá",
"files": "Tệp",
+ "knowledgeBase": "Cơ sở tri thức",
"me": "Tôi",
"setting": "Cài đặt"
},
diff --git a/locales/vi-VN/components.json b/locales/vi-VN/components.json
index e6a06826f5c..f65218b308a 100644
--- a/locales/vi-VN/components.json
+++ b/locales/vi-VN/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "Tổng cộng {{count}} mục",
"selectedCount": "Đã chọn {{count}} mục"
+ },
+ "view": {
+ "list": "Chế độ danh sách",
+ "masonry": "Chế độ lưới"
}
},
"FileParsingStatus": {
diff --git a/locales/vi-VN/file.json b/locales/vi-VN/file.json
index 9280aa98c77..c552bd9560b 100644
--- a/locales/vi-VN/file.json
+++ b/locales/vi-VN/file.json
@@ -1,5 +1,5 @@
{
- "desc": "Quản lý tệp và kho tri thức của bạn",
+ "desc": "Quản lý kiến thức của bạn",
"detail": {
"basic": {
"createdAt": "Thời gian tạo",
@@ -70,7 +70,7 @@
"videos": "Video",
"websites": "Trang web"
},
- "title": "Tệp",
+ "title": "Kho kiến thức",
"toggleLeftPanel": {
"title": "Hiện/Ẩn bảng bên trái"
},
diff --git a/locales/zh-CN/common.json b/locales/zh-CN/common.json
index 7ad7f228f16..cf7b2fe2abb 100644
--- a/locales/zh-CN/common.json
+++ b/locales/zh-CN/common.json
@@ -338,6 +338,7 @@
"chat": "会话",
"discover": "发现",
"files": "文件",
+ "knowledgeBase": "知识库",
"me": "我",
"setting": "设置"
},
diff --git a/locales/zh-CN/components.json b/locales/zh-CN/components.json
index d1a16f65de0..6ce923941dc 100644
--- a/locales/zh-CN/components.json
+++ b/locales/zh-CN/components.json
@@ -33,6 +33,10 @@
"config": {
"showFilesInKnowledgeBase": "显示知识库中内容"
},
+ "view": {
+ "list": "列表视图",
+ "masonry": "网格视图"
+ },
"emptyStatus": {
"actions": {
"file": "上传文件",
diff --git a/locales/zh-CN/file.json b/locales/zh-CN/file.json
index 96b72227b75..20ed5608049 100644
--- a/locales/zh-CN/file.json
+++ b/locales/zh-CN/file.json
@@ -1,5 +1,5 @@
{
- "desc": "管理你的文件与知识库",
+ "desc": "管理你的知识",
"detail": {
"basic": {
"createdAt": "创建时间",
@@ -70,7 +70,7 @@
"videos": "视频",
"websites": "网页"
},
- "title": "文件",
+ "title": "知识库",
"toggleLeftPanel": {
"title": "显示/隐藏左侧面板"
},
diff --git a/locales/zh-TW/common.json b/locales/zh-TW/common.json
index e3e23701c5e..c3b459877e0 100644
--- a/locales/zh-TW/common.json
+++ b/locales/zh-TW/common.json
@@ -338,6 +338,7 @@
"chat": "對話",
"discover": "發現",
"files": "檔案",
+ "knowledgeBase": "知識庫",
"me": "我",
"setting": "設定"
},
diff --git a/locales/zh-TW/components.json b/locales/zh-TW/components.json
index f7ce99d2d52..849eed80fe9 100644
--- a/locales/zh-TW/components.json
+++ b/locales/zh-TW/components.json
@@ -50,6 +50,10 @@
"total": {
"fileCount": "共 {{count}} 項",
"selectedCount": "已選 {{count}} 項"
+ },
+ "view": {
+ "list": "清單檢視",
+ "masonry": "網格檢視"
}
},
"FileParsingStatus": {
diff --git a/locales/zh-TW/file.json b/locales/zh-TW/file.json
index 9980353ba85..5f02cbfe658 100644
--- a/locales/zh-TW/file.json
+++ b/locales/zh-TW/file.json
@@ -1,5 +1,5 @@
{
- "desc": "管理你的文件與知識庫",
+ "desc": "管理你的知識",
"detail": {
"basic": {
"createdAt": "創建時間",
@@ -70,7 +70,7 @@
"videos": "視頻",
"websites": "網頁"
},
- "title": "檔案",
+ "title": "知識庫",
"toggleLeftPanel": {
"title": "顯示/隱藏左側面板"
},
diff --git a/package.json b/package.json
index a970b99eda5..2a1b4e0f82f 100644
--- a/package.json
+++ b/package.json
@@ -188,6 +188,7 @@
"@vercel/edge-config": "^1.4.0",
"@vercel/functions": "^3.1.3",
"@vercel/speed-insights": "^1.2.0",
+ "@virtuoso.dev/masonry": "^1.3.5",
"@xterm/xterm": "^5.5.0",
"ahooks": "^3.9.5",
"antd": "^5.27.4",
diff --git a/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx b/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx
index d8754195104..081bd2dd871 100644
--- a/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx
+++ b/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx
@@ -24,6 +24,7 @@ export interface TopActionProps {
tab?: SidebarTabKey;
}
+// TODO Change icons
const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
const { t } = useTranslation('common');
const switchBackToChat = useGlobalStore((s) => s.switchBackToChat);
@@ -66,12 +67,12 @@ const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
/>
</Link>
{enableKnowledgeBase && (
- <Link aria-label={t('tab.files')} href={'/files'}>
+ <Link aria-label={t('tab.knowledgeBase')} href={'/files'}>
<ActionIcon
active={isFilesActive}
icon={FolderClosed}
size={ICON_SIZE}
- title={t('tab.files')}
+ title={t('tab.knowledgeBase')}
tooltipProps={{ placement: 'right' }}
/>
</Link>
diff --git a/src/app/[variants]/(main)/files/(content)/@menu/features/KnowledgeBase/Item/index.tsx b/src/app/[variants]/(main)/files/(content)/@menu/features/KnowledgeBase/Item/index.tsx
index 43b02ea10ba..fb4c042f6e8 100644
--- a/src/app/[variants]/(main)/files/(content)/@menu/features/KnowledgeBase/Item/index.tsx
+++ b/src/app/[variants]/(main)/files/(content)/@menu/features/KnowledgeBase/Item/index.tsx
@@ -1,8 +1,10 @@
import { createStyles } from 'antd-style';
import Link from 'next/link';
-import { memo, useState } from 'react';
+import React, { memo, useState } from 'react';
import { Flexbox } from 'react-layout-kit';
+import { useQueryRoute } from '@/hooks/useQueryRoute';
+
import Content, { knowledgeItemClass } from './Content';
const useStyles = createStyles(({ css, token, isDarkMode }) => ({
@@ -44,9 +46,15 @@ export interface KnowledgeBaseItemProps {
const KnowledgeBaseItem = memo<KnowledgeBaseItemProps>(({ name, active, id }) => {
const { styles, cx } = useStyles();
const [isHover, setHovering] = useState(false);
+ const router = useQueryRoute();
+
+ const handleClick = (e: React.MouseEvent) => {
+ e.preventDefault();
+ router.push(`/repos/${id}`);
+ };
return (
- <Link href={`/repos/${id}`}>
+ <Link href={`/repos/${id}`} onClick={handleClick}>
<Flexbox
align={'center'}
className={cx(styles.container, knowledgeItemClass, active && styles.active)}
diff --git a/src/features/FileManager/FileList/MasonryFileItem/MasonryItemWrapper.tsx b/src/features/FileManager/FileList/MasonryFileItem/MasonryItemWrapper.tsx
new file mode 100644
index 00000000000..b6a1882a7fc
--- /dev/null
+++ b/src/features/FileManager/FileList/MasonryFileItem/MasonryItemWrapper.tsx
@@ -0,0 +1,44 @@
+import { memo } from 'react';
+
+import { FileListItem } from '@/types/files';
+
+import MasonryFileItem from '.';
+
+interface MasonryItemWrapperProps {
+ context: {
+ knowledgeBaseId?: string;
+ selectFileIds: string[];
+ setSelectedFileIds: (updater: (prev: string[]) => string[]) => void;
+ };
+ data: FileListItem;
+ index: number;
+}
+
+const MasonryItemWrapper = memo<MasonryItemWrapperProps>(({ data: item, context }) => {
+ // Safety check: return null if item is undefined (can happen during deletion)
+ if (!item || !item.id) {
+ return null;
+ }
+
+ return (
+ <div style={{ padding: '8px' }}>
+ <MasonryFileItem
+ knowledgeBaseId={context.knowledgeBaseId}
+ onSelectedChange={(id, checked) => {
+ context.setSelectedFileIds((prev: string[]) => {
+ if (checked) {
+ return [...prev, id];
+ }
+ return prev.filter((item) => item !== id);
+ });
+ }}
+ selected={context.selectFileIds.includes(item.id)}
+ {...item}
+ />
+ </div>
+ );
+});
+
+MasonryItemWrapper.displayName = 'MasonryItemWrapper';
+
+export default MasonryItemWrapper;
diff --git a/src/features/FileManager/FileList/MasonryFileItem/index.tsx b/src/features/FileManager/FileList/MasonryFileItem/index.tsx
new file mode 100644
index 00000000000..0c5bda28fcc
--- /dev/null
+++ b/src/features/FileManager/FileList/MasonryFileItem/index.tsx
@@ -0,0 +1,553 @@
+import { Button, Tooltip } from '@lobehub/ui';
+import { Checkbox, Image } from 'antd';
+import { createStyles } from 'antd-style';
+import { isNull } from 'lodash-es';
+import { FileBoxIcon } from 'lucide-react';
+import { useRouter } from 'next/navigation';
+import { memo, useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Flexbox } from 'react-layout-kit';
+
+import FileIcon from '@/components/FileIcon';
+import { fileManagerSelectors, useFileStore } from '@/store/file';
+import { FileListItem } from '@/types/files';
+import { formatSize } from '@/utils/format';
+import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported';
+
+import ChunksBadge from '../FileListItem/ChunkTag';
+import DropdownMenu from '../FileListItem/DropdownMenu';
+
+// Image file types
+const IMAGE_TYPES = new Set([
+ 'image/png',
+ 'image/jpeg',
+ 'image/jpg',
+ 'image/gif',
+ 'image/webp',
+ 'image/svg+xml',
+]);
+
+// Markdown file types
+const MARKDOWN_TYPES = new Set(['text/markdown', 'text/x-markdown']);
+
+// Helper to check if filename ends with .md
+const isMarkdownFile = (name: string, fileType?: string) => {
+ return (
+ name.toLowerCase().endsWith('.md') ||
+ name.toLowerCase().endsWith('.markdown') ||
+ (fileType && MARKDOWN_TYPES.has(fileType))
+ );
+};
+
+const useStyles = createStyles(({ css, token }) => ({
+ actions: css`
+ opacity: 0;
+ transition: opacity ${token.motionDurationMid};
+ `,
+ card: css`
+ cursor: pointer;
+
+ position: relative;
+
+ overflow: visible;
+
+ border: 1px solid ${token.colorBorderSecondary};
+ border-radius: ${token.borderRadiusLG}px;
+
+ background: ${token.colorBgContainer};
+
+ transition: all ${token.motionDurationMid};
+
+ &:hover {
+ border-color: ${token.colorPrimary};
+ box-shadow: ${token.boxShadowTertiary};
+
+ .actions {
+ opacity: 1;
+ }
+
+ .checkbox {
+ opacity: 1;
+ }
+
+ .dropdown {
+ opacity: 1;
+ }
+
+ .floatingChunkBadge {
+ opacity: 1;
+ }
+ }
+ `,
+ checkbox: css`
+ position: absolute;
+ z-index: 2;
+ inset-block-start: 8px;
+ inset-inline-start: 8px;
+
+ opacity: 0;
+
+ transition: opacity ${token.motionDurationMid};
+ `,
+ content: css`
+ position: relative;
+ `,
+ contentWithPadding: css`
+ padding: 12px;
+ `,
+ dropdown: css`
+ position: absolute;
+ z-index: 2;
+ inset-block-start: 8px;
+ inset-inline-end: 8px;
+
+ opacity: 0;
+
+ transition: opacity ${token.motionDurationMid};
+ `,
+ floatingChunkBadge: css`
+ position: absolute;
+ z-index: 3;
+ inset-block-end: 8px;
+ inset-inline-end: 8px;
+
+ padding-block: 4px;
+ padding-inline: 8px;
+ border-radius: ${token.borderRadius}px;
+
+ opacity: 0;
+ background: ${token.colorBgContainer};
+ box-shadow: ${token.boxShadow};
+
+ transition: opacity ${token.motionDurationMid};
+ `,
+ hoverOverlay: css`
+ position: absolute;
+ z-index: 1;
+ inset: 0;
+
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+
+ padding: 16px;
+ border-radius: ${token.borderRadiusLG}px;
+
+ opacity: 0;
+ background: ${token.colorBgMask};
+
+ transition: opacity ${token.motionDurationMid};
+
+ &:hover {
+ opacity: 1;
+ }
+ `,
+ iconWrapper: css`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ height: 120px;
+ margin-block-end: 12px;
+ border-radius: ${token.borderRadius}px;
+
+ background: ${token.colorFillQuaternary};
+ `,
+ imagePlaceholder: css`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ min-height: 120px;
+
+ background: ${token.colorFillQuaternary};
+ `,
+ imageWrapper: css`
+ position: relative;
+
+ overflow: hidden;
+
+ width: 100%;
+ border-radius: ${token.borderRadiusLG}px;
+
+ background: ${token.colorFillQuaternary};
+
+ img {
+ display: block;
+ width: 100%;
+ height: auto;
+ }
+ `,
+ markdownLoading: css`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ min-height: 120px;
+ border-radius: ${token.borderRadiusLG}px;
+
+ font-size: 12px;
+ color: ${token.colorTextTertiary};
+
+ background: ${token.colorFillQuaternary};
+ `,
+ markdownPreview: css`
+ position: relative;
+
+ overflow: hidden;
+
+ width: 100%;
+ min-height: 120px;
+ max-height: 300px;
+ padding: 16px;
+ border-radius: ${token.borderRadiusLG}px;
+
+ font-size: 13px;
+ line-height: 1.6;
+ color: ${token.colorTextSecondary};
+ word-wrap: break-word;
+ white-space: pre-wrap;
+
+ background: ${token.colorFillQuaternary};
+
+ &::after {
+ pointer-events: none;
+ content: '';
+
+ position: absolute;
+ inset-block-end: 0;
+ inset-inline: 0;
+
+ height: 60px;
+
+ background: linear-gradient(to bottom, transparent, ${token.colorFillQuaternary});
+ }
+ `,
+ name: css`
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+
+ margin-block-end: 12px;
+
+ font-weight: ${token.fontWeightStrong};
+ color: ${token.colorText};
+ word-break: break-word;
+ `,
+ overlaySize: css`
+ font-size: 12px;
+ color: ${token.colorTextLightSolid};
+ opacity: 0.9;
+ `,
+ overlayTitle: css`
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 3;
+
+ max-width: 100%;
+ margin-block-end: 8px;
+
+ font-size: 14px;
+ font-weight: ${token.fontWeightStrong};
+ color: ${token.colorTextLightSolid};
+ text-align: center;
+ word-break: break-word;
+ `,
+ selected: css`
+ border-color: ${token.colorPrimary};
+ background: ${token.colorPrimaryBg};
+
+ .checkbox {
+ opacity: 1;
+ }
+ `,
+}));
+
+interface MasonryFileItemProps extends FileListItem {
+ knowledgeBaseId?: string;
+ onSelectedChange: (id: string, selected: boolean) => void;
+ selected?: boolean;
+}
+
+const MasonryFileItem = memo<MasonryFileItemProps>(
+ ({
+ chunkingError,
+ embeddingError,
+ embeddingStatus,
+ finishEmbedding,
+ chunkCount,
+ url,
+ name,
+ fileType,
+ id,
+ selected,
+ chunkingStatus,
+ onSelectedChange,
+ knowledgeBaseId,
+ size,
+ }) => {
+ const { t } = useTranslation('components');
+ const { styles, cx } = useStyles();
+ const router = useRouter();
+ const [imageLoaded, setImageLoaded] = useState(false);
+ const [markdownContent, setMarkdownContent] = useState<string>('');
+ const [isLoadingMarkdown, setIsLoadingMarkdown] = useState(false);
+ const [isCreatingFileParseTask, parseFiles] = useFileStore((s) => [
+ fileManagerSelectors.isCreatingFileParseTask(id)(s),
+ s.parseFilesToChunks,
+ ]);
+
+ const isSupportedForChunking = !isChunkingUnsupported(fileType);
+ const isImage = fileType && IMAGE_TYPES.has(fileType);
+ const isMarkdown = isMarkdownFile(name, fileType);
+
+ // Fetch markdown content
+ useEffect(() => {
+ if (isMarkdown && url) {
+ setIsLoadingMarkdown(true);
+ fetch(url)
+ .then((res) => res.text())
+ .then((text) => {
+ // Take first 500 characters for preview
+ const preview = text.slice(0, 500);
+ setMarkdownContent(preview);
+ })
+ .catch((error) => {
+ console.error('Failed to fetch markdown content:', error);
+ setMarkdownContent('');
+ })
+ .finally(() => {
+ setIsLoadingMarkdown(false);
+ });
+ }
+ }, [isMarkdown, url]);
+
+ return (
+ <div className={cx(styles.card, selected && styles.selected)}>
+ <div
+ className={cx('checkbox', styles.checkbox)}
+ onClick={(e) => {
+ e.stopPropagation();
+ onSelectedChange(id, !selected);
+ }}
+ >
+ <Checkbox checked={selected} />
+ </div>
+
+ <div className={cx('dropdown', styles.dropdown)} onClick={(e) => e.stopPropagation()}>
+ <DropdownMenu filename={name} id={id} knowledgeBaseId={knowledgeBaseId} url={url} />
+ </div>
+
+ <div
+ className={cx(styles.content, !isImage && !isMarkdown && styles.contentWithPadding)}
+ onClick={() => {
+ router.push(`/files/${id}`);
+ }}
+ >
+ {isImage && url ? (
+ <>
+ <div className={styles.imageWrapper}>
+ {!imageLoaded && (
+ <div className={styles.imagePlaceholder}>
+ <FileIcon fileName={name} fileType={fileType} size={64} />
+ </div>
+ )}
+ <Image
+ alt={name}
+ onError={() => setImageLoaded(false)}
+ onLoad={() => setImageLoaded(true)}
+ preview={{
+ src: url,
+ }}
+ src={url}
+ style={{
+ display: 'block',
+ height: 'auto',
+ opacity: imageLoaded ? 1 : 0,
+ transition: 'opacity 0.3s',
+ width: '100%',
+ }}
+ wrapperStyle={{
+ display: 'block',
+ width: '100%',
+ }}
+ />
+ {/* Hover overlay */}
+ <div className={styles.hoverOverlay}>
+ <div className={styles.overlayTitle}>{name}</div>
+ <div className={styles.overlaySize}>{formatSize(size)}</div>
+ </div>
+ </div>
+ {/* Floating chunk badge or action button */}
+ {!isNull(chunkingStatus) && chunkingStatus ? (
+ <div
+ className={cx('floatingChunkBadge', styles.floatingChunkBadge)}
+ onClick={(e) => e.stopPropagation()}
+ >
+ <ChunksBadge
+ chunkCount={chunkCount}
+ chunkingError={chunkingError}
+ chunkingStatus={chunkingStatus}
+ embeddingError={embeddingError}
+ embeddingStatus={embeddingStatus}
+ finishEmbedding={finishEmbedding}
+ id={id}
+ />
+ </div>
+ ) : (
+ isSupportedForChunking && (
+ <Tooltip title={t('FileManager.actions.chunkingTooltip')}>
+ <div
+ className={cx('floatingChunkBadge', styles.floatingChunkBadge)}
+ onClick={(e) => {
+ e.stopPropagation();
+ if (!isCreatingFileParseTask) {
+ parseFiles([id]);
+ }
+ }}
+ style={{ cursor: 'pointer' }}
+ >
+ <Button
+ icon={FileBoxIcon}
+ loading={isCreatingFileParseTask}
+ size={'small'}
+ type={'text'}
+ />
+ </div>
+ </Tooltip>
+ )
+ )}
+ </>
+ ) : isMarkdown ? (
+ <>
+ <div style={{ position: 'relative' }}>
+ {isLoadingMarkdown ? (
+ <div className={styles.markdownLoading}>Loading preview...</div>
+ ) : markdownContent ? (
+ <div className={styles.markdownPreview}>{markdownContent}</div>
+ ) : (
+ <div className={styles.iconWrapper}>
+ <FileIcon fileName={name} fileType={fileType} size={64} />
+ </div>
+ )}
+ {/* Hover overlay */}
+ <div className={styles.hoverOverlay}>
+ <div className={styles.overlayTitle}>{name}</div>
+ <div className={styles.overlaySize}>{formatSize(size)}</div>
+ </div>
+ </div>
+ {/* Floating chunk badge or action button */}
+ {!isNull(chunkingStatus) && chunkingStatus ? (
+ <div
+ className={cx('floatingChunkBadge', styles.floatingChunkBadge)}
+ onClick={(e) => e.stopPropagation()}
+ >
+ <ChunksBadge
+ chunkCount={chunkCount}
+ chunkingError={chunkingError}
+ chunkingStatus={chunkingStatus}
+ embeddingError={embeddingError}
+ embeddingStatus={embeddingStatus}
+ finishEmbedding={finishEmbedding}
+ id={id}
+ />
+ </div>
+ ) : (
+ isSupportedForChunking && (
+ <Tooltip title={t('FileManager.actions.chunkingTooltip')}>
+ <div
+ className={cx('floatingChunkBadge', styles.floatingChunkBadge)}
+ onClick={(e) => {
+ e.stopPropagation();
+ if (!isCreatingFileParseTask) {
+ parseFiles([id]);
+ }
+ }}
+ style={{ cursor: 'pointer' }}
+ >
+ <Button
+ icon={FileBoxIcon}
+ loading={isCreatingFileParseTask}
+ size={'small'}
+ type={'text'}
+ />
+ </div>
+ </Tooltip>
+ )
+ )}
+ </>
+ ) : (
+ <>
+ <Flexbox
+ align={'center'}
+ gap={12}
+ justify={'center'}
+ paddingBlock={24}
+ paddingInline={12}
+ style={{ minHeight: 180 }}
+ >
+ <FileIcon fileName={name} fileType={fileType} size={64} />
+ <div className={styles.name} style={{ textAlign: 'center' }}>
+ {name}
+ </div>
+ <div
+ style={{
+ color: 'var(--lobe-chat-text-tertiary)',
+ fontSize: 12,
+ textAlign: 'center',
+ }}
+ >
+ {formatSize(size)}
+ </div>
+ </Flexbox>
+ {/* Floating chunk badge or action button */}
+ {!isNull(chunkingStatus) && chunkingStatus ? (
+ <div
+ className={cx('floatingChunkBadge', styles.floatingChunkBadge)}
+ onClick={(e) => e.stopPropagation()}
+ >
+ <ChunksBadge
+ chunkCount={chunkCount}
+ chunkingError={chunkingError}
+ chunkingStatus={chunkingStatus}
+ embeddingError={embeddingError}
+ embeddingStatus={embeddingStatus}
+ finishEmbedding={finishEmbedding}
+ id={id}
+ />
+ </div>
+ ) : (
+ isSupportedForChunking && (
+ <Tooltip title={t('FileManager.actions.chunkingTooltip')}>
+ <div
+ className={cx('floatingChunkBadge', styles.floatingChunkBadge)}
+ onClick={(e) => {
+ e.stopPropagation();
+ if (!isCreatingFileParseTask) {
+ parseFiles([id]);
+ }
+ }}
+ style={{ cursor: 'pointer' }}
+ >
+ <Button
+ icon={FileBoxIcon}
+ loading={isCreatingFileParseTask}
+ size={'small'}
+ type={'text'}
+ />
+ </div>
+ </Tooltip>
+ )
+ )}
+ </>
+ )}
+ </div>
+ </div>
+ );
+ },
+);
+
+export default MasonryFileItem;
diff --git a/src/features/FileManager/FileList/MasonrySkeleton.tsx b/src/features/FileManager/FileList/MasonrySkeleton.tsx
new file mode 100644
index 00000000000..515e24bc123
--- /dev/null
+++ b/src/features/FileManager/FileList/MasonrySkeleton.tsx
@@ -0,0 +1,57 @@
+import { Skeleton } from 'antd';
+import { createStyles } from 'antd-style';
+import { memo } from 'react';
+
+const useStyles = createStyles(({ css, token }) => ({
+ card: css`
+ padding: 12px;
+ border: 1px solid ${token.colorBorderSecondary};
+ border-radius: ${token.borderRadiusLG}px;
+ background: ${token.colorBgContainer};
+ `,
+ grid: css`
+ display: grid;
+ gap: 16px;
+ padding-block: 12px;
+ padding-inline: 24px;
+ `,
+}));
+
+interface MasonrySkeletonProps {
+ columnCount: number;
+}
+
+const MasonrySkeleton = memo<MasonrySkeletonProps>(({ columnCount }) => {
+ const { styles } = useStyles();
+ // Generate varying heights for more natural masonry look
+ const heights = [180, 220, 200, 190, 240, 210, 200, 230, 180, 220, 210, 190];
+
+ return (
+ <div
+ className={styles.grid}
+ style={{
+ gridTemplateColumns: `repeat(${columnCount}, 1fr)`,
+ }}
+ >
+ {Array.from({ length: 12 }).map((_, index) => (
+ <div className={styles.card} key={index}>
+ <Skeleton
+ active
+ paragraph={{
+ rows: 3,
+ width: ['100%', '80%', '60%'],
+ }}
+ style={{
+ height: heights[index],
+ }}
+ title={false}
+ />
+ </div>
+ ))}
+ </div>
+ );
+});
+
+MasonrySkeleton.displayName = 'MasonrySkeleton';
+
+export default MasonrySkeleton;
diff --git a/src/features/FileManager/FileList/ToolBar/ViewSwitcher.tsx b/src/features/FileManager/FileList/ToolBar/ViewSwitcher.tsx
new file mode 100644
index 00000000000..7d6056c139e
--- /dev/null
+++ b/src/features/FileManager/FileList/ToolBar/ViewSwitcher.tsx
@@ -0,0 +1,45 @@
+import { ActionIcon } from '@lobehub/ui';
+import { createStyles } from 'antd-style';
+import { Grid3x3Icon, ListIcon } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Flexbox } from 'react-layout-kit';
+
+export type ViewMode = 'list' | 'masonry';
+
+interface ViewSwitcherProps {
+ onViewChange: (view: ViewMode) => void;
+ view: ViewMode;
+}
+
+const useStyles = createStyles(({ css }) => ({
+ container: css`
+ gap: 4px;
+ `,
+}));
+
+const ViewSwitcher = memo<ViewSwitcherProps>(({ onViewChange, view }) => {
+ const { t } = useTranslation('components');
+ const { styles } = useStyles();
+
+ return (
+ <Flexbox className={styles.container} horizontal>
+ <ActionIcon
+ active={view === 'list'}
+ icon={ListIcon}
+ onClick={() => onViewChange('list')}
+ size={16}
+ title={t('FileManager.view.list')}
+ />
+ <ActionIcon
+ active={view === 'masonry'}
+ icon={Grid3x3Icon}
+ onClick={() => onViewChange('masonry')}
+ size={16}
+ title={t('FileManager.view.masonry')}
+ />
+ </Flexbox>
+ );
+});
+
+export default ViewSwitcher;
diff --git a/src/features/FileManager/FileList/ToolBar/index.tsx b/src/features/FileManager/FileList/ToolBar/index.tsx
index cd933369c2f..51f6827a919 100644
--- a/src/features/FileManager/FileList/ToolBar/index.tsx
+++ b/src/features/FileManager/FileList/ToolBar/index.tsx
@@ -10,6 +10,7 @@ import { isChunkingUnsupported } from '@/utils/isChunkingUnsupported';
import Config from './Config';
import MultiSelectActions, { MultiSelectActionType } from './MultiSelectActions';
+import ViewSwitcher, { ViewMode } from './ViewSwitcher';
const useStyles = createStyles(({ css, token, isDarkMode }) => ({
container: css`
@@ -23,12 +24,14 @@ interface MultiSelectActionsProps {
config: { showFilesInKnowledgeBase: boolean };
knowledgeBaseId?: string;
onConfigChange: (config: { showFilesInKnowledgeBase: boolean }) => void;
+ onViewChange: (view: ViewMode) => void;
selectCount: number;
selectFileIds: string[];
setSelectedFileIds: (ids: string[]) => void;
showConfig?: boolean;
total?: number;
totalFileIds: string[];
+ viewMode: ViewMode;
}
const ToolBar = memo<MultiSelectActionsProps>(
@@ -42,6 +45,8 @@ const ToolBar = memo<MultiSelectActionsProps>(
config,
onConfigChange,
knowledgeBaseId,
+ viewMode,
+ onViewChange,
}) => {
const { styles } = useStyles();
@@ -111,7 +116,10 @@ const ToolBar = memo<MultiSelectActionsProps>(
selectCount={selectCount}
total={total}
/>
- {showConfig && <Config config={config} onConfigChange={onConfigChange} />}
+ <Flexbox gap={8} horizontal>
+ <ViewSwitcher onViewChange={onViewChange} view={viewMode} />
+ {showConfig && <Config config={config} onConfigChange={onConfigChange} />}
+ </Flexbox>
</Flexbox>
);
},
diff --git a/src/features/FileManager/FileList/index.tsx b/src/features/FileManager/FileList/index.tsx
index 22d65b69707..1b0cf0ce375 100644
--- a/src/features/FileManager/FileList/index.tsx
+++ b/src/features/FileManager/FileList/index.tsx
@@ -1,21 +1,26 @@
'use client';
import { Text } from '@lobehub/ui';
+import { VirtuosoMasonry } from '@virtuoso.dev/masonry';
import { createStyles } from 'antd-style';
import { useQueryState } from 'nuqs';
import { rgba } from 'polished';
-import { memo, useState } from 'react';
+import React, { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Center, Flexbox } from 'react-layout-kit';
import { Virtuoso } from 'react-virtuoso';
import { useFileStore } from '@/store/file';
+import { useGlobalStore } from '@/store/global';
import { SortType } from '@/types/files';
import EmptyStatus from './EmptyStatus';
import FileListItem, { FILE_DATE_WIDTH, FILE_SIZE_WIDTH } from './FileListItem';
import FileSkeleton from './FileSkeleton';
+import MasonryItemWrapper from './MasonryFileItem/MasonryItemWrapper';
+import MasonrySkeleton from './MasonrySkeleton';
import ToolBar from './ToolBar';
+import { ViewMode } from './ToolBar/ViewSwitcher';
import { useCheckTaskStatus } from './useCheckTaskStatus';
const useStyles = createStyles(({ css, token, isDarkMode }) => ({
@@ -47,6 +52,35 @@ const FileList = memo<FileListProps>(({ knowledgeBaseId, category }) => {
const [selectFileIds, setSelectedFileIds] = useState<string[]>([]);
const [viewConfig, setViewConfig] = useState({ showFilesInKnowledgeBase: false });
+ const viewMode = useGlobalStore((s) => s.status.fileManagerViewMode || 'list') as ViewMode;
+ const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);
+ const setViewMode = (mode: ViewMode) => updateSystemStatus({ fileManagerViewMode: mode });
+
+ const [columnCount, setColumnCount] = useState(4);
+
+ // Update column count based on window size
+ const updateColumnCount = () => {
+ const width = window.innerWidth;
+ if (width < 768) {
+ setColumnCount(2);
+ } else if (width < 1024) {
+ setColumnCount(3);
+ } else if (width < 1440) {
+ setColumnCount(4);
+ } else {
+ setColumnCount(5);
+ }
+ };
+
+ // Set initial column count and listen for resize
+ React.useEffect(() => {
+ if (viewMode === 'masonry') {
+ updateColumnCount();
+ window.addEventListener('resize', updateColumnCount);
+ return () => window.removeEventListener('resize', updateColumnCount);
+ }
+ }, [viewMode]);
+
const [query] = useQueryState('q', {
clearOnDefault: true,
});
@@ -73,6 +107,17 @@ const FileList = memo<FileListProps>(({ knowledgeBaseId, category }) => {
useCheckTaskStatus(data);
+ // Clean up selected files that no longer exist in the data
+ React.useEffect(() => {
+ if (data && selectFileIds.length > 0) {
+ const validFileIds = new Set(data.map((item) => item?.id).filter(Boolean));
+ const filteredSelection = selectFileIds.filter((id) => validFileIds.has(id));
+ if (filteredSelection.length !== selectFileIds.length) {
+ setSelectedFileIds(filteredSelection);
+ }
+ }
+ }, [data]);
+
return !isLoading && data?.length === 0 ? (
<EmptyStatus knowledgeBaseId={knowledgeBaseId} showKnowledgeBase={!knowledgeBaseId} />
) : (
@@ -83,28 +128,36 @@ const FileList = memo<FileListProps>(({ knowledgeBaseId, category }) => {
key={selectFileIds.join('-')}
knowledgeBaseId={knowledgeBaseId}
onConfigChange={setViewConfig}
+ onViewChange={setViewMode}
selectCount={selectFileIds.length}
selectFileIds={selectFileIds}
setSelectedFileIds={setSelectedFileIds}
showConfig={!knowledgeBaseId}
total={data?.length}
totalFileIds={data?.map((item) => item.id) || []}
+ viewMode={viewMode}
/>
- <Flexbox align={'center'} className={styles.header} horizontal paddingInline={8}>
- <Flexbox className={styles.headerItem} flex={1} style={{ paddingInline: 32 }}>
- {t('FileManager.title.title')}
+ {viewMode === 'list' && (
+ <Flexbox align={'center'} className={styles.header} horizontal paddingInline={8}>
+ <Flexbox className={styles.headerItem} flex={1} style={{ paddingInline: 32 }}>
+ {t('FileManager.title.title')}
+ </Flexbox>
+ <Flexbox className={styles.headerItem} width={FILE_DATE_WIDTH}>
+ {t('FileManager.title.createdAt')}
+ </Flexbox>
+ <Flexbox className={styles.headerItem} width={FILE_SIZE_WIDTH}>
+ {t('FileManager.title.size')}
+ </Flexbox>
</Flexbox>
- <Flexbox className={styles.headerItem} width={FILE_DATE_WIDTH}>
- {t('FileManager.title.createdAt')}
- </Flexbox>
- <Flexbox className={styles.headerItem} width={FILE_SIZE_WIDTH}>
- {t('FileManager.title.size')}
- </Flexbox>
- </Flexbox>
+ )}
</Flexbox>
{isLoading ? (
- <FileSkeleton />
- ) : (
+ viewMode === 'masonry' ? (
+ <MasonrySkeleton columnCount={columnCount} />
+ ) : (
+ <FileSkeleton />
+ )
+ ) : viewMode === 'list' ? (
<Virtuoso
components={{
Footer: () => (
@@ -135,6 +188,23 @@ const FileList = memo<FileListProps>(({ knowledgeBaseId, category }) => {
)}
style={{ flex: 1 }}
/>
+ ) : (
+ <div style={{ flex: 1, overflow: 'hidden' }}>
+ <div style={{ height: '100%', overflowY: 'auto' }}>
+ <div style={{ paddingBlockEnd: 64, paddingBlockStart: 12, paddingInline: 24 }}>
+ <VirtuosoMasonry
+ ItemContent={MasonryItemWrapper}
+ columnCount={columnCount}
+ context={{ knowledgeBaseId, selectFileIds, setSelectedFileIds }}
+ data={data || []}
+ key={`masonry-${query || 'all'}-${data?.length || 0}`}
+ style={{
+ gap: '16px',
+ }}
+ />
+ </div>
+ </div>
+ </div>
)}
</Flexbox>
);
diff --git a/src/features/FileManager/Header/FilesSearchBar.tsx b/src/features/FileManager/Header/FilesSearchBar.tsx
index 45991b43591..423790429fb 100644
--- a/src/features/FileManager/Header/FilesSearchBar.tsx
+++ b/src/features/FileManager/Header/FilesSearchBar.tsx
@@ -2,7 +2,7 @@
import { SearchBar } from '@lobehub/ui';
import { useQueryState } from 'nuqs';
-import { memo, useState } from 'react';
+import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useUserStore } from '@/store/user';
@@ -14,10 +14,15 @@ const FilesSearchBar = memo<{ mobile?: boolean }>(({ mobile }) => {
const hotkey = useUserStore(settingsSelectors.getHotkeyById(HotkeyEnum.Search));
const [keywords, setKeywords] = useState<string>('');
- const [, setQuery] = useQueryState('q', {
+ const [query, setQuery] = useQueryState('q', {
clearOnDefault: true,
});
+ // Sync local state with URL query parameter
+ useEffect(() => {
+ setKeywords(query || '');
+ }, [query]);
+
return (
<SearchBar
allowClear
diff --git a/src/locales/default/common.ts b/src/locales/default/common.ts
index b12416e2195..33130e28cc9 100644
--- a/src/locales/default/common.ts
+++ b/src/locales/default/common.ts
@@ -333,6 +333,7 @@ export default {
chat: '会话',
discover: '发现',
files: '文件',
+ knowledgeBase: '知识库',
me: '我',
setting: '设置',
},
diff --git a/src/locales/default/components.ts b/src/locales/default/components.ts
index 60492df6d6e..37fa74b5e36 100644
--- a/src/locales/default/components.ts
+++ b/src/locales/default/components.ts
@@ -35,6 +35,10 @@ export default {
config: {
showFilesInKnowledgeBase: '显示知识库中内容',
},
+ view: {
+ list: '列表视图',
+ masonry: '网格视图',
+ },
emptyStatus: {
actions: {
file: '上传文件',
diff --git a/src/locales/default/file.ts b/src/locales/default/file.ts
index 44ec519c17a..39fb8b8b3ab 100644
--- a/src/locales/default/file.ts
+++ b/src/locales/default/file.ts
@@ -1,5 +1,5 @@
export default {
- desc: '管理你的文件与知识库',
+ desc: '管理你的知识',
detail: {
basic: {
createdAt: '创建时间',
@@ -71,7 +71,7 @@ export default {
videos: '视频',
websites: '网页',
},
- title: '文件',
+ title: '知识库',
toggleLeftPanel: {
title: '显示/隐藏左侧面板',
},
diff --git a/src/store/global/initialState.ts b/src/store/global/initialState.ts
index 29c413c2453..bb269023ffa 100644
--- a/src/store/global/initialState.ts
+++ b/src/store/global/initialState.ts
@@ -57,6 +57,7 @@ export interface SystemStatus {
expandInputActionbar?: boolean;
// which sessionGroup should expand
expandSessionGroupKeys: string[];
+ fileManagerViewMode?: 'list' | 'masonry';
filePanelWidth: number;
hideGemini2_5FlashImagePreviewChineseWarning?: boolean;
hidePWAInstaller?: boolean;
@@ -125,6 +126,7 @@ export const INITIAL_STATUS = {
chatInputHeight: 64,
expandInputActionbar: true,
expandSessionGroupKeys: [SessionDefaultGroup.Pinned, SessionDefaultGroup.Default],
+ fileManagerViewMode: 'list' as const,
filePanelWidth: 320,
hideGemini2_5FlashImagePreviewChineseWarning: false,
hidePWAInstaller: false,