fix: change file cursor and selection ordering on file modal (#7344)
* Removed renaming from file renderer and changed cursor * Removed sorting by selected files * Updated file upload test
This commit is contained in:
parent
1d42e4b877
commit
f99d626080
3 changed files with 6 additions and 14 deletions
|
|
@ -115,24 +115,18 @@ export default function FileRendererComponent({
|
|||
file.progress === -1 &&
|
||||
"pointer-events-none text-placeholder-foreground",
|
||||
)}
|
||||
onDoubleClick={(e) => {
|
||||
e.stopPropagation();
|
||||
if (!file.progress && !handleRemove) {
|
||||
setOpenRename(true);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ShadTooltip content={`${file.name}.${type}`} side="bottom">
|
||||
<span
|
||||
className={cn(
|
||||
"w-full cursor-text overflow-hidden truncate",
|
||||
"w-full cursor-pointer overflow-hidden truncate",
|
||||
handleRemove && "cursor-default",
|
||||
)}
|
||||
>
|
||||
{file.name}.{type}
|
||||
</span>
|
||||
</ShadTooltip>
|
||||
<span className="shrink-0 cursor-default text-xs font-normal text-muted-foreground">
|
||||
<span className="shrink-0 text-xs font-normal text-muted-foreground">
|
||||
{formatFileSize(file.size)}
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ export default function RecentFilesComponent({
|
|||
files={searchResults
|
||||
.toSorted((a, b) => {
|
||||
const selectedOrder = sortByBoolean(
|
||||
selectedFiles.includes(a.path) || a.progress !== undefined,
|
||||
selectedFiles.includes(b.path) || b.progress !== undefined,
|
||||
a.progress !== undefined,
|
||||
b.progress !== undefined,
|
||||
);
|
||||
return selectedOrder === 0
|
||||
? sortByDate(
|
||||
|
|
|
|||
|
|
@ -169,10 +169,8 @@ test(
|
|||
timeout: 1000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByText(`${jsonFileName}.json`)
|
||||
.first()
|
||||
.click({ clickCount: 2 });
|
||||
await page.getByTestId(`context-menu-button-${jsonFileName}`).click();
|
||||
await page.getByTestId("btn-rename-file").click();
|
||||
await page
|
||||
.getByTestId(`rename-input-${jsonFileName}`)
|
||||
.fill(renamedJsonFile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue