@widgetic/creator 0.4.12 → 0.4.13

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.
@@ -10713,6 +10713,7 @@ Requirements:
10713
10713
  const completedCommitSha = getOperationCommitId(op.metadata);
10714
10714
  const completedCommitTitle = getOperationCommitTitle(op.metadata);
10715
10715
  const completedPreviewBuildErr = getOperationPreviewBuildError(op.metadata);
10716
+ const repositorySaveError = getOperationRepositorySaveError(op.metadata);
10716
10717
  const completedCached = getOperationCached(op.metadata);
10717
10718
  const completedCachedFiles = getOperationCachedFiles(op.metadata);
10718
10719
  const cachedChatSummary = completedCached
@@ -10887,16 +10888,21 @@ Requirements:
10887
10888
  }
10888
10889
 
10889
10890
  const commitShort = completedCommitSha ? completedCommitSha.substring(0, 7) : '';
10891
+ const unsavedText = repositorySaveError
10892
+ || 'Code was not saved to the repository. Retry saves it and records a version.';
10890
10893
  const savedStatus = !completedCommitSha
10891
- ? 'Code was not saved to the repository. Retry saves it and records a version.'
10894
+ ? unsavedText
10892
10895
  : completedPreviewBuildErr
10893
10896
  ? `Code saved (${commitShort}) — building preview…`
10894
10897
  : `Code saved (${commitShort}) — loading preview…`;
10898
+ const shownFailure = [completedPreviewBuildErr, !completedCommitSha ? unsavedText : null]
10899
+ .filter((part): part is string => !!part)
10900
+ .join('\n');
10895
10901
  patchCodegenUiState(generationWidgetId, {
10896
10902
  hasGeneratedCode: true,
10897
10903
  ...(completedCommitSha ? { lastCommitId: completedCommitSha } : {}),
10898
10904
  lastGenerationFailed: !completedCommitSha,
10899
- lastGenerationError: completedPreviewBuildErr,
10905
+ lastGenerationError: shownFailure || null,
10900
10906
  generateCodeStatus: savedStatus,
10901
10907
  });
10902
10908
 
@@ -10919,7 +10925,7 @@ Requirements:
10919
10925
  });
10920
10926
  } else if (!completedCommitSha) {
10921
10927
  showToast('warning', $t('creator.codegen.codeWasNotSaved'), {
10922
- description: $t('creator.codegen.retrySavesItAndRecordsAVersion'),
10928
+ description: repositorySaveError || $t('creator.codegen.retrySavesItAndRecordsAVersion'),
10923
10929
  duration: 8000
10924
10930
  });
10925
10931
  } else {
@@ -10949,7 +10955,7 @@ Requirements:
10949
10955
  panelChat?.addAssistantMessage(
10950
10956
  cachedChatSummary ??
10951
10957
  (!completedCommitSha
10952
- ? 'Code was not saved to the repository. Retry saves it and records a version.'
10958
+ ? unsavedText
10953
10959
  : completedPreviewBuildErr
10954
10960
  ? `Code saved (Commit: ${commitShort}), but preview build failed:\n${completedPreviewBuildErr}\n\nRebuilding preview…`
10955
10961
  : `Code generation completed! Commit: ${commitShort}\nPreview is loading…`),
@@ -11959,6 +11965,13 @@ Requirements:
11959
11965
  return sanitizePreviewBuildError(raw);
11960
11966
  }
11961
11967
 
11968
+ /** Why GitLab did not record a version, from the completed operation. */
11969
+ function getOperationRepositorySaveError(metadata?: Record<string, unknown>): string | null {
11970
+ if (!metadata) return null;
11971
+ const raw = metadata.repositorySaveError ?? metadata.repository_save_error;
11972
+ return typeof raw === 'string' && raw.trim().length > 0 ? raw.trim() : null;
11973
+ }
11974
+
11962
11975
  /**
11963
11976
  * The short design-contract warning the codegen service attached to a
11964
11977
  * completed operation, naming the design properties that will silently do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/creator",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "peerDependencies": {