perf(studio): virtualize the furniture table and throttle batch progress
- Render the table view through a virtualizer too, using a shared grid template so the sticky header and rows keep perfect column alignment - Keep semantic table/row/cell elements while virtualizing - Cap the batch item-details list to the latest 60 rows (newest first) - Coalesce per-item progress events server-side (120ms throttle) in both the exact-import and clone SSE batch runners
This commit is contained in:
1 parent
d02aaa0d87
commit
b92f897ba2
4 files changed
+284
-206
No files matched your search
@@ -79,9 +79,22 @@ export function runSseBatch<T>(opts: RunSseBatchOptions<T>): Response {
|
||||
index,
|
||||
});
|
||||
try {
|
||||
const result = await worker(item, index, (status) =>
|
||||
send({ type: "item_progress", classname, status, index }),
|
||||
);
|
||||
// Coalesce micro-step progress ('downloading', 'converting',
|
||||
// ...) to at most one per 120ms per item so large imports
|
||||
// don't flood the client. Terminal states are emitted
|
||||
// separately below.
|
||||
let lastReportSent = 0;
|
||||
const result = await worker(item, index, (status) => {
|
||||
const now = Date.now();
|
||||
if (now - lastReportSent < 120) return;
|
||||
lastReportSent = now;
|
||||
send({
|
||||
type: "item_progress",
|
||||
classname,
|
||||
status,
|
||||
index,
|
||||
});
|
||||
});
|
||||
if (ac.signal.aborted) return;
|
||||
if (result.ok) {
|
||||
succeeded++;
|
||||
|
||||
Reference in new issue
Block a user