@gallop.software/studio 0.1.87 → 0.1.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -310,6 +310,23 @@ var progressStyles = {
310
310
  white-space: nowrap;
311
311
  overflow: hidden;
312
312
  text-overflow: ellipsis;
313
+ `,
314
+ errorList: _react3.css`
315
+ margin-top: 12px;
316
+ padding: 12px;
317
+ background: #fef2f2;
318
+ border: 1px solid #fecaca;
319
+ border-radius: 6px;
320
+ max-height: 200px;
321
+ overflow-y: auto;
322
+ `,
323
+ errorItem: _react3.css`
324
+ font-size: ${_chunkUFCWGUAGjs.fontSize.xs};
325
+ color: #991b1b;
326
+ margin: 0 0 4px;
327
+ &:last-child {
328
+ margin-bottom: 0;
329
+ }
313
330
  `
314
331
  };
315
332
  function ProgressModal({
@@ -331,26 +348,36 @@ function ProgressModal({
331
348
  " image",
332
349
  (_nullishCoalesce(progress.processed, () => ( progress.current))) !== 1 ? "s" : "",
333
350
  " before stopping."
334
- ] }) : isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { css: styles.message, children: [
335
- "Processed ",
336
- progress.processed,
337
- " image",
338
- progress.processed !== 1 ? "s" : "",
339
- ".",
340
- progress.orphansRemoved !== void 0 && progress.orphansRemoved > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
341
- " Removed ",
342
- progress.orphansRemoved,
343
- " orphaned thumbnail",
344
- progress.orphansRemoved !== 1 ? "s" : "",
345
- "."
346
- ] }) : null,
347
- progress.errors !== void 0 && progress.errors > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
348
- " ",
349
- progress.errors,
350
- " error",
351
- progress.errors !== 1 ? "s" : "",
352
- " occurred."
353
- ] }) : null
351
+ ] }) : isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
352
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { css: styles.message, children: [
353
+ "Processed ",
354
+ progress.processed,
355
+ " image",
356
+ progress.processed !== 1 ? "s" : "",
357
+ ".",
358
+ progress.orphansRemoved !== void 0 && progress.orphansRemoved > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
359
+ " Removed ",
360
+ progress.orphansRemoved,
361
+ " orphaned thumbnail",
362
+ progress.orphansRemoved !== 1 ? "s" : "",
363
+ "."
364
+ ] }) : null,
365
+ progress.errors !== void 0 && progress.errors > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
366
+ " ",
367
+ progress.errors,
368
+ " error",
369
+ progress.errors !== 1 ? "s" : "",
370
+ " occurred."
371
+ ] }) : null
372
+ ] }),
373
+ progress.errorMessages && progress.errorMessages.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: progressStyles.errorList, children: [
374
+ progress.errorMessages.slice(0, 10).map((msg, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: progressStyles.errorItem, children: msg }, i)),
375
+ progress.errorMessages.length > 10 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { css: progressStyles.errorItem, children: [
376
+ "...and ",
377
+ progress.errorMessages.length - 10,
378
+ " more"
379
+ ] })
380
+ ] })
354
381
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
355
382
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { css: styles.message, children: progress.status === "cleanup" ? "Cleaning up orphaned files..." : `Processing images...` }),
356
383
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: progressStyles.progressContainer, children: [
@@ -1704,6 +1731,7 @@ function StudioToolbar() {
1704
1731
  setShowProgress(true);
1705
1732
  let synced = 0;
1706
1733
  let errors = 0;
1734
+ const errorMessages = [];
1707
1735
  try {
1708
1736
  for (let i = 0; i < imageKeys.length; i++) {
1709
1737
  const imageKey = imageKeys[i];
@@ -1728,13 +1756,18 @@ function StudioToolbar() {
1728
1756
  return;
1729
1757
  }
1730
1758
  errors++;
1759
+ errorMessages.push(data.error || `Failed: ${imageKey}`);
1731
1760
  } else if (_optionalChain([data, 'access', _37 => _37.synced, 'optionalAccess', _38 => _38.length]) > 0) {
1732
1761
  synced++;
1733
1762
  } else if (_optionalChain([data, 'access', _39 => _39.errors, 'optionalAccess', _40 => _40.length]) > 0) {
1734
1763
  errors++;
1764
+ for (const errMsg of data.errors) {
1765
+ errorMessages.push(errMsg);
1766
+ }
1735
1767
  }
1736
- } catch (e4) {
1768
+ } catch (err) {
1737
1769
  errors++;
1770
+ errorMessages.push(`Network error: ${imageKey}`);
1738
1771
  }
1739
1772
  }
1740
1773
  setProgressState({
@@ -1743,7 +1776,8 @@ function StudioToolbar() {
1743
1776
  percent: 100,
1744
1777
  status: "complete",
1745
1778
  processed: synced,
1746
- errors
1779
+ errors,
1780
+ errorMessages: errorMessages.length > 0 ? errorMessages : void 0
1747
1781
  });
1748
1782
  clearSelection();
1749
1783
  triggerRefresh();
@@ -3731,7 +3765,7 @@ function StudioDetailView() {
3731
3765
  try {
3732
3766
  const data = JSON.parse(line.slice(6));
3733
3767
  setProcessProgress(data);
3734
- } catch (e5) {
3768
+ } catch (e4) {
3735
3769
  }
3736
3770
  }
3737
3771
  }
@@ -4661,4 +4695,4 @@ var StudioUI_default = StudioUI;
4661
4695
 
4662
4696
 
4663
4697
  exports.StudioUI = StudioUI; exports.default = StudioUI_default;
4664
- //# sourceMappingURL=StudioUI-ZBSTYTUV.js.map
4698
+ //# sourceMappingURL=StudioUI-Y35A2T7S.js.map