Surface post-import verification results in the Studio
After a batch import the progress panel now shows a verification summary (offer_id fixed, furnidata ids fixed / missing / conflicts, nitros and icons synced, folders chowned). Single imports include the key counts in the success toast.
This commit is contained in:
1 parent
b4968a9967
commit
635abfbc9f
3 files changed
+105
-3
No files matched your search
@@ -64,6 +64,7 @@ import type {
|
||||
FurniItem,
|
||||
FurniStats,
|
||||
Meta,
|
||||
VerificationSummary,
|
||||
} from "./studio-types";
|
||||
|
||||
export function StudioClient({
|
||||
@@ -119,6 +120,9 @@ export function StudioClient({
|
||||
const [batchSucceeded, setBatchSucceeded] = useState(0);
|
||||
const [batchFailed, setBatchFailed] = useState(0);
|
||||
const [batchCancelling, setBatchCancelling] = useState(false);
|
||||
const [verification, setVerification] = useState<VerificationSummary | null>(
|
||||
null,
|
||||
);
|
||||
const batchAbortRef = useRef<AbortController | null>(null);
|
||||
|
||||
// Nitro editor
|
||||
@@ -363,7 +367,16 @@ export function StudioClient({
|
||||
setDetail({ ...item, alreadyImported: true, nitroExists: true });
|
||||
}
|
||||
fetchStats();
|
||||
toast.success(`${item.classname} imported into the catalog`);
|
||||
const parts = [`${item.classname} imported into the catalog`];
|
||||
if (typeof data.furniDataFixedIds === "number") {
|
||||
parts.push(
|
||||
`verified: ${data.offerIdsFixed} offer_id, ${data.furniDataFixedIds} furnidata id`,
|
||||
);
|
||||
}
|
||||
if (data.furniDataMissing > 0) {
|
||||
parts.push(`${data.furniDataMissing} furnidata missing`);
|
||||
}
|
||||
toast.success(parts.join(" · "));
|
||||
} else {
|
||||
toast.error(data.error || `Import failed for ${item.classname}`);
|
||||
}
|
||||
@@ -462,6 +475,15 @@ export function StudioClient({
|
||||
} else if (event.type === "batch_complete") {
|
||||
setBatchSucceeded(event.succeeded);
|
||||
setBatchFailed(event.failed);
|
||||
setVerification({
|
||||
offerIdsFixed: event.offerIdsFixed ?? 0,
|
||||
furniDataFixedIds: event.furniDataFixedIds ?? 0,
|
||||
furniDataMissing: event.furniDataMissing ?? 0,
|
||||
furniDataConflicts: event.furniDataConflicts ?? 0,
|
||||
nitrosSynced: event.nitrosSynced ?? [],
|
||||
iconsSynced: event.iconsSynced ?? [],
|
||||
ownershipFixed: event.ownershipFixed ?? [],
|
||||
});
|
||||
setBatchDone(true);
|
||||
}
|
||||
} catch {
|
||||
@@ -1173,10 +1195,12 @@ export function StudioClient({
|
||||
succeeded={batchSucceeded}
|
||||
failed={batchFailed}
|
||||
cancelling={batchCancelling}
|
||||
verification={verification}
|
||||
onCancel={cancelBatch}
|
||||
onDismiss={() => {
|
||||
setBatchProgress(null);
|
||||
setBatchDone(false);
|
||||
setVerification(null);
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
Reference in new issue
Block a user