diff --git a/frontend/src/components/file-manager/FileManagerToolbar.jsx b/frontend/src/components/file-manager/FileManagerToolbar.jsx index 06ea22e0..c6df8c5d 100644 --- a/frontend/src/components/file-manager/FileManagerToolbar.jsx +++ b/frontend/src/components/file-manager/FileManagerToolbar.jsx @@ -1,25 +1,22 @@ import { - File, + ArrowDown, ArrowLeft, ArrowRight, ArrowUp, - Search, - X, + Check, RefreshCw, - Eye, - EyeOff, HardDrive, PanelLeftClose, PanelLeftOpen, LayoutGrid, List, Home, - ArrowUpDown, + SlidersHorizontal, } from 'lucide-react'; import { Button } from '@/components/ui/button'; - -import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select'; +import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; +import { cn } from '@/lib/utils'; import { useTranslation } from 'react-i18next'; @@ -44,11 +41,8 @@ export default function FileManagerToolbar({ filterCounts, sortValue, handleSortChange, - searchQuery, - setSearchQuery, - handleSearch, - searchResults, - clearSearch, + // The search box, only when the page has no top bar to host it. + search, viewMode, setViewMode, showHidden, @@ -58,6 +52,18 @@ export default function FileManagerToolbar({ loading, }) { const { t } = useTranslation(); + const [sortKey, sortDir] = String(sortValue || 'name-asc').split('-'); + // What the listing can be sorted by, with the direction a fresh pick + // starts in (newest and largest first; names and types A to Z). + const sortKeys = [ + { key: 'name', label: t('common.labels.name', 'Name'), first: 'asc' }, + { key: 'modified', label: t('app.fileManager.modified', 'Modified'), first: 'desc' }, + { key: 'size', label: t('common.labels.size', 'Size'), first: 'desc' }, + { key: 'type', label: t('common.labels.type', 'Type'), first: 'asc' }, + ]; + // Anything other than "everything, hidden files off" is worth a mark on + // the button, since the menu is closed most of the time. + const viewIsNarrowed = activeFilter !== FILTER_OPTIONS[0]?.id || showHidden; return ( <>
@@ -122,7 +128,8 @@ export default function FileManagerToolbar({
{breadcrumbs.map((crumb, idx) => ( - {idx > 0 && /} + {/* The root crumb is itself "/", so the one after it needs no separator. */} + {idx > 0 && breadcrumbs[idx - 1].name !== '/' && /} - )} -
+ {search}
- + {/* One menu for how the listing is shown: which kinds, in what + order, hidden files or not. They were two selects and an + icon, each as wide as the control it sat beside. */} + + + + + +
{t('app.fileManager.show', 'Show')}
+ {FILTER_OPTIONS.map((option) => ( + + ))} + +
+
{t('app.fileManager.sortBy', 'Sort by')}
+ {sortKeys.map((option) => ( + + ))} + + +
+ + + + )} +
+ ); +} diff --git a/frontend/src/i18n/locales/ar.json b/frontend/src/i18n/locales/ar.json index 1b0dcae9..204f2e85 100644 --- a/frontend/src/i18n/locales/ar.json +++ b/frontend/src/i18n/locales/ar.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} غير مدعوم حتى الآن على الوكلاء البعيدين", "isnTAvailableOnS3Buckets": "{{op}} غير متوفر في جرافات S3", "keyboardShortcuts": "اختصارات لوحة المفاتيح", - "largest": "الأكبر", "listView": "عرض القائمة", "loadingFiles": "تحميل الملفات", "localPanelHost": "مضيف اللوحة المحلي", "modified": "معدل", - "nameAZ": "الاسم من الألف إلى الياء", - "nameZA": "الاسم Z-A", "newFolder": "مجلد جديد", "newName": "اسم جديد", - "newest": "الأحدث", "noFiles": "لا توجد ملفات {{activeFilter}}", "noMatches": "لا توجد مباريات", "objectStorage": "تخزين الكائنات", - "oldest": "الأقدم", "owner": "مالك", "ownerRwGroupOtherRFiles": "المالك: rw، المجموعة/أخرى: r (ملفات)", "ownerRwOnlyPrivateFiles": "المالك: rw فقط (ملفات خاصة)", @@ -2752,17 +2747,12 @@ "selected": "تم التحديد ·", "showSidebar": "إظهار الشريط الجانبي", "sites": "مواقع", - "smallest": "الأصغر", - "sort": "نوع", "stack": "المكدس", "terminal": "الطرفية", "thisFolderIsEmpty": "هذا المجلد فارغ", - "toggleHiddenFiles": "تبديل الملفات المخفية", "total": "المجموع", "tryADifferentFilter": "جرب مرشحًا مختلفًا.", "tryADifferentSearchTermOr": "جرّب مصطلح بحث مختلفًا أو تصفح مجلدًا آخر.", - "typeZA": "اكتب Z-A", - "types": "أنواع", "up": "أعلى", "upDelDeleteF2RenameA": "⌫ لأعلى · ديل حذف · إعادة تسمية F2 · ⌘A الكل", "updatedAt": "تم التحديث {{time}}", diff --git a/frontend/src/i18n/locales/bn.json b/frontend/src/i18n/locales/bn.json index 6eb80f44..ab945648 100644 --- a/frontend/src/i18n/locales/bn.json +++ b/frontend/src/i18n/locales/bn.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} এখনও দূরবর্তী এজেন্টগুলিতে সমর্থিত নয়৷", "isnTAvailableOnS3Buckets": "{{op}} S3 বাকেটগুলিতে উপলব্ধ নয়৷", "keyboardShortcuts": "কীবোর্ড শর্টকাট", - "largest": "সবচেয়ে বড়", "listView": "তালিকা ভিউ", "loadingFiles": "ফাইল লোড হচ্ছে", "localPanelHost": "লোকাল প্যানেল হোস্ট", "modified": "পরিবর্তিত", - "nameAZ": "নাম A-Z", - "nameZA": "নাম Z-A", "newFolder": "নতুন ফোল্ডার", "newName": "নতুন নাম", - "newest": "নতুনতম", "noFiles": "কোন {{activeFilter}} ফাইল নেই৷", "noMatches": "কোন মিল নেই", "objectStorage": "অবজেক্ট স্টোরেজ", - "oldest": "প্রাচীনতম", "owner": "মালিক", "ownerRwGroupOtherRFiles": "মালিক: rw, গ্রুপ/অন্যান্য: r (ফাইল)", "ownerRwOnlyPrivateFiles": "মালিক: শুধুমাত্র rw (ব্যক্তিগত ফাইল)", @@ -2752,17 +2747,12 @@ "selected": "নির্বাচিত ·", "showSidebar": "সাইডবার দেখান", "sites": "সাইট", - "smallest": "সবচেয়ে ছোট", - "sort": "সাজান", "stack": "স্ট্যাক", "terminal": "টার্মিনাল", "thisFolderIsEmpty": "এই ফোল্ডারটি খালি", - "toggleHiddenFiles": "লুকানো ফাইল টগল করুন", "total": "মোট", "tryADifferentFilter": "একটি ভিন্ন ফিল্টার চেষ্টা করুন.", "tryADifferentSearchTermOr": "একটি ভিন্ন অনুসন্ধান শব্দ চেষ্টা করুন বা অন্য ফোল্ডার ব্রাউজ করুন.", - "typeZA": "Z-A টাইপ করুন", - "types": "প্রকারভেদ", "up": "উপরে", "upDelDeleteF2RenameA": "⌫ Up · Del Delete · F2 Rename · ⌘A All", "updatedAt": "আপডেট হয়েছে {{time}}", diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json index ff6c205a..d73ed24d 100644 --- a/frontend/src/i18n/locales/de.json +++ b/frontend/src/i18n/locales/de.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} wird auf Remote-Agenten noch nicht unterstützt", "isnTAvailableOnS3Buckets": "{{op}} ist für S3-Buckets nicht verfügbar", "keyboardShortcuts": "Tastaturkürzel", - "largest": "Größte", "listView": "Listenansicht", "loadingFiles": "Laden von Dateien", "localPanelHost": "Lokaler Panel-Host", "modified": "Geändert", - "nameAZ": "Name A–Z", - "nameZA": "Name Z–A", "newFolder": "Neuer Ordner", "newName": "Neuer Name", - "newest": "Neueste", "noFiles": "Keine {{activeFilter}}-Dateien", "noMatches": "Keine Übereinstimmungen", "objectStorage": "Objektspeicher", - "oldest": "Älteste", "owner": "Besitzer", "ownerRwGroupOtherRFiles": "Besitzer: rw, Gruppe/Andere: r (Dateien)", "ownerRwOnlyPrivateFiles": "Besitzer: nur rw (private Dateien)", @@ -2752,17 +2747,12 @@ "selected": "ausgewählt ·", "showSidebar": "Seitenleiste anzeigen", "sites": "Websites", - "smallest": "Kleinste", - "sort": "Sortieren", "stack": "Stack", "terminal": "Terminal", "thisFolderIsEmpty": "Dieser Ordner ist leer", - "toggleHiddenFiles": "Versteckte Dateien umschalten", "total": "Insgesamt", "tryADifferentFilter": "Versuchen Sie es mit einem anderen Filter.", "tryADifferentSearchTermOr": "Versuchen Sie es mit einem anderen Suchbegriff oder durchsuchen Sie einen anderen Ordner.", - "typeZA": "Typ Z-A", - "types": "Typen", "up": "Nach oben", "upDelDeleteF2RenameA": "⌫ Nach oben · Entf Löschen · F2 Umbenennen · ⌘A Alle", "updatedAt": "Aktualisiert {{time}}", diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index a07a6c04..a8806247 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -2749,6 +2749,7 @@ "alreadyAtTheTopFolder": "Already at the top folder", "apply": "Apply", "archives": "Archives", + "ascending": "Ascending", "audio": "Audio", "browsingOn": "Browsing on", "browsingYour": "Browsing your", @@ -2765,6 +2766,7 @@ "deleteConfirmation": "Delete confirmation", "deletedItems_one": "Deleted 1 item", "deletedItems_other": "Deleted {{count}} items", + "descending": "Descending", "diskUsage": "Disk usage", "documents": "Documents", "dropFilesHereOrUseThe": "Drop files here, or use the buttons above to create something new.", @@ -2790,22 +2792,17 @@ "isNotYetSupportedOnRemote": "{{op}} is not yet supported on remote agents", "isnTAvailableOnS3Buckets": "{{op}} isn't available on S3 buckets", "keyboardShortcuts": "Keyboard shortcuts", - "largest": "Largest", "listView": "List view", "loadingFiles": "Loading files", "localPanelHost": "Panel server", "modified": "Modified", - "nameAZ": "Name A-Z", - "nameZA": "Name Z-A", "newFolder": "New folder", "newName": "New name", - "newest": "Newest", "noFiles": "No {{activeFilter}} files", "noMatches": "No matches", "nothingToGoBackTo": "Nothing to go back to", "nothingToGoForwardTo": "Nothing to go forward to", "objectStorage": "Object storage", - "oldest": "Oldest", "owner": "Owner", "ownerRwGroupOtherRFiles": "Owner: rw, Group/Other: r (files)", "ownerRwOnlyPrivateFiles": "Owner: rw only (private files)", @@ -2825,19 +2822,17 @@ "searchFailed": "Couldn't search. {{message}}", "searchFiles": "Search files…", "selected": "selected ·", + "show": "Show", + "showHiddenFiles": "Show hidden files", "showSidebar": "Show sidebar", "sites": "Sites", - "smallest": "Smallest", - "sort": "Sort", + "sortBy": "Sort by", "stack": "Stack", "terminal": "Terminal", "thisFolderIsEmpty": "This folder is empty", - "toggleHiddenFiles": "Toggle hidden files", "total": "Total", "tryADifferentFilter": "Try a different filter.", "tryADifferentSearchTermOr": "Try a different search term or browse another folder.", - "typeZA": "Type Z-A", - "types": "Types", "up": "Up", "upDelDeleteF2RenameA": "⌫ Up · Del Delete · F2 Rename · ⌘A All", "updatedAt": "Updated {{time}}", @@ -2850,6 +2845,7 @@ "uploadsComplete": "Uploads complete", "users": "Users", "videos": "Videos", + "viewOptions": "View options", "volumes": "Volumes", "webConfig": "Web config", "willBeCreatedIn": "Will be created in:" diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json index 2611a787..b1e1ab7b 100644 --- a/frontend/src/i18n/locales/es.json +++ b/frontend/src/i18n/locales/es.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} aún no está disponible en agentes remotos", "isnTAvailableOnS3Buckets": "{{op}} no está disponible en buckets de S3", "keyboardShortcuts": "Atajos de teclado", - "largest": "Más grandes", "listView": "Vista de lista", "loadingFiles": "Cargando archivos", "localPanelHost": "Host local del panel", "modified": "Modificado", - "nameAZ": "Nombre A-Z", - "nameZA": "Nombre Z-A", "newFolder": "Nueva carpeta", "newName": "Nuevo nombre", - "newest": "Más recientes", "noFiles": "No hay archivos de tipo {{activeFilter}}", "noMatches": "Sin coincidencias", "objectStorage": "Almacenamiento de objetos", - "oldest": "Más antiguos", "owner": "Propietario", "ownerRwGroupOtherRFiles": "Propietario: rw, Grupo/Otros: r (archivos)", "ownerRwOnlyPrivateFiles": "Propietario: solo rw (archivos privados)", @@ -2752,17 +2747,12 @@ "selected": "seleccionados ·", "showSidebar": "Mostrar la barra lateral", "sites": "Sitios", - "smallest": "Más pequeños", - "sort": "Ordenar", "stack": "Stack", "terminal": "Terminal", "thisFolderIsEmpty": "Esta carpeta está vacía", - "toggleHiddenFiles": "Mostrar u ocultar archivos ocultos", "total": "Total", "tryADifferentFilter": "Prueba con otro filtro.", "tryADifferentSearchTermOr": "Prueba con otro término de búsqueda o navega a otra carpeta.", - "typeZA": "Tipo Z-A", - "types": "Tipos", "up": "Subir", "upDelDeleteF2RenameA": "⌫ Subir · Del Eliminar · F2 Renombrar · ⌘A Todo", "updatedAt": "Actualizado {{time}}", diff --git a/frontend/src/i18n/locales/fr.json b/frontend/src/i18n/locales/fr.json index d623b59e..17609968 100644 --- a/frontend/src/i18n/locales/fr.json +++ b/frontend/src/i18n/locales/fr.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} n'est pas encore pris en charge sur les agents distants", "isnTAvailableOnS3Buckets": "{{op}} n'est pas disponible sur les compartiments S3", "keyboardShortcuts": "Raccourcis clavier", - "largest": "Le plus grand", "listView": "Vue en liste", "loadingFiles": "Chargement de fichiers", "localPanelHost": "Hôte du panneau local", "modified": "Modifié", - "nameAZ": "Nom A-Z", - "nameZA": "Nom Z-A", "newFolder": "Nouveau dossier", "newName": "Nouveau nom", - "newest": "Le plus récent", "noFiles": "Aucun fichier {{activeFilter}}", "noMatches": "Aucune correspondance", "objectStorage": "Stockage d'objets", - "oldest": "Le plus ancien", "owner": "Propriétaire", "ownerRwGroupOtherRFiles": "Propriétaire : rw, Groupe/Autre : r (fichiers)", "ownerRwOnlyPrivateFiles": "Propriétaire : rw uniquement (fichiers privés)", @@ -2752,17 +2747,12 @@ "selected": "sélectionné ·", "showSidebar": "Afficher la barre latérale", "sites": "Sites", - "smallest": "Le plus petit", - "sort": "Trier", "stack": "Pile", "terminal": "Terminal", "thisFolderIsEmpty": "Ce dossier est vide", - "toggleHiddenFiles": "Basculer les fichiers cachés", "total": "Total", "tryADifferentFilter": "Essayez un autre filtre.", "tryADifferentSearchTermOr": "Essayez un autre terme de recherche ou parcourez un autre dossier.", - "typeZA": "Type Z-A", - "types": "Espèces", "up": "Dossier parent", "upDelDeleteF2RenameA": "⌫ Haut · Supprimer · F2 Renommer · ⌘A Tout", "updatedAt": "Mis à jour {{time}}", diff --git a/frontend/src/i18n/locales/id.json b/frontend/src/i18n/locales/id.json index fa050e53..d691ea1c 100644 --- a/frontend/src/i18n/locales/id.json +++ b/frontend/src/i18n/locales/id.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} belum didukung pada agen jarak jauh", "isnTAvailableOnS3Buckets": "{{op}} tidak tersedia di bucket S3", "keyboardShortcuts": "Pintasan keyboard", - "largest": "Terbesar", "listView": "Tampilan daftar", "loadingFiles": "Memuat file", "localPanelHost": "Host panel lokal", "modified": "Dimodifikasi", - "nameAZ": "Nama A-Z", - "nameZA": "Nama Z-A", "newFolder": "Folder baru", "newName": "Nama Baru", - "newest": "Terbaru", "noFiles": "Tidak ada file {{activeFilter}}", "noMatches": "Tidak ada kecocokan", "objectStorage": "Penyimpanan objek", - "oldest": "Tertua", "owner": "Pemilik", "ownerRwGroupOtherRFiles": "Pemilik: rw, Grup/Lainnya: r (file)", "ownerRwOnlyPrivateFiles": "Pemilik: rw saja (file pribadi)", @@ -2752,17 +2747,12 @@ "selected": "dipilih ·", "showSidebar": "Tampilkan bilah sisi", "sites": "Situs", - "smallest": "Terkecil", - "sort": "Menyortir", "stack": "Stack", "terminal": "Terminal", "thisFolderIsEmpty": "Folder ini kosong", - "toggleHiddenFiles": "Alihkan file tersembunyi", "total": "Total", "tryADifferentFilter": "Coba filter lain.", "tryADifferentSearchTermOr": "Coba istilah pencarian lain atau jelajahi folder lain.", - "typeZA": "Tipe Z-A", - "types": "Jenis", "up": "Naik", "upDelDeleteF2RenameA": "⌫ Atas · Del Hapus · F2 Ganti Nama · ⌘A Semua", "updatedAt": "Diperbarui {{time}}", diff --git a/frontend/src/i18n/locales/it.json b/frontend/src/i18n/locales/it.json index 03ff3252..d9ceb9d6 100644 --- a/frontend/src/i18n/locales/it.json +++ b/frontend/src/i18n/locales/it.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} non è ancora supportato sugli agenti remoti", "isnTAvailableOnS3Buckets": "{{op}} non è disponibile sui bucket S3", "keyboardShortcuts": "Scorciatoie da tastiera", - "largest": "Il più grande", "listView": "Visualizzazione elenco", "loadingFiles": "Caricamento file", "localPanelHost": "Host locale del pannello", "modified": "Modificato", - "nameAZ": "Nome dalla A alla Z", - "nameZA": "Nome ZA", "newFolder": "Nuova cartella", "newName": "Nuovo nome", - "newest": "Più recente", "noFiles": "Nessun file {{activeFilter}}", "noMatches": "Nessuna corrispondenza", "objectStorage": "Object storage", - "oldest": "Il più antico", "owner": "Proprietario", "ownerRwGroupOtherRFiles": "Proprietario: rw, Gruppo/Altro: r (file)", "ownerRwOnlyPrivateFiles": "Proprietario: solo rw (file privati)", @@ -2752,17 +2747,12 @@ "selected": "selezionato ·", "showSidebar": "Mostra barra laterale", "sites": "Siti", - "smallest": "Il più piccolo", - "sort": "Ordinare", "stack": "Stack", "terminal": "Terminale", "thisFolderIsEmpty": "Questa cartella è vuota", - "toggleHiddenFiles": "Attiva/disattiva i file nascosti", "total": "Totale", "tryADifferentFilter": "Prova un filtro diverso.", "tryADifferentSearchTermOr": "Prova un termine di ricerca diverso o sfoglia un'altra cartella.", - "typeZA": "Digitare Z-A", - "types": "Tipi", "up": "Su", "upDelDeleteF2RenameA": "⌫ Su · Canc Elimina · F2 Rinomina · ⌘A Tutto", "updatedAt": "Aggiornato {{time}}", diff --git a/frontend/src/i18n/locales/ko.json b/frontend/src/i18n/locales/ko.json index 0a6c505c..544e6aa0 100644 --- a/frontend/src/i18n/locales/ko.json +++ b/frontend/src/i18n/locales/ko.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}}는 아직 원격 에이전트에서 지원되지 않습니다.", "isnTAvailableOnS3Buckets": "S3 버킷에서는 {{op}}를 사용할 수 없습니다.", "keyboardShortcuts": "키보드 단축키", - "largest": "가장 큰", "listView": "목록 보기", "loadingFiles": "파일 로드 중", "localPanelHost": "로컬 패널 호스트", "modified": "수정됨", - "nameAZ": "이름 A~Z", - "nameZA": "이름 Z-A", "newFolder": "새 폴더", "newName": "새 이름", - "newest": "최신", "noFiles": "{{activeFilter}} 파일 없음", "noMatches": "일치하는 항목 없음", "objectStorage": "오브젝트 스토리지", - "oldest": "가장 오래된", "owner": "소유자", "ownerRwGroupOtherRFiles": "소유자: rw, 그룹/기타: r(파일)", "ownerRwOnlyPrivateFiles": "소유자: rw 전용(개인 파일)", @@ -2752,17 +2747,12 @@ "selected": "선택됨 ·", "showSidebar": "사이드바 표시", "sites": "사이트", - "smallest": "가장 작은", - "sort": "정렬", "stack": "스택", "terminal": "터미널", "thisFolderIsEmpty": "이 폴더는 비어 있습니다.", - "toggleHiddenFiles": "숨겨진 파일 전환", "total": "합계", "tryADifferentFilter": "다른 필터를 사용해 보세요.", "tryADifferentSearchTermOr": "다른 검색어를 사용해 보거나 다른 폴더를 찾아보세요.", - "typeZA": "Z-A형", - "types": "유형", "up": "위로", "upDelDeleteF2RenameA": "⌫ 위로 · Del 삭제 · F2 이름 바꾸기 · ⌘A 모두", "updatedAt": "{{time}} 업데이트됨", diff --git a/frontend/src/i18n/locales/pl.json b/frontend/src/i18n/locales/pl.json index 5bebd452..e05e3dd8 100644 --- a/frontend/src/i18n/locales/pl.json +++ b/frontend/src/i18n/locales/pl.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} nie jest jeszcze obsługiwany na zdalnych agentach", "isnTAvailableOnS3Buckets": "{{op}} nie jest dostępny w segmentach S3", "keyboardShortcuts": "Skróty klawiaturowe", - "largest": "Największy", "listView": "Widok listy", "loadingFiles": "Ładowanie plików", "localPanelHost": "Lokalny host panelu", "modified": "Zmodyfikowany", - "nameAZ": "Imię A-Z", - "nameZA": "Imię Z-A", "newFolder": "Nowy folder", "newName": "Nowa nazwa", - "newest": "Najnowszy", "noFiles": "Brak plików {{activeFilter}}", "noMatches": "Brak dopasowań", "objectStorage": "Magazyn obiektowy", - "oldest": "Najstarszy", "owner": "Właściciel", "ownerRwGroupOtherRFiles": "Właściciel: rw, Grupa/Inne: r (pliki)", "ownerRwOnlyPrivateFiles": "Właściciel: tylko rw (pliki prywatne)", @@ -2752,17 +2747,12 @@ "selected": "wybrany ·", "showSidebar": "Pokaż pasek boczny", "sites": "Witryny", - "smallest": "Najmniejszy", - "sort": "Sortować", "stack": "Stos", "terminal": "Terminal", "thisFolderIsEmpty": "Ten folder jest pusty", - "toggleHiddenFiles": "Przełącz ukryte pliki", "total": "Całkowity", "tryADifferentFilter": "Wypróbuj inny filtr.", "tryADifferentSearchTermOr": "Wypróbuj inne wyszukiwane hasło lub przejrzyj inny folder.", - "typeZA": "Typ Z-A", - "types": "Typy", "up": "W górę", "upDelDeleteF2RenameA": "⌫ W górę · Usuń · F2 Zmień nazwę · ⌘A Wszystko", "updatedAt": "Zaktualizowano {{time}}", diff --git a/frontend/src/i18n/locales/pt.json b/frontend/src/i18n/locales/pt.json index 27cc7334..b14bd5ec 100644 --- a/frontend/src/i18n/locales/pt.json +++ b/frontend/src/i18n/locales/pt.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} ainda não é compatível com agentes remotos", "isnTAvailableOnS3Buckets": "{{op}} não está disponível em buckets S3", "keyboardShortcuts": "Atalhos de teclado", - "largest": "Maior", "listView": "Visualização de lista", "loadingFiles": "Carregando arquivos", "localPanelHost": "Host do painel local", "modified": "Modificado", - "nameAZ": "Nome A-Z", - "nameZA": "Nome Z-A", "newFolder": "Nova pasta", "newName": "Novo nome", - "newest": "Mais recente", "noFiles": "Nenhum arquivo {{activeFilter}}", "noMatches": "Nenhuma correspondência", "objectStorage": "Armazenamento de objetos", - "oldest": "Mais antigo", "owner": "Proprietário", "ownerRwGroupOtherRFiles": "Proprietário: rw, Grupo/Outro: r (arquivos)", "ownerRwOnlyPrivateFiles": "Proprietário: somente rw (arquivos privados)", @@ -2752,17 +2747,12 @@ "selected": "selecionado ·", "showSidebar": "Mostrar barra lateral", "sites": "Locais", - "smallest": "Menor", - "sort": "Classificar", "stack": "Pilha", "terminal": "Terminal", "thisFolderIsEmpty": "Esta pasta está vazia", - "toggleHiddenFiles": "Alternar arquivos ocultos", "total": "Total", "tryADifferentFilter": "Experimente um filtro diferente.", "tryADifferentSearchTermOr": "Experimente um termo de pesquisa diferente ou navegue em outra pasta.", - "typeZA": "Tipo Z-A", - "types": "Tipos", "up": "Subir", "upDelDeleteF2RenameA": "⌫ Para cima · Del Excluir · F2 Renomear · ⌘A Tudo", "updatedAt": "Atualizado {{time}}", diff --git a/frontend/src/i18n/locales/ru.json b/frontend/src/i18n/locales/ru.json index 3670a013..1fc59aae 100644 --- a/frontend/src/i18n/locales/ru.json +++ b/frontend/src/i18n/locales/ru.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} пока не поддерживается на удаленных агентах.", "isnTAvailableOnS3Buckets": "{{op}} недоступен в сегментах S3.", "keyboardShortcuts": "Сочетания клавиш", - "largest": "Самый большой", "listView": "Просмотр списка", "loadingFiles": "Загрузка файлов", "localPanelHost": "Локальный хост панели", "modified": "Модифицированный", - "nameAZ": "Имя от А до Я", - "nameZA": "Имя Z-A", "newFolder": "Новая папка", "newName": "Новое имя", - "newest": "Новейший", "noFiles": "Нет файлов {{activeFilter}}.", "noMatches": "Нет совпадений", "objectStorage": "Объектное хранилище", - "oldest": "Самый старый", "owner": "Владелец", "ownerRwGroupOtherRFiles": "Владелец: rw, Группа/Другое: r (файлы)", "ownerRwOnlyPrivateFiles": "Владелец: только rw (частные файлы)", @@ -2752,17 +2747,12 @@ "selected": "выбрано ·", "showSidebar": "Показать боковую панель", "sites": "Сайты", - "smallest": "Самый маленький", - "sort": "Сортировать", "stack": "Стек", "terminal": "Терминал", "thisFolderIsEmpty": "Эта папка пуста", - "toggleHiddenFiles": "Переключить скрытые файлы", "total": "Всего", "tryADifferentFilter": "Попробуйте другой фильтр.", "tryADifferentSearchTermOr": "Попробуйте другой поисковый запрос или просмотрите другую папку.", - "typeZA": "Тип Z-A", - "types": "Типы", "up": "Вверх", "upDelDeleteF2RenameA": "⌫ Вверх · Удалить · Переименовать F2 · ⌘A Все", "updatedAt": "Обновлено {{time}}", diff --git a/frontend/src/i18n/locales/th.json b/frontend/src/i18n/locales/th.json index 8a0d8ec5..0a6a40fe 100644 --- a/frontend/src/i18n/locales/th.json +++ b/frontend/src/i18n/locales/th.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} ยังไม่รองรับเอเจนต์ระยะไกล", "isnTAvailableOnS3Buckets": "{{op}} ไม่พร้อมใช้งานบนบัคเก็ต S3", "keyboardShortcuts": "แป้นพิมพ์ลัด", - "largest": "ใหญ่ที่สุด", "listView": "มุมมองรายการ", "loadingFiles": "กำลังโหลดไฟล์", "localPanelHost": "โฮสต์แผงภายในเครื่อง", "modified": "ดัดแปลง", - "nameAZ": "ชื่อ ก-ฮ", - "nameZA": "ชื่อ Z-A", "newFolder": "โฟลเดอร์ใหม่", "newName": "ชื่อใหม่", - "newest": "ใหม่ล่าสุด", "noFiles": "ไม่มีไฟล์ {{activeFilter}}", "noMatches": "ไม่มีการแข่งขัน", "objectStorage": "ที่เก็บข้อมูลออบเจ็กต์", - "oldest": "เก่าแก่ที่สุด", "owner": "เจ้าของ", "ownerRwGroupOtherRFiles": "เจ้าของ: rw, กลุ่ม/อื่นๆ: r (ไฟล์)", "ownerRwOnlyPrivateFiles": "เจ้าของ: rw เท่านั้น (ไฟล์ส่วนตัว)", @@ -2752,17 +2747,12 @@ "selected": "เลือกแล้ว ·", "showSidebar": "แสดงแถบด้านข้าง", "sites": "เว็บไซต์", - "smallest": "เล็กที่สุด", - "sort": "เรียงลำดับ", "stack": "สแต็ค", "terminal": "เทอร์มินัล", "thisFolderIsEmpty": "โฟลเดอร์นี้ว่างเปล่า", - "toggleHiddenFiles": "สลับไฟล์ที่ซ่อน", "total": "ทั้งหมด", "tryADifferentFilter": "ลองใช้ตัวกรองอื่น", "tryADifferentSearchTermOr": "ลองใช้คำค้นหาอื่นหรือเรียกดูโฟลเดอร์อื่น", - "typeZA": "ประเภท Z-A", - "types": "ประเภท", "up": "ขึ้น", "upDelDeleteF2RenameA": "⌫ ขึ้น · ลบ ลบ · F2 เปลี่ยนชื่อ · ⌘A ทั้งหมด", "updatedAt": "อัปเดต {{time}}", diff --git a/frontend/src/i18n/locales/tr.json b/frontend/src/i18n/locales/tr.json index e8999d40..d1dec887 100644 --- a/frontend/src/i18n/locales/tr.json +++ b/frontend/src/i18n/locales/tr.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} henüz uzak aracılarda desteklenmiyor", "isnTAvailableOnS3Buckets": "{{op}}, S3 paketlerinde mevcut değildir", "keyboardShortcuts": "Klavye kısayolları", - "largest": "En büyük", "listView": "Liste görünümü", "loadingFiles": "Dosyalar yükleniyor", "localPanelHost": "Yerel panel ana bilgisayarı", "modified": "Değiştirildi", - "nameAZ": "A'dan Z'ye İsim", - "nameZA": "İsim Z-A", "newFolder": "Yeni klasör", "newName": "Yeni Ad", - "newest": "En yeni", "noFiles": "{{activeFilter}} dosyası yok", "noMatches": "Eşleşme yok", "objectStorage": "Nesne depolama", - "oldest": "En eski", "owner": "Mal sahibi", "ownerRwGroupOtherRFiles": "Sahip: rw, Grup/Diğer: r (dosyalar)", "ownerRwOnlyPrivateFiles": "Sahip: yalnızca rw (özel dosyalar)", @@ -2752,17 +2747,12 @@ "selected": "seçilmiş ·", "showSidebar": "Kenar çubuğunu göster", "sites": "Siteler", - "smallest": "En küçük", - "sort": "Düzenlemek", "stack": "Yığın", "terminal": "Terminal", "thisFolderIsEmpty": "Bu klasör boş", - "toggleHiddenFiles": "Gizli dosyaları değiştir", "total": "Toplam", "tryADifferentFilter": "Farklı bir filtre deneyin.", "tryADifferentSearchTermOr": "Farklı bir arama terimi deneyin veya başka bir klasöre göz atın.", - "typeZA": "Tip Z-A", - "types": "Türler", "up": "Yukarı", "upDelDeleteF2RenameA": "⌫ Yukarı · Sil Sil · F2 Yeniden Adlandır · ⌘A Tümü", "updatedAt": "{{time}} güncellendi", diff --git a/frontend/src/i18n/locales/vi.json b/frontend/src/i18n/locales/vi.json index 243fbfc3..e0f6da97 100644 --- a/frontend/src/i18n/locales/vi.json +++ b/frontend/src/i18n/locales/vi.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "{{op}} chưa được hỗ trợ trên các tác nhân từ xa", "isnTAvailableOnS3Buckets": "{{op}} không có sẵn trên nhóm S3", "keyboardShortcuts": "Phím tắt", - "largest": "lớn nhất", "listView": "Chế độ xem danh sách", "loadingFiles": "Đang tải tập tin", "localPanelHost": "Máy chủ bảng điều khiển cục bộ", "modified": "Đã sửa đổi", - "nameAZ": "Tên A-Z", - "nameZA": "Tên Z-A", "newFolder": "Thư mục mới", "newName": "Tên mới", - "newest": "Mới nhất", "noFiles": "Không có tệp {{activeFilter}}", "noMatches": "Không có kết quả phù hợp", "objectStorage": "Lưu trữ đối tượng", - "oldest": "Cũ nhất", "owner": "Người sở hữu", "ownerRwGroupOtherRFiles": "Chủ sở hữu: rw, Nhóm/Khác: r (tệp)", "ownerRwOnlyPrivateFiles": "Chủ sở hữu: chỉ rw (tệp riêng tư)", @@ -2752,17 +2747,12 @@ "selected": "đã chọn ·", "showSidebar": "Hiển thị thanh bên", "sites": "Trang web", - "smallest": "Nhỏ nhất", - "sort": "Loại", "stack": "Stack", "terminal": "Terminal", "thisFolderIsEmpty": "Thư mục này trống", - "toggleHiddenFiles": "Chuyển đổi tập tin ẩn", "total": "Tổng cộng", "tryADifferentFilter": "Hãy thử một bộ lọc khác.", "tryADifferentSearchTermOr": "Hãy thử một cụm từ tìm kiếm khác hoặc duyệt qua một thư mục khác.", - "typeZA": "Loại Z-A", - "types": "Các loại", "up": "Lên", "upDelDeleteF2RenameA": "⌫ Lên · Xóa · F2 Đổi tên · ⌘A Tất cả", "updatedAt": "Cập nhật {{time}}", diff --git a/frontend/src/i18n/locales/zh-Hans.json b/frontend/src/i18n/locales/zh-Hans.json index 34a4c06c..2f0c1e18 100644 --- a/frontend/src/i18n/locales/zh-Hans.json +++ b/frontend/src/i18n/locales/zh-Hans.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "远程代理尚不支持 {{op}}", "isnTAvailableOnS3Buckets": "{{op}} 在 S3 存储桶上不可用", "keyboardShortcuts": "键盘快捷键", - "largest": "最大", "listView": "列表视图", "loadingFiles": "加载文件", "localPanelHost": "本地面板主机", "modified": "修改的", - "nameAZ": "名称 A-Z", - "nameZA": "名称 Z-A", "newFolder": "新建文件夹", "newName": "新名称", - "newest": "最新", "noFiles": "没有 {{activeFilter}} 文件", "noMatches": "没有匹配项", "objectStorage": "对象存储", - "oldest": "最古老的", "owner": "所有者", "ownerRwGroupOtherRFiles": "所有者:rw,组/其他:r(文件)", "ownerRwOnlyPrivateFiles": "所有者:仅 rw(私有文件)", @@ -2752,17 +2747,12 @@ "selected": "已选择·", "showSidebar": "显示侧边栏", "sites": "站点", - "smallest": "最小", - "sort": "种类", "stack": "堆栈", "terminal": "终端", "thisFolderIsEmpty": "该文件夹是空的", - "toggleHiddenFiles": "切换隐藏文件", "total": "总计", "tryADifferentFilter": "尝试不同的过滤器。", "tryADifferentSearchTermOr": "尝试不同的搜索词或浏览另一个文件夹。", - "typeZA": "Z-A型", - "types": "类型", "up": "上一级", "upDelDeleteF2RenameA": "⌫ 向上 · Del 删除 · F2 重命名 · ⌘A 全部", "updatedAt": "更新于 {{time}}", diff --git a/frontend/src/i18n/locales/zh-Hant.json b/frontend/src/i18n/locales/zh-Hant.json index 7f780bdd..031d5195 100644 --- a/frontend/src/i18n/locales/zh-Hant.json +++ b/frontend/src/i18n/locales/zh-Hant.json @@ -2717,20 +2717,15 @@ "isNotYetSupportedOnRemote": "遠端代理程式尚不支援 {{op}}", "isnTAvailableOnS3Buckets": "S3 儲存貯體不支援 {{op}} 操作", "keyboardShortcuts": "鍵盤快速鍵", - "largest": "最大", "listView": "清單檢視", "loadingFiles": "載入檔案", "localPanelHost": "本機面板主機", "modified": "已修改", - "nameAZ": "名稱 A-Z", - "nameZA": "名稱 Z-A", "newFolder": "建立資料夾", "newName": "新名稱", - "newest": "最新", "noFiles": "沒有 {{activeFilter}} 檔案", "noMatches": "沒有相符項", "objectStorage": "物件儲存", - "oldest": "最舊", "owner": "擁有者", "ownerRwGroupOtherRFiles": "所有者:rw,群組/其他:r(檔案)", "ownerRwOnlyPrivateFiles": "所有者:僅 rw(私有檔案)", @@ -2752,17 +2747,12 @@ "selected": "已選擇·", "showSidebar": "顯示側邊欄", "sites": "網站", - "smallest": "最小", - "sort": "排序", "stack": "堆疊", "terminal": "終端機", "thisFolderIsEmpty": "該資料夾是空的", - "toggleHiddenFiles": "切換隱藏檔案", "total": "總計", "tryADifferentFilter": "嘗試不同的篩選器。", "tryADifferentSearchTermOr": "嘗試不同的搜尋字詞或瀏覽另一個資料夾。", - "typeZA": "類型 Z-A", - "types": "類型", "up": "上一層", "upDelDeleteF2RenameA": "⌫ 向上 · Del 刪除 · F2 重新命名 · ⌘A 全部", "updatedAt": "更新於 {{time}}", diff --git a/frontend/src/pages/FileManager.jsx b/frontend/src/pages/FileManager.jsx index 4e56eb96..a594ffb1 100644 --- a/frontend/src/pages/FileManager.jsx +++ b/frontend/src/pages/FileManager.jsx @@ -29,7 +29,8 @@ import ContextMenu from '../components/file-manager/ContextMenu'; import { formatBytes } from '../components/file-manager/fileTypes'; import { useClipboard } from '@/hooks/useClipboard'; import { useTranslation } from 'react-i18next'; -import { useTopbarActions } from '@/hooks/useTopbarActions'; +import { useTopbarActions, useTopbarChrome } from '@/hooks/useTopbarActions'; +import FileSearchField from '../components/file-manager/FileSearchField'; import { useStableHandler } from '@/hooks/useStableHandler'; function FileManager() { @@ -315,6 +316,19 @@ function FileManager() { [isRemote, isS3, currentPath], ); + // Search rides in the top bar, right-most, like every other page's search. + // Without a top bar (the page mounted on its own) it falls back to the + // toolbar underneath. + const { portal: searchPortal, actions: inlineSearch } = useTopbarChrome( + , + ); + // ─── render ────────────────────────────────────────── return (
+ {searchPortal} {isRemote && (
@@ -375,11 +390,7 @@ function FileManager() { filterCounts={filterCounts} sortValue={sortValue} handleSortChange={handleSortChange} - searchQuery={searchQuery} - setSearchQuery={setSearchQuery} - handleSearch={handleSearch} - searchResults={searchResults} - clearSearch={clearSearch} + search={inlineSearch} viewMode={viewMode} setViewMode={setViewMode} showHidden={showHidden} diff --git a/frontend/src/styles/pages/_file-manager.scss b/frontend/src/styles/pages/_file-manager.scss index cb2b9ef5..ef965952 100644 --- a/frontend/src/styles/pages/_file-manager.scss +++ b/frontend/src/styles/pages/_file-manager.scss @@ -270,58 +270,6 @@ $ft-default: #646b7a; span { @include truncate(); max-width: 90px; } } - // ─── Search field ─────────────────────────────────── - .search-field { - position: relative; - display: flex; - align-items: center; - background: var(--surface-2); - border: 1px solid var(--border); - border-radius: $radius-card; - width: clamp(160px, 18vw, 220px); - @include transition(all); - - &:focus-within { - border-color: var(--accent-dim); - background: var(--surface); - } - - .search-field-icon { - position: absolute; - left: $space-3; - color: $text-tertiary; - pointer-events: none; - } - - input { - background: transparent; - border: none; - padding: $space-tight $space-3 $space-tight $space-8; - font-size: $text-xs; - color: $text-primary; - width: 100%; - - &::placeholder { color: $text-tertiary; } - &:focus-visible { outline-offset: -2px; } - } - - .search-field-clear { - position: absolute; - right: 6px; - background: transparent; - border: none; - padding: $space-1; - color: $text-tertiary; - cursor: pointer; - border-radius: $radius-badge; - display: flex; - align-items: center; - justify-content: center; - - &:hover { background: $bg-hover; color: $text-primary; } - } - } - // ─── Toolbar chip / icon button ───────────────────── .toolbar-chip { display: inline-flex; @@ -368,47 +316,6 @@ $ft-default: #646b7a; &.small { padding: 4px; } } - // Compact Radix Select trigger: icon · value · chevron. - .file-toolbar-select { - position: relative; - display: inline-flex; - align-items: center; - justify-content: flex-start; - width: auto; - height: $control-md; - min-width: 0; - gap: $space-tight; - padding-inline: $space-2 $space-tight; - border: 1px solid var(--border); - border-radius: $radius-card; - background: var(--surface-2); - color: var(--text-faint); - font-size: $text-xs; - transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease; - - &:hover, - &:focus-visible { - border-color: var(--border-strong); - background: var(--surface-3); - color: var(--text-dim); - } - - > span { - width: auto; - min-width: 78px; - white-space: nowrap; - text-align: start; - } - - > svg { flex-shrink: 0; } - - .ui-select-icon { - width: 12px; - height: 12px; - opacity: 0.58; - } - } - // ─── View toggles ─────────────────────────────────── .view-toggle { display: flex; @@ -1860,18 +1767,11 @@ $drawer-width: 520px; .toolbar-right { flex-wrap: wrap; gap: $space-1; } - .search-field { + // Only present when the page has no top bar to host the search. + .fm-search { order: -1; - width: 100%; - min-width: 0; flex: 1 0 100%; - } - - .file-toolbar-select { - flex: 0 1 auto; - - > span { min-width: 0; } - > svg:not(.ui-select-icon) { display: none; } + max-width: none; } .file-mount-chip { display: none; } @@ -1921,3 +1821,26 @@ $drawer-width: 520px; border: 1px solid fade($accent-primary-raw, 25%); flex-shrink: 0; } + +// The Files search box. Top-level rather than under .file-manager: it is +// hosted in the page's top bar, outside the page's own root. +.fm-search { + .sk-searchfield__input { padding-inline-end: $space-8; } + + .search-field-clear { + position: absolute; + inset-inline-end: $space-2; + display: grid; + place-items: center; + width: $space-5; + height: $space-5; + padding: 0; + border: 0; + border-radius: $radius-badge; + background: transparent; + color: var(--text-faint); + cursor: pointer; + + &:hover { color: var(--text); background: var(--surface-3); } + } +}