feat(frontend): add remove button to pending and submitted file cards

Lets users drop an uploaded file from the UI list before or after
conversion, without cancelling anything server-side.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 16:47:18 +02:00
co-authored by Claude Sonnet 5
parent 987af80286
commit a7a91a7a2e
6 changed files with 60 additions and 4 deletions
+12 -1
View File
@@ -52,7 +52,7 @@ export function HomePage() {
};
})
);
setPendingFiles(withTargets);
setPendingFiles((current) => [...current, ...withTargets]);
}
function updateTargetFormat(index, targetFormat) {
@@ -78,6 +78,14 @@ export function HomePage() {
setPendingFiles((current) => current.map((item, i) => (i === index ? { ...item, iconSize } : item)));
}
function removePendingFile(index) {
setPendingFiles((current) => current.filter((_, i) => i !== index));
}
function removeSubmittedJob(index) {
setSubmittedJobs((current) => current.filter((_, i) => i !== index));
}
async function handleConvert() {
const validItems = pendingFiles.filter((item) => item.targetFormat);
const jobs = await uploadFiles(validItems);
@@ -114,6 +122,7 @@ export function HomePage() {
onTargetFormatChange={updateTargetFormat}
onQualityChange={updateQuality}
onIconSizeChange={updateIconSize}
onRemove={removePendingFile}
/>
))}
</ul>
@@ -132,6 +141,7 @@ export function HomePage() {
fileSize={job.size}
targetFormat={job.targetFormat}
jobId={job.id}
onRemove={() => removeSubmittedJob(index)}
/>
) : (
<FileCard
@@ -140,6 +150,7 @@ export function HomePage() {
fileSize={job.size}
targetFormat={job.targetFormat}
initialError={job.error}
onRemove={() => removeSubmittedJob(index)}
/>
)
)}