glitchgrab 1.62.5 → 1.63.0

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.
package/dist/index.mjs CHANGED
@@ -860,7 +860,7 @@ async function enhanceTextOrThrow(text, token, baseUrl, screenshot, context, ide
860
860
  }
861
861
  throw new Error(unavailable);
862
862
  }
863
- async function findSimilarIssues(description, token, baseUrl, identity, files) {
863
+ async function findSimilarIssues(description, token, baseUrl, identity, files, conversationId) {
864
864
  var _a;
865
865
  try {
866
866
  const url = `${baseUrl != null ? baseUrl : DEFAULT_BASE_URL}/api/v1/reports/similar`;
@@ -873,6 +873,7 @@ async function findSimilarIssues(description, token, baseUrl, identity, files) {
873
873
  body: JSON.stringify({
874
874
  text: description,
875
875
  ...(files == null ? void 0 : files.length) ? { files } : {},
876
+ ...conversationId ? { conversationId } : {},
876
877
  ...signedFields(identity)
877
878
  })
878
879
  });
@@ -6556,8 +6557,10 @@ function ReportDialog({
6556
6557
  setIsSubmitting(true);
6557
6558
  setCheckingSimilar(true);
6558
6559
  const matches = await Promise.race([
6559
- // A PDF still being read is left out rather than waited for.
6560
- (similarFiles.length ? findSimilarIssues2(description.trim(), similarFiles) : findSimilarIssues2(description.trim())).catch(() => null),
6560
+ // A PDF still being read is left out rather than waited for. A draft
6561
+ // from the sheet names its chat, so an issue the reporter already
6562
+ // turned down there is not offered again (#697).
6563
+ (aiConversationId ? findSimilarIssues2(description.trim(), similarFiles.length ? similarFiles : void 0, aiConversationId) : similarFiles.length ? findSimilarIssues2(description.trim(), similarFiles) : findSimilarIssues2(description.trim())).catch(() => null),
6561
6564
  new Promise((resolve) => setTimeout(() => resolve(null), SIMILAR_WAIT_MS))
6562
6565
  ]);
6563
6566
  setCheckingSimilar(false);
@@ -10867,7 +10870,7 @@ function GlitchgrabProviderInner({
10867
10870
  [token, baseUrl, session]
10868
10871
  );
10869
10872
  const findSimilar = useCallback3(
10870
- (description, files) => findSimilarIssues(description, token, baseUrl, identity, files),
10873
+ (description, files, conversationId) => findSimilarIssues(description, token, baseUrl, identity, files, conversationId),
10871
10874
  [token, baseUrl, identity]
10872
10875
  );
10873
10876
  const readFile = useCallback3(