diff --git a/.changeset/fluffy-timers-allow.md b/.changeset/fluffy-timers-allow.md new file mode 100644 index 000000000..e0719b3a1 --- /dev/null +++ b/.changeset/fluffy-timers-allow.md @@ -0,0 +1,5 @@ +--- +'renterd': patch +--- + +Fixed an issue where the global files view was not showing full file paths. diff --git a/apps/renterd-e2e/src/specs/files.spec.ts b/apps/renterd-e2e/src/specs/files.spec.ts index fb0917327..0a7a234eb 100644 --- a/apps/renterd-e2e/src/specs/files.spec.ts +++ b/apps/renterd-e2e/src/specs/files.spec.ts @@ -15,6 +15,7 @@ import { createFilesMap, expectFilesMap, openDirectoryContextMenu, + changeExplorerMode, } from '../fixtures/files' import { afterTest, beforeTest } from '../fixtures/beforeTest' import { clearToasts, fillTextInputByName } from '@siafoundation/e2e' @@ -53,6 +54,25 @@ test('can create directory and delete a directory', async ({ page }) => { await fileInList(page, dirPath2) }) +test('can see full file paths in the all files view mode', async ({ page }) => { + const bucketName = 'bucket1' + const dirName1 = 'dir1' + const dirName2 = 'dir2' + const dirPath1 = `${bucketName}/${dirName1}/` + const dirPath2 = `${bucketName}/${dirName1}/${dirName2}/` + const visiblePath = `${dirName1}/${dirName2}/` + + await navigateToBuckets({ page }) + await createBucket(page, bucketName) + await openBucket(page, bucketName) + await createDirectory(page, dirName1) + await openDirectory(page, dirPath1) + await createDirectory(page, dirName2) + await fileInList(page, dirPath2) + await changeExplorerMode(page, 'all files') + await expect(page.getByText(visiblePath)).toBeVisible() +}) + test('can upload, rename, and delete files', async ({ page }) => { const bucketName = 'files-test' const dirName = 'test-dir' diff --git a/apps/renterd/components/Files/FilesViewDropdownMenu.tsx b/apps/renterd/components/Files/FilesViewDropdownMenu.tsx index 2dc1d010f..8fd6d5330 100644 --- a/apps/renterd/components/Files/FilesViewDropdownMenu.tsx +++ b/apps/renterd/components/Files/FilesViewDropdownMenu.tsx @@ -8,23 +8,30 @@ import { BaseMenuItem, MenuSeparator, Option, + TableColumn, } from '@siafoundation/design-system' import { CaretDown16, SettingsAdjust16 } from '@siafoundation/react-icons' import { sortOptions, SortField } from '../../contexts/filesManager/types' -import { useFilesManager } from '../../contexts/filesManager' import { groupBy } from '@technically/lodash' -export function FilesViewDropdownMenu() { - const { - configurableColumns, - toggleColumnVisibility, - resetDefaultColumnVisibility, - sortField, - setSortField, - sortDirection, - setSortDirection, - visibleColumnIds, - } = useFilesManager() +export function FilesViewDropdownMenu({ + tableState, +}: { + tableState: { + sortField: SortField + sortDirection: 'asc' | 'desc' + // eslint-disable-next-line @typescript-eslint/no-explicit-any + visibleColumns: TableColumn[] + toggleColumnVisibility: (id: string) => void + resetDefaultColumnVisibility: () => void + setSortField: (field: SortField) => void + setSortDirection: (direction: 'asc' | 'desc') => void + configurableColumns: { + label: string + id: string + }[] + } +}) { return ( Order by { e.stopPropagation() }} onChange={(e) => { - setSortDirection(e.currentTarget.value as 'asc' | 'desc') + tableState.setSortDirection( + e.currentTarget.value as 'asc' | 'desc' + ) }} >