diff --git a/frontend/src/components/DocumentChunks.tsx b/frontend/src/components/Chunks.tsx similarity index 96% rename from frontend/src/components/DocumentChunks.tsx rename to frontend/src/components/Chunks.tsx index 84919ea4..0800cfa0 100644 --- a/frontend/src/components/DocumentChunks.tsx +++ b/frontend/src/components/Chunks.tsx @@ -77,7 +77,7 @@ const LineNumberedTextarea: React.FC = ({ ); }; -interface DocumentChunksProps { +interface ChunksProps { documentId: string; documentName?: string; handleGoBack: () => void; @@ -85,7 +85,7 @@ interface DocumentChunksProps { renderFileSearch?: () => React.ReactNode; } -const DocumentChunks: React.FC = ({ +const Chunks: React.FC = ({ documentId, documentName, handleGoBack, @@ -406,13 +406,13 @@ const DocumentChunks: React.FC = ({ ? `${(totalChunks / 1000000).toFixed(2)}M` : totalChunks > 999 ? `${(totalChunks / 1000).toFixed(2)}K` - : totalChunks} {t('settings.documents.chunks')} + : totalChunks} {t('settings.sources.chunks')}
setSearchTerm(e.target.value)} className="w-full h-full px-3 py-2 bg-transparent border-none outline-none font-normal text-[13.56px] leading-[100%] dark:text-[#E0E0E0]" @@ -421,14 +421,14 @@ const DocumentChunks: React.FC = ({
{loading ? ( @@ -441,10 +441,10 @@ const DocumentChunks: React.FC = ({
{t('settings.documents.noChunksAlt')} - {t('settings.documents.noChunks')} + {t('settings.sources.noChunks')}
) : ( filteredChunks.map((chunk, index) => ( @@ -460,7 +460,7 @@ const DocumentChunks: React.FC = ({
- {chunk.metadata.token_count ? chunk.metadata.token_count.toLocaleString() : '-'} {t('settings.documents.tokensUnit')} + {chunk.metadata.token_count ? chunk.metadata.token_count.toLocaleString() : '-'} {t('settings.sources.tokensUnit')}
@@ -491,7 +491,7 @@ const DocumentChunks: React.FC = ({
- {editingChunk.metadata.token_count ? editingChunk.metadata.token_count.toLocaleString() : '-'} {t('settings.documents.tokensUnit')} + {editingChunk.metadata.token_count ? editingChunk.metadata.token_count.toLocaleString() : '-'} {t('settings.sources.tokensUnit')}
@@ -535,4 +535,4 @@ const DocumentChunks: React.FC = ({ ); }; -export default DocumentChunks; +export default Chunks; diff --git a/frontend/src/components/FileTreeComponent.tsx b/frontend/src/components/FileTreeComponent.tsx index 53d91082..19cf006b 100644 --- a/frontend/src/components/FileTreeComponent.tsx +++ b/frontend/src/components/FileTreeComponent.tsx @@ -1,7 +1,7 @@ import React, { useState, useRef, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import DocumentChunks from './DocumentChunks'; +import Chunks from './Chunks'; import ContextMenu, { MenuOption } from './ContextMenu'; import userService from '../api/services/userService'; import FileIcon from '../assets/file.svg'; @@ -201,19 +201,21 @@ const FileTreeComponent: React.FC = ({ ): MenuOption[] => { const options: MenuOption[] = []; - if (isFile) { - options.push({ - icon: EyeView, - label: t('settings.documents.view'), - onClick: (event: React.SyntheticEvent) => { - event.stopPropagation(); + options.push({ + icon: EyeView, + label: t('settings.sources.view'), + onClick: (event: React.SyntheticEvent) => { + event.stopPropagation(); + if (isFile) { handleFileClick(name); - }, - iconWidth: 18, - iconHeight: 18, - variant: 'primary', - }); - } + } else { + navigateToDirectory(name); + } + }, + iconWidth: 18, + iconHeight: 18, + variant: 'primary', + }); options.push({ icon: Trash, @@ -494,7 +496,7 @@ const FileTreeComponent: React.FC = ({
{t('settings.documents.parentFolderAlt')} .. @@ -523,7 +525,7 @@ const FileTreeComponent: React.FC = ({ >
- {t('settings.documents.folderAlt')} + {t('settings.sources.folderAlt')} {name}
@@ -544,7 +546,7 @@ const FileTreeComponent: React.FC = ({ > {t('settings.documents.menuAlt')} @@ -575,7 +577,7 @@ const FileTreeComponent: React.FC = ({ >
- {t('settings.documents.fileAlt')} + {t('settings.sources.fileAlt')} {name}
@@ -594,7 +596,7 @@ const FileTreeComponent: React.FC = ({ > {t('settings.documents.menuAlt')} @@ -671,7 +673,7 @@ const FileTreeComponent: React.FC = ({ setSearchResults(searchFiles(e.target.value, directoryStructure)); } }} - placeholder={t('settings.documents.searchFiles')} + placeholder={t('settings.sources.searchFiles')} className={`w-full px-4 py-2 pl-10 border border-[#D1D9E0] dark:border-[#6A6A6A] ${ searchQuery ? 'rounded-t-md rounded-b-none border-b-0' : 'rounded-md' } bg-transparent dark:text-[#E0E0E0] focus:outline-none`} @@ -687,7 +689,7 @@ const FileTreeComponent: React.FC = ({
{searchResults.length === 0 ? (
- {t('settings.documents.noResults')} + {t('settings.sources.noResults')}
) : ( searchResults.map((result, index) => ( @@ -701,7 +703,7 @@ const FileTreeComponent: React.FC = ({ > {result.isFile @@ -722,7 +724,7 @@ const FileTreeComponent: React.FC = ({ {selectedFile ? (
- setSelectedFile(null)} @@ -750,16 +752,16 @@ const FileTreeComponent: React.FC = ({ - {t('settings.documents.fileName')} + {t('settings.sources.fileName')} - {t('settings.documents.tokens')} + {t('settings.sources.tokens')} - {t('settings.documents.size')} + {t('settings.sources.size')} - {t('settings.documents.actions')} + {t('settings.sources.actions')} @@ -775,7 +777,7 @@ const FileTreeComponent: React.FC = ({ {title && {title}} diff --git a/frontend/src/components/SettingsBar.tsx b/frontend/src/components/SettingsBar.tsx index 5b94a708..0d370f87 100644 --- a/frontend/src/components/SettingsBar.tsx +++ b/frontend/src/components/SettingsBar.tsx @@ -10,7 +10,7 @@ const useTabs = () => { const { t } = useTranslation(); const tabs = [ t('settings.general.label'), - t('settings.documents.label'), + t('settings.sources.label'), t('settings.analytics.label'), t('settings.logs.label'), t('settings.tools.label'), diff --git a/frontend/src/components/SourceDropdown.tsx b/frontend/src/components/SourceDropdown.tsx index 8058e9ad..a1097e4f 100644 --- a/frontend/src/components/SourceDropdown.tsx +++ b/frontend/src/components/SourceDropdown.tsx @@ -158,7 +158,7 @@ function SourceDropdown({
)} setSearchTerm(e.target.value)} - placeholder={t('settings.documents.searchPlaceholder')} + placeholder={t('settings.sources.searchPlaceholder')} borderVariant="thin" className="mb-4" labelBgClassName="bg-lotion dark:bg-charleston-green-2" @@ -203,11 +203,11 @@ export default function SourcesPopup({ @@ -217,7 +217,7 @@ export default function SourcesPopup({ onClick={handleUploadClick} className="border-violets-are-blue text-violets-are-blue hover:bg-violets-are-blue w-auto rounded-full border px-4 py-2 text-[14px] font-medium transition-colors duration-200 hover:text-white" > - {t('settings.documents.uploadNew')} + {t('settings.sources.uploadNew')}
diff --git a/frontend/src/conversation/SharedConversation.tsx b/frontend/src/conversation/SharedConversation.tsx index 931f08b3..9f99db30 100644 --- a/frontend/src/conversation/SharedConversation.tsx +++ b/frontend/src/conversation/SharedConversation.tsx @@ -23,7 +23,7 @@ import { updateQuery, } from './sharedConversationSlice'; import { selectCompletedAttachments } from '../upload/uploadSlice'; -import { DocumentHead } from '../components/DocumentHead'; +import { Head as DocumentHead } from '../components/Head'; export const SharedConversation = () => { const navigate = useNavigate(); diff --git a/frontend/src/locale/en.json b/frontend/src/locale/en.json index 3c529fc5..5c2938cb 100644 --- a/frontend/src/locale/en.json +++ b/frontend/src/locale/en.json @@ -52,14 +52,14 @@ "default": "Default", "add": "Add" }, - "documents": { - "title": "This table contains all the documents that are available to you and those you have uploaded", - "label": "Documents", - "name": "Document Name", + "sources": { + "title": "Here you can manage all of the source file that are available to you and those you have uploaded.", + "label": "Sources", + "name": "Source Name", "date": "Vector Date", "type": "Type", "tokenUsage": "Token Usage", - "noData": "No existing Documents", + "noData": "No existing Sources", "searchPlaceholder": "Search...", "addNew": "Add New", "preLoaded": "Pre-loaded", @@ -74,11 +74,12 @@ "actions": "Actions", "view": "View", "deleteWarning": "Are you sure you want to delete \"{{name}}\"?", - "backToAll": "Back to all documents", + "confirmDelete": "Are you sure you want to delete this file? This action cannot be undone.", + "backToAll": "Back to all sources", "chunks": "Chunks", "noChunks": "No chunks found", "noChunksAlt": "No chunks found", - "goToDocuments": "Go to Documents", + "goToSources": "Go to Sources", "uploadNew": "Upload new", "searchFiles": "Search files...", "noResults": "No results found", @@ -89,6 +90,7 @@ "folderAlt": "Folder", "parentFolderAlt": "Parent folder", "menuAlt": "Menu", + "menuAlt": "Menu", "tokensUnit": "tokens", "editAlt": "Edit" }, diff --git a/frontend/src/locale/es.json b/frontend/src/locale/es.json index 0b54582b..611f3b08 100644 --- a/frontend/src/locale/es.json +++ b/frontend/src/locale/es.json @@ -52,14 +52,14 @@ "default": "Predeterminado", "addNew": "Añadir Nuevo" }, - "documents": { - "title": "Esta tabla contiene todos los documentos que están disponibles para ti y los que has subido", - "label": "Documentos", - "name": "Nombre del Documento", + "sources": { + "title": "Aquí puedes gestionar todos los archivos fuente que están disponibles para ti y los que has subido.", + "label": "Fuentes", + "name": "Nombre de la Fuente", "date": "Fecha de Vector", "type": "Tipo", "tokenUsage": "Uso de Tokens", - "noData": "No hay documentos existentes", + "noData": "No hay fuentes existentes", "searchPlaceholder": "Buscar...", "addNew": "Agregar Nuevo", "preLoaded": "Precargado", @@ -74,11 +74,12 @@ "actions": "Acciones", "view": "Ver", "deleteWarning": "¿Estás seguro de que deseas eliminar \"{{name}}\"?", - "backToAll": "Volver a todos los documentos", + "confirmDelete": "¿Estás seguro de que deseas eliminar este archivo? Esta acción no se puede deshacer.", + "backToAll": "Volver a todas las fuentes", "chunks": "Fragmentos", "noChunks": "No se encontraron fragmentos", "noChunksAlt": "No se encontraron fragmentos", - "goToDocuments": "Ir a Documentos", + "goToSources": "Ir a Fuentes", "uploadNew": "Subir nuevo", "searchFiles": "Buscar archivos...", "noResults": "No se encontraron resultados", diff --git a/frontend/src/locale/jp.json b/frontend/src/locale/jp.json index 42d7bb93..5a08cd2d 100644 --- a/frontend/src/locale/jp.json +++ b/frontend/src/locale/jp.json @@ -52,14 +52,14 @@ "default": "デフォルト", "add": "追加" }, - "documents": { - "title": "この表には、利用可能なすべてのドキュメントとアップロードしたドキュメントが含まれています", - "label": "ドキュメント", - "name": "ドキュメント名", + "sources": { + "title": "ここでは、利用可能なすべてのソースファイルとアップロードしたファイルを管理できます。", + "label": "ソース", + "name": "ソース名", "date": "ベクトル日付", "type": "タイプ", "tokenUsage": "トークン使用量", - "noData": "既存のドキュメントがありません", + "noData": "既存のソースがありません", "searchPlaceholder": "検索...", "addNew": "新規追加", "preLoaded": "プリロード済み", @@ -74,11 +74,12 @@ "actions": "アクション", "view": "表示", "deleteWarning": "\"{{name}}\"を削除してもよろしいですか?", - "backToAll": "すべてのドキュメントに戻る", + "confirmDelete": "このファイルを削除してもよろしいですか?この操作は元に戻せません。", + "backToAll": "すべてのソースに戻る", "chunks": "チャンク", "noChunks": "チャンクが見つかりません", "noChunksAlt": "チャンクが見つかりません", - "goToDocuments": "ドキュメントへ移動", + "goToSources": "ソースへ移動", "uploadNew": "新規アップロード", "searchFiles": "ファイルを検索...", "noResults": "結果が見つかりません", diff --git a/frontend/src/locale/ru.json b/frontend/src/locale/ru.json index 13ae6829..0fd7c845 100644 --- a/frontend/src/locale/ru.json +++ b/frontend/src/locale/ru.json @@ -52,14 +52,14 @@ "default": "По умолчанию", "add": "Добавить" }, - "documents": { - "title": "Эта таблица содержит все документы, которые доступны вам и те, которые вы загрузили", - "label": "Документы", - "name": "Название документа", + "sources": { + "title": "Здесь вы можете управлять всеми исходными файлами, которые доступны вам и которые вы загрузили.", + "label": "Источники", + "name": "Название источника", "date": "Дата вектора", "type": "Тип", "tokenUsage": "Использование токена", - "noData": "Нет существующих документов", + "noData": "Нет существующих источников", "searchPlaceholder": "Поиск...", "addNew": "добавить новый", "preLoaded": "Предзагруженный", @@ -74,11 +74,12 @@ "actions": "Действия", "view": "Просмотр", "deleteWarning": "Вы уверены, что хотите удалить \"{{name}}\"?", - "backToAll": "Вернуться ко всем документам", + "confirmDelete": "Вы уверены, что хотите удалить этот файл? Это действие нельзя отменить.", + "backToAll": "Вернуться ко всем источникам", "chunks": "Фрагменты", "noChunks": "Фрагменты не найдены", "noChunksAlt": "Фрагменты не найдены", - "goToDocuments": "Перейти к документам", + "goToSources": "Перейти к источникам", "uploadNew": "Загрузить новый", "searchFiles": "Поиск файлов...", "noResults": "Результаты не найдены", diff --git a/frontend/src/locale/zh-TW.json b/frontend/src/locale/zh-TW.json index f590b63b..d364d6fb 100644 --- a/frontend/src/locale/zh-TW.json +++ b/frontend/src/locale/zh-TW.json @@ -52,14 +52,14 @@ "default": "預設", "add": "添加" }, - "documents": { - "title": "此表格包含所有可供您使用的文件以及您上傳的文件", - "label": "文件", - "name": "文件名稱", + "sources": { + "title": "在這裡您可以管理所有可用的來源檔案以及您上傳的檔案。", + "label": "來源", + "name": "來源名稱", "date": "向量日期", "type": "類型", "tokenUsage": "Token 使用量", - "noData": "沒有現有的文件", + "noData": "沒有現有的來源", "searchPlaceholder": "搜尋...", "addNew": "新增文件", "preLoaded": "預載入", @@ -74,11 +74,12 @@ "actions": "操作", "view": "查看", "deleteWarning": "您確定要刪除 \"{{name}}\" 嗎?", - "backToAll": "返回所有文件", + "confirmDelete": "您確定要刪除此檔案嗎?此操作無法復原。", + "backToAll": "返回所有來源", "chunks": "文本塊", "noChunks": "未找到文本塊", "noChunksAlt": "未找到文本塊", - "goToDocuments": "前往文件", + "goToSources": "前往來源", "uploadNew": "上傳新文件", "searchFiles": "搜尋檔案...", "noResults": "未找到結果", diff --git a/frontend/src/locale/zh.json b/frontend/src/locale/zh.json index c1a6b4a0..4c33a320 100644 --- a/frontend/src/locale/zh.json +++ b/frontend/src/locale/zh.json @@ -52,14 +52,14 @@ "default": "默认", "add": "添加" }, - "documents": { - "title": "此表格包含所有可供您使用的文档以及您上传的文档", - "label": "文档", - "name": "文件名称", + "sources": { + "title": "在这里您可以管理所有可用的源文件以及您上传的文件。", + "label": "来源", + "name": "来源名称", "date": "向量日期", "type": "类型", "tokenUsage": "令牌使用", - "noData": "没有现有的文档", + "noData": "没有现有的来源", "searchPlaceholder": "搜索...", "addNew": "添加新文档", "preLoaded": "预加载", @@ -74,11 +74,12 @@ "actions": "操作", "view": "查看", "deleteWarning": "您确定要删除 \"{{name}}\" 吗?", - "backToAll": "返回所有文档", + "confirmDelete": "您确定要删除此文件吗?此操作无法撤销。", + "backToAll": "返回所有来源", "chunks": "文本块", "noChunks": "未找到文本块", "noChunksAlt": "未找到文本块", - "goToDocuments": "前往文档", + "goToSources": "前往来源", "uploadNew": "上传新文档", "searchFiles": "搜索文件...", "noResults": "未找到结果", diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Sources.tsx similarity index 93% rename from frontend/src/settings/Documents.tsx rename to frontend/src/settings/Sources.tsx index 899092af..eece44e3 100644 --- a/frontend/src/settings/Documents.tsx +++ b/frontend/src/settings/Sources.tsx @@ -28,7 +28,7 @@ import { import Upload from '../upload/Upload'; import { formatDate } from '../utils/dateTimeUtils'; import FileTreeComponent from '../components/FileTreeComponent'; -import DocumentChunks from '../components/DocumentChunks'; +import Chunks from '../components/Chunks'; const formatTokens = (tokens: number): string => { const roundToTwoDecimals = (num: number): string => { @@ -46,7 +46,7 @@ const formatTokens = (tokens: number): string => { } }; -export default function Documents({ +export default function Sources({ paginatedDocuments, handleDeleteDocument, }: DocumentsProps) { @@ -97,10 +97,10 @@ export default function Documents({ const currentDocuments = paginatedDocuments ?? []; const syncOptions = [ - { label: t('settings.documents.syncFrequency.never'), value: 'never' }, - { label: t('settings.documents.syncFrequency.daily'), value: 'daily' }, - { label: t('settings.documents.syncFrequency.weekly'), value: 'weekly' }, - { label: t('settings.documents.syncFrequency.monthly'), value: 'monthly' }, + { label: t('settings.sources.syncFrequency.never'), value: 'never' }, + { label: t('settings.sources.syncFrequency.daily'), value: 'daily' }, + { label: t('settings.sources.syncFrequency.weekly'), value: 'weekly' }, + { label: t('settings.sources.syncFrequency.monthly'), value: 'monthly' }, ]; const [documentToView, setDocumentToView] = useState(); const [isMenuOpen, setIsMenuOpen] = useState(false); @@ -215,7 +215,7 @@ export default function Documents({ const actions: MenuOption[] = [ { icon: EyeView, - label: t('settings.documents.view'), + label: t('settings.sources.view'), onClick: () => { setDocumentToView(document); }, @@ -228,7 +228,7 @@ export default function Documents({ if (document.syncFrequency) { actions.push({ icon: SyncIcon, - label: t('settings.documents.sync'), + label: t('settings.sources.sync'), onClick: () => { setSyncMenuState({ isOpen: true, @@ -268,7 +268,7 @@ export default function Documents({ onBackToDocuments={() => setDocumentToView(undefined)} /> ) : ( - setDocumentToView(undefined)} @@ -280,17 +280,17 @@ export default function Documents({

- {t('settings.documents.title')} + {t('settings.sources.title')}

@@ -322,11 +322,11 @@ export default function Documents({
{t('settings.documents.noData')}

- {t('settings.documents.noData')} + {t('settings.sources.noData')}

) : ( @@ -357,7 +357,7 @@ export default function Documents({ > {document.syncFrequency && ( { handleManageSync(document, value); @@ -407,7 +407,7 @@ export default function Documents({
- {t('settings.documents.tokenUsage')}: + {t('settings.sources.tokenUsage')}: {document.tokens @@ -470,7 +470,7 @@ export default function Documents({ {deleteModalState === 'ACTIVE' && documentToDelete && ( { const path = location.pathname; - if (path.includes('/settings/documents')) - return t('settings.documents.label'); + if (path.includes('/settings/sources')) + return t('settings.sources.label'); if (path.includes('/settings/analytics')) return t('settings.analytics.label'); if (path.includes('/settings/logs')) return t('settings.logs.label'); @@ -53,8 +53,8 @@ export default function Settings() { const handleTabChange = (tab: string) => { setActiveTab(tab); if (tab === t('settings.general.label')) navigate('/settings'); - else if (tab === t('settings.documents.label')) - navigate('/settings/documents'); + else if (tab === t('settings.sources.label')) + navigate('/settings/sources'); else if (tab === t('settings.analytics.label')) navigate('/settings/analytics'); else if (tab === t('settings.logs.label')) navigate('/settings/logs'); @@ -113,9 +113,9 @@ export default function Settings() { } />