fix: clean up files section and add KB/MB unit selector to compress

- Remove duplicate "Files" heading (section header + inline count)
- Space "Show more" and "Clear all" apart on the same row
- Replace bare number input with number + KB/MB dropdown for target
  size, defaulting to KB; MB values are converted to KB for the API
- Hide native number input spin buttons for a cleaner look
This commit is contained in:
SnapOtter
2026-05-11 16:54:13 +08:00
parent 0c8e8c075c
commit 72de10b844
2 changed files with 45 additions and 28 deletions
+16 -14
View File
@@ -123,23 +123,26 @@ function FileSelectionInfo({
})}
</div>
{showToggle && (
<div className="flex items-center justify-between">
{showToggle ? (
<button
type="button"
onClick={() => setExpanded(!expanded)}
className="text-xs text-primary hover:text-primary/80"
>
{expanded ? "Show less" : `Show ${files.length - COLLAPSED_LIMIT} more`}
</button>
) : (
<span />
)}
<button
type="button"
onClick={() => setExpanded(!expanded)}
className="text-xs text-primary hover:text-primary/80"
onClick={onClear}
className="text-xs text-muted-foreground hover:text-foreground"
>
{expanded ? "Show less" : `Show ${files.length - COLLAPSED_LIMIT} more`}
Clear all
</button>
)}
<button
type="button"
onClick={onClear}
className="text-xs text-muted-foreground hover:text-foreground"
>
Clear all
</button>
</div>
</div>
);
}
@@ -643,7 +646,6 @@ export function ToolPage() {
<>
{!isNoDropzone && (
<div className="space-y-2">
<h3 className="text-sm font-medium text-muted-foreground">Files</h3>
<FileSelectionInfo
files={files}
selectedIndex={selectedIndex}