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:
Lucas Oliveira 2025-03-29 20:54:37 -03:00 • committed by GitHub
commit f99d626080
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 14 deletions

View file

@ -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>

View file

@ -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(

View file

@ -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);