Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions frontend/src/routes/dashboard/import/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
let skipInvalidRows = $state(true);

// ── Step 5: Progress + Results ────────────────────────────────────────────
const BATCH_SIZE = 50;
const BATCH_SIZE = 5;
const MAX_SHORT_CODE_LENGTH = 100;
let progress = $state(0); // 0-100
let importDone = $state(false);
Expand Down Expand Up @@ -413,6 +413,9 @@
return;
}

// Yield to the browser so Svelte can paint the 0% state before the first request
await new Promise((r) => setTimeout(r, 0));

const chunks: ImportLinkRow[][] = [];
for (let i = 0; i < rows.length; i += BATCH_SIZE) {
chunks.push(rows.slice(i, i + BATCH_SIZE));
Expand Down Expand Up @@ -465,6 +468,30 @@

<svelte:head>
<title>Import Links - Rushomon</title>
<style>
@keyframes progress-stripes {
from {
background-position: 40px 0;
}
to {
background-position: 0 0;
}
}
.progress-animated {
background-image: linear-gradient(
45deg,
rgba(255, 255, 255, 0.15) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, 0.15) 50%,
rgba(255, 255, 255, 0.15) 75%,
transparent 75%,
transparent
);
background-size: 40px 40px;
animation: progress-stripes 1s linear infinite;
}
</style>
</svelte:head>

<div class="min-h-screen bg-gray-50">
Expand Down Expand Up @@ -569,7 +596,7 @@
: "Drag and drop a CSV file, or click to browse"}
</p>
<p class="text-xs text-gray-400 mt-1">
Supports .csv files up to any size (batched in chunks of 50)
Supports .csv files up to any size (batched in chunks of 5)
</p>
</label>

Expand Down Expand Up @@ -873,7 +900,9 @@
<p class="text-sm text-gray-500 mb-6">
Please wait. Don't close this tab.
</p>
<div class="w-full bg-gray-200 rounded-full h-3 mb-2">
<div
class="w-full bg-gray-200 rounded-full h-3 mb-2 progress-animated"
>
<div
class="bg-gradient-to-r from-orange-500 to-orange-600 h-3 rounded-full transition-all duration-300"
style="width: {progress}%"
Expand Down
Loading