diff --git a/ui/src/pages/CompanyImport.tsx b/ui/src/pages/CompanyImport.tsx index 2e5d3ddd7b9..352fa6d46b2 100644 --- a/ui/src/pages/CompanyImport.tsx +++ b/ui/src/pages/CompanyImport.tsx @@ -29,6 +29,7 @@ import { ChevronRight, Download, Github, + Loader2, Package, Upload, } from "lucide-react"; @@ -1442,7 +1443,38 @@ export function CompanyImport() { > {previewMutation.isPending ? "Previewing..." : "Preview import"} + {!hasSource && !previewMutation.isPending && ( + + Choose a package above to enable the preview. + + )} + {inlineImportBlocked && ( + + Package too large for browser import — see the notice above. + + )} + {previewMutation.isPending && ( +
+ +

+ Uploading and analyzing your package + {inlinePreflight ? ` (about ${formatMegabytes(inlinePreflight.estimatedBytes)})` : ""} — large + packages can take a few minutes. Keep this page open. +

+
+ )} + {previewMutation.isError && !previewMutation.isPending && ( +
+

+ Preview failed:{" "} + {previewMutation.error instanceof Error + ? previewMutation.error.message + : "the request did not complete."}{" "} + Retry, or use the CLI folder import for very large packages. +

+
+ )} {/* Preview results */} @@ -1514,6 +1546,26 @@ export function CompanyImport() { : `Import ${selectedCount} file${selectedCount === 1 ? "" : "s"}`} + {importMutation.isPending && ( +
+ +

+ Uploading and importing — large packages can take several minutes. Keep this page open. +

+
+ )} + {importMutation.isError && !importMutation.isPending && ( +
+

+ Import failed:{" "} + {importMutation.error instanceof Error + ? importMutation.error.message + : "the request did not complete."}{" "} + Nothing may have been created, or the import stopped partway — check the target company + before retrying. +

+
+ )} {/* Warnings */} {importPreview.warnings.length > 0 && (