glitchgrab 1.45.0 → 1.47.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.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, h as ReportPayload, i as ReportResult } from './types-Lldp5noh.mjs';
3
- export { G as GlitchgrabConfig, j as ReportSeverity, k as ReportType, l as RuntimeInfo } from './types-Lldp5noh.mjs';
2
+ import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, h as ReportPayload, i as ReportResult } from './types-DcDF1mXc.mjs';
3
+ export { G as GlitchgrabConfig, j as ReportSeverity, k as ReportType, l as RuntimeInfo } from './types-DcDF1mXc.mjs';
4
4
  import * as React from 'react';
5
5
  import { ReactNode } from 'react';
6
6
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, h as ReportPayload, i as ReportResult } from './types-Lldp5noh.js';
3
- export { G as GlitchgrabConfig, j as ReportSeverity, k as ReportType, l as RuntimeInfo } from './types-Lldp5noh.js';
2
+ import { f as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, F as FeedbackButtonProps, g as GlitchgrabSession, C as CaptureErrorOptions, e as GlitchgrabFeedback, a as BreadcrumbType, B as Breadcrumb, b as CapturedContext, D as DeviceInfo, c as FeedbackPayload, d as FeedbackResult, h as ReportPayload, i as ReportResult } from './types-DcDF1mXc.js';
3
+ export { G as GlitchgrabConfig, j as ReportSeverity, k as ReportType, l as RuntimeInfo } from './types-DcDF1mXc.js';
4
4
  import * as React from 'react';
5
5
  import { ReactNode } from 'react';
6
6
 
package/dist/index.js CHANGED
@@ -747,7 +747,7 @@ async function findSimilarIssues(description, token, baseUrl, identity) {
747
747
  }
748
748
  }
749
749
  async function assistTurn(params, token, baseUrl) {
750
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
750
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
751
751
  const offline = {
752
752
  conversationId: null,
753
753
  question: null,
@@ -781,8 +781,9 @@ async function assistTurn(params, token, baseUrl) {
781
781
  options: (_g = (_f = envelope.data) == null ? void 0 : _f.options) != null ? _g : [],
782
782
  report: (_i = (_h = envelope.data) == null ? void 0 : _h.report) != null ? _i : null,
783
783
  duplicate: (_k = (_j = envelope.data) == null ? void 0 : _j.duplicate) != null ? _k : null,
784
- solved: (_m = (_l = envelope.data) == null ? void 0 : _l.solved) != null ? _m : null,
785
- aboutGlitchgrab: ((_n = envelope.data) == null ? void 0 : _n.aboutGlitchgrab) === true,
784
+ related: (_m = (_l = envelope.data) == null ? void 0 : _l.related) != null ? _m : null,
785
+ solved: (_o = (_n = envelope.data) == null ? void 0 : _n.solved) != null ? _o : null,
786
+ aboutGlitchgrab: ((_p = envelope.data) == null ? void 0 : _p.aboutGlitchgrab) === true,
786
787
  degraded: null
787
788
  };
788
789
  } catch (e) {
@@ -1639,7 +1640,7 @@ function AssistSheet({
1639
1640
  onDegrade(message, retryable);
1640
1641
  }
1641
1642
  async function runTurn(history2) {
1642
- var _a, _b, _c, _d;
1643
+ var _a, _b;
1643
1644
  setBusy(true);
1644
1645
  let result;
1645
1646
  const events = takeEvents();
@@ -1683,8 +1684,9 @@ function AssistSheet({
1683
1684
  setConversationId(result.conversationId);
1684
1685
  onConversationChange == null ? void 0 : onConversationChange(result.conversationId);
1685
1686
  }
1686
- setDuplicate((_a = result.duplicate) != null ? _a : null);
1687
- onDuplicateChange == null ? void 0 : onDuplicateChange((_c = (_b = result.duplicate) == null ? void 0 : _b.number) != null ? _c : null);
1687
+ const attach = result.duplicate ? { ...result.duplicate, kind: "duplicate" } : result.related ? { ...result.related, kind: "related" } : null;
1688
+ setDuplicate(attach);
1689
+ onDuplicateChange == null ? void 0 : onDuplicateChange((_a = attach == null ? void 0 : attach.number) != null ? _a : null, attach == null ? void 0 : attach.kind);
1688
1690
  setGlitchgrabOffer(!!result.aboutGlitchgrab && !!onReportGlitchgrabProblem && !!result.question);
1689
1691
  if (result.solved) {
1690
1692
  setSolved(result.solved);
@@ -1703,7 +1705,7 @@ function AssistSheet({
1703
1705
  }
1704
1706
  if (result.question) {
1705
1707
  setMessages([...history2, { role: "assistant", content: result.question }]);
1706
- setOptions((_d = result.options) != null ? _d : []);
1708
+ setOptions((_b = result.options) != null ? _b : []);
1707
1709
  return;
1708
1710
  }
1709
1711
  onDegrade("The assistant had nothing to add \u2014 write your report below and send it as normal.");
@@ -1776,15 +1778,15 @@ function AssistSheet({
1776
1778
  minWidth: 0
1777
1779
  },
1778
1780
  children: [
1779
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: t2.text, fontWeight: 600 }, children: title ? "Our team is already on this" : `Our team is already on #${duplicate.number}` }),
1781
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: t2.text, fontWeight: 600 }, children: duplicate.kind === "related" ? title ? "Your request goes onto this issue" : `Connected to #${duplicate.number}` : title ? "Our team is already on this" : `Our team is already on #${duplicate.number}` }),
1780
1782
  title && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: { color: t2.textMuted, wordBreak: "break-word" }, children: [
1781
1783
  "#",
1782
1784
  duplicate.number,
1783
1785
  " ",
1784
1786
  duplicate.title
1785
1787
  ] }),
1786
- duplicate.status && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: t2.text, fontWeight: 600 }, children: duplicate.status }),
1787
- footer && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: t2.textMuted }, children: footer })
1788
+ duplicate.status && duplicate.kind !== "related" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: t2.text, fontWeight: 600 }, children: duplicate.status }),
1789
+ footer && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: t2.textMuted }, children: duplicate.kind === "related" ? "Added as a separate request on it, not a repeat \u2014 the team sees both." : footer })
1788
1790
  ]
1789
1791
  }
1790
1792
  );
@@ -1859,6 +1861,7 @@ function AssistSheet({
1859
1861
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1860
1862
  "div",
1861
1863
  {
1864
+ "data-gg-sheet-header": "",
1862
1865
  style: {
1863
1866
  flexShrink: 0,
1864
1867
  padding: "14px 16px",
@@ -1870,7 +1873,7 @@ function AssistSheet({
1870
1873
  minWidth: 0
1871
1874
  },
1872
1875
  children: [
1873
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { minWidth: 0, overflow: "hidden" }, children: [
1876
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: { minWidth: 0 }, children: [
1874
1877
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1875
1878
  "div",
1876
1879
  {
@@ -2453,7 +2456,7 @@ function AssistSheet({
2453
2456
  textTransform: "uppercase",
2454
2457
  color: t2.accent
2455
2458
  },
2456
- children: duplicate ? `What we'll add to #${duplicate.number} \xB7 edit anything` : "Your report \xB7 edit anything"
2459
+ children: duplicate ? `What we'll add to #${duplicate.number}${duplicate.kind === "related" ? " as a related request" : ""} \xB7 edit anything` : "Your report \xB7 edit anything"
2457
2460
  }
2458
2461
  ),
2459
2462
  renderKnownIssue({
@@ -3999,6 +4002,8 @@ function ReportDialog({
3999
4002
  const [selfReportPrefill, setSelfReportPrefill] = (0, import_react.useState)("");
4000
4003
  const [typeChosen, setTypeChosen] = (0, import_react.useState)(false);
4001
4004
  const [duplicateIssueNumber, setDuplicateIssueNumber] = (0, import_react.useState)(null);
4005
+ const [duplicateKind, setDuplicateKind] = (0, import_react.useState)("duplicate");
4006
+ const [addedAsRelated, setAddedAsRelated] = (0, import_react.useState)(false);
4002
4007
  const [similarIssues, setSimilarIssues] = (0, import_react.useState)(null);
4003
4008
  const [checkingSimilar, setCheckingSimilar] = (0, import_react.useState)(false);
4004
4009
  const [attachingTo, setAttachingTo] = (0, import_react.useState)(null);
@@ -4021,6 +4026,7 @@ function ReportDialog({
4021
4026
  const [description, setDescription] = (0, import_react.useState)("");
4022
4027
  const [isSubmitting, setIsSubmitting] = (0, import_react.useState)(false);
4023
4028
  const [submitted, setSubmitted] = (0, import_react.useState)(false);
4029
+ const [queuedMessage, setQueuedMessage] = (0, import_react.useState)(null);
4024
4030
  const [screenshots, setScreenshots] = (0, import_react.useState)([]);
4025
4031
  const [pageShot, setPageShot] = (0, import_react.useState)(null);
4026
4032
  const [shotPending, setShotPending] = (0, import_react.useState)(false);
@@ -4434,6 +4440,7 @@ function ReportDialog({
4434
4440
  setReportType("BUG");
4435
4441
  setTypeChosen(false);
4436
4442
  setDuplicateIssueNumber(null);
4443
+ setDuplicateKind("duplicate");
4437
4444
  setSimilarIssues(null);
4438
4445
  setPickedSimilar(null);
4439
4446
  setCheckingSimilar(false);
@@ -4626,7 +4633,7 @@ function ReportDialog({
4626
4633
  }
4627
4634
  };
4628
4635
  const handleSubmit = async (opts) => {
4629
- var _a2;
4636
+ var _a2, _b, _c;
4630
4637
  try {
4631
4638
  if (isSubmitting) return;
4632
4639
  if (isRating) {
@@ -4664,6 +4671,7 @@ function ReportDialog({
4664
4671
  return;
4665
4672
  }
4666
4673
  const duplicateOf = (_a2 = opts == null ? void 0 : opts.duplicateOf) != null ? _a2 : duplicateIssueNumber;
4674
+ const attachKind = (opts == null ? void 0 : opts.duplicateOf) ? (_b = opts.kind) != null ? _b : "duplicate" : duplicateKind;
4667
4675
  if (findSimilarIssues2 && !(opts == null ? void 0 : opts.skipSimilar) && !duplicateOf && !aiConversationId) {
4668
4676
  setIsSubmitting(true);
4669
4677
  setCheckingSimilar(true);
@@ -4699,6 +4707,7 @@ function ReportDialog({
4699
4707
  }
4700
4708
  if (duplicateOf) {
4701
4709
  metadata.duplicateIssueNumber = String(duplicateOf);
4710
+ if (attachKind === "related") metadata.duplicateKind = "related";
4702
4711
  }
4703
4712
  if (aiConversationId) {
4704
4713
  metadata.aiConversationId = aiConversationId;
@@ -4712,18 +4721,23 @@ function ReportDialog({
4712
4721
  );
4713
4722
  if (result) {
4714
4723
  setAddedToIssue(duplicateOf && result.issueNumber === duplicateOf ? duplicateOf : null);
4724
+ setAddedAsRelated(!!duplicateOf && result.issueNumber === duplicateOf && attachKind === "related");
4725
+ const queued = result.status === "QUEUED" && !!result.message;
4726
+ setQueuedMessage(queued ? (_c = result.message) != null ? _c : null : null);
4715
4727
  setSubmitted(true);
4716
4728
  setDescription("");
4717
4729
  setScreenshots([]);
4718
4730
  setAttachments([]);
4719
4731
  setAiConversationId(null);
4720
4732
  setDuplicateIssueNumber(null);
4733
+ setDuplicateKind("duplicate");
4721
4734
  setSimilarIssues(null);
4722
4735
  setPickedSimilar(null);
4723
4736
  setTimeout(() => {
4724
4737
  setSubmitted(false);
4738
+ setQueuedMessage(null);
4725
4739
  handleClose();
4726
- }, 2e3);
4740
+ }, queued ? 6e3 : 2e3);
4727
4741
  }
4728
4742
  setIsSubmitting(false);
4729
4743
  setAttachingTo(null);
@@ -5033,7 +5047,18 @@ function ReportDialog({
5033
5047
  fontSize: "14px",
5034
5048
  fontWeight: 500
5035
5049
  },
5036
- children: addedToIssue ? `Added to #${addedToIssue}. Thank you!` : `${getTypeLabel(reportType)} sent. Thank you!`
5050
+ children: queuedMessage ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5051
+ "span",
5052
+ {
5053
+ style: {
5054
+ // amber-500 reads on the dark panel, amber-700 on the light one
5055
+ color: isDark ? "#f59e0b" : "#b45309",
5056
+ fontWeight: 400,
5057
+ lineHeight: 1.5
5058
+ },
5059
+ children: queuedMessage
5060
+ }
5061
+ ) : addedToIssue ? `Added to #${addedToIssue}${addedAsRelated ? " as a related request" : ""}. Thank you!` : `${getTypeLabel(reportType)} sent. Thank you!`
5037
5062
  }
5038
5063
  ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
5039
5064
  step === 1 && headerSlot ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { marginBottom: "14px" }, children: headerSlot }) : null,
@@ -6278,8 +6303,8 @@ function ReportDialog({
6278
6303
  },
6279
6304
  children: [
6280
6305
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
6281
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { color: t2.text, fontWeight: 600, fontSize: "13px" }, children: "Our team may already have this" }),
6282
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { color: t2.textMuted, fontSize: "12px", lineHeight: 1.5 }, children: similarIssues.length > 1 ? "Pick the one that matches \u2014 your report is added to it, so the team sees everyone hitting it in one place." : "If it's the same problem, pick it \u2014 your report is added to it, so the team sees everyone hitting it in one place." })
6306
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { color: t2.text, fontWeight: 600, fontSize: "13px" }, children: "Our team may already have this, or something close" }),
6307
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: { color: t2.textMuted, fontSize: "12px", lineHeight: 1.5 }, children: similarIssues.length > 1 ? "Pick the one that matches. Same problem, or a different request for the same feature \u2014 it's added to that issue, so the team has it in one place." : "Same problem, or a different request for the same feature? Pick it \u2014 it's added to that issue, so the team has it in one place." })
6283
6308
  ] }),
6284
6309
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
6285
6310
  "div",
@@ -6384,7 +6409,8 @@ function ReportDialog({
6384
6409
  if (!pickedSimilar) return;
6385
6410
  setAttachingTo(pickedSimilar);
6386
6411
  setDuplicateIssueNumber(pickedSimilar);
6387
- void handleSubmit({ duplicateOf: pickedSimilar });
6412
+ setDuplicateKind("duplicate");
6413
+ void handleSubmit({ duplicateOf: pickedSimilar, kind: "duplicate" });
6388
6414
  },
6389
6415
  style: {
6390
6416
  width: "100%",
@@ -6399,7 +6425,7 @@ function ReportDialog({
6399
6425
  cursor: isSubmitting || !pickedSimilar ? "not-allowed" : "pointer",
6400
6426
  fontFamily: "inherit"
6401
6427
  },
6402
- children: typeof attachingTo === "number" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
6428
+ children: typeof attachingTo === "number" && duplicateKind !== "related" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
6403
6429
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ButtonSpinner, {}),
6404
6430
  "Adding to #",
6405
6431
  attachingTo,
@@ -6407,6 +6433,39 @@ function ReportDialog({
6407
6433
  ] }) : pickedSimilar ? `Add to #${pickedSimilar}` : "Pick the matching issue"
6408
6434
  }
6409
6435
  ),
6436
+ pickedSimilar && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
6437
+ "button",
6438
+ {
6439
+ type: "button",
6440
+ disabled: isSubmitting,
6441
+ onClick: () => {
6442
+ setAttachingTo(pickedSimilar);
6443
+ setDuplicateIssueNumber(pickedSimilar);
6444
+ setDuplicateKind("related");
6445
+ void handleSubmit({ duplicateOf: pickedSimilar, kind: "related" });
6446
+ },
6447
+ style: {
6448
+ width: "100%",
6449
+ minHeight: "40px",
6450
+ marginTop: "-4px",
6451
+ padding: "9px 10px",
6452
+ borderRadius: "8px",
6453
+ border: "1px solid rgba(245,158,11,0.4)",
6454
+ backgroundColor: "transparent",
6455
+ color: isSubmitting ? t2.textMuted : t2.text,
6456
+ fontSize: "13px",
6457
+ fontWeight: 600,
6458
+ cursor: isSubmitting ? "not-allowed" : "pointer",
6459
+ fontFamily: "inherit"
6460
+ },
6461
+ children: typeof attachingTo === "number" && duplicateKind === "related" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
6462
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ButtonSpinner, {}),
6463
+ "Adding to #",
6464
+ attachingTo,
6465
+ "\u2026"
6466
+ ] }) : `Related request \u2014 add to #${pickedSimilar}`
6467
+ }
6468
+ ),
6410
6469
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
6411
6470
  "button",
6412
6471
  {
@@ -6753,7 +6812,10 @@ function ReportDialog({
6753
6812
  setTypeChosen(true);
6754
6813
  setStep(2);
6755
6814
  },
6756
- onDuplicateChange: setDuplicateIssueNumber,
6815
+ onDuplicateChange: (issueNumber, kind) => {
6816
+ setDuplicateIssueNumber(issueNumber);
6817
+ setDuplicateKind(issueNumber && kind === "related" ? "related" : "duplicate");
6818
+ },
6757
6819
  onConversationChange: setAiConversationId,
6758
6820
  onFinish: handleClose,
6759
6821
  rating,