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 &&
|
file.progress === -1 &&
|
||||||
"pointer-events-none text-placeholder-foreground",
|
"pointer-events-none text-placeholder-foreground",
|
||||||
)}
|
)}
|
||||||
onDoubleClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
if (!file.progress && !handleRemove) {
|
|
||||||
setOpenRename(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<ShadTooltip content={`${file.name}.${type}`} side="bottom">
|
<ShadTooltip content={`${file.name}.${type}`} side="bottom">
|
||||||
<span
|
<span
|
||||||
className={cn(
|
className={cn(
|
||||||
"w-full cursor-text overflow-hidden truncate",
|
"w-full cursor-pointer overflow-hidden truncate",
|
||||||
handleRemove && "cursor-default",
|
handleRemove && "cursor-default",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{file.name}.{type}
|
{file.name}.{type}
|
||||||
</span>
|
</span>
|
||||||
</ShadTooltip>
|
</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)}
|
{formatFileSize(file.size)}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,8 @@ export default function RecentFilesComponent({
|
||||||
files={searchResults
|
files={searchResults
|
||||||
.toSorted((a, b) => {
|
.toSorted((a, b) => {
|
||||||
const selectedOrder = sortByBoolean(
|
const selectedOrder = sortByBoolean(
|
||||||
selectedFiles.includes(a.path) || a.progress !== undefined,
|
a.progress !== undefined,
|
||||||
selectedFiles.includes(b.path) || b.progress !== undefined,
|
b.progress !== undefined,
|
||||||
);
|
);
|
||||||
return selectedOrder === 0
|
return selectedOrder === 0
|
||||||
? sortByDate(
|
? sortByDate(
|
||||||
|
|
|
||||||
|
|
@ -169,10 +169,8 @@ test(
|
||||||
timeout: 1000,
|
timeout: 1000,
|
||||||
});
|
});
|
||||||
|
|
||||||
await page
|
await page.getByTestId(`context-menu-button-${jsonFileName}`).click();
|
||||||
.getByText(`${jsonFileName}.json`)
|
await page.getByTestId("btn-rename-file").click();
|
||||||
.first()
|
|
||||||
.click({ clickCount: 2 });
|
|
||||||
await page
|
await page
|
||||||
.getByTestId(`rename-input-${jsonFileName}`)
|
.getByTestId(`rename-input-${jsonFileName}`)
|
||||||
.fill(renamedJsonFile);
|
.fill(renamedJsonFile);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue