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

View file

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

View file

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