glitchgrab 1.68.1 → 1.68.2

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
@@ -2036,18 +2036,6 @@ function AnnotationCanvas({ imageSrc, onSave, onCancel }) {
2036
2036
  }
2037
2037
  );
2038
2038
  }
2039
- var SEVERITY_LEVELS = [
2040
- "low",
2041
- "medium",
2042
- "high",
2043
- "critical"
2044
- ];
2045
- var SEVERITY_LABELS = {
2046
- low: "Low",
2047
- medium: "Medium",
2048
- high: "High",
2049
- critical: "Critical"
2050
- };
2051
2039
  var MAX_ASSIST_IMAGES = 3;
2052
2040
  var MAX_ASSIST_IMAGE_CHARS = 35e5;
2053
2041
  var MAX_ASSIST_FILES = 3;
@@ -2824,11 +2812,7 @@ function AssistSheet({
2824
2812
  onDescriptionChange,
2825
2813
  issueTitle,
2826
2814
  onIssueTitleChange,
2827
- severity,
2828
- onSeverityChange,
2829
- showSeverity,
2830
2815
  validationError,
2831
- severityRefused = false,
2832
2816
  onDuplicateChange,
2833
2817
  onConversationChange,
2834
2818
  isSubmitting,
@@ -2844,7 +2828,6 @@ function AssistSheet({
2844
2828
  }) {
2845
2829
  var _a;
2846
2830
  const narrow = useIsNarrow();
2847
- const severityAsked = showSeverity && currentTile === "BUG";
2848
2831
  const [messages, setMessages] = useState2([]);
2849
2832
  const [input, setInput] = useState2("");
2850
2833
  const [busy, setBusy] = useState2(false);
@@ -2870,15 +2853,13 @@ function AssistSheet({
2870
2853
  const [duplicate, setDuplicate] = useState2(null);
2871
2854
  const [glitchgrabOffer, setGlitchgrabOffer] = useState2(false);
2872
2855
  const [solved, setSolved] = useState2(null);
2873
- const needsSeverity = (tile) => showSeverity && tile === "BUG" && !severity;
2874
2856
  const [phase, setPhase] = useState2(
2875
- () => !typePicked ? "type" : currentTile === "RATING" ? "rating" : needsSeverity(currentTile) ? "severity" : "chat"
2857
+ () => !typePicked ? "type" : currentTile === "RATING" ? "rating" : "chat"
2876
2858
  );
2877
2859
  const scrollRef = useRef2(null);
2878
2860
  const draftRef = useRef2(null);
2879
2861
  const composerRef = useRef2(null);
2880
2862
  const seededRef = useRef2(false);
2881
- const seedPendingRef = useRef2(false);
2882
2863
  const resumeAskRef = useRef2(false);
2883
2864
  const eventsRef = useRef2([]);
2884
2865
  const inferredTypeRef = useRef2(false);
@@ -3146,10 +3127,6 @@ function AssistSheet({
3146
3127
  }
3147
3128
  return;
3148
3129
  }
3149
- if (phase === "severity") {
3150
- seedPendingRef.current = true;
3151
- return;
3152
- }
3153
3130
  seedFromDescription();
3154
3131
  }, []);
3155
3132
  function seedFromDescription() {
@@ -3159,14 +3136,6 @@ function AssistSheet({
3159
3136
  setMessages(history2);
3160
3137
  void runTurn(history2);
3161
3138
  }
3162
- function answerSeverity(value) {
3163
- onSeverityChange(value);
3164
- setPhase("chat");
3165
- if (seedPendingRef.current) {
3166
- seedPendingRef.current = false;
3167
- seedFromDescription();
3168
- }
3169
- }
3170
3139
  function send2(text) {
3171
3140
  const value = text.trim();
3172
3141
  if (!value || busy) return;
@@ -3259,7 +3228,6 @@ function AssistSheet({
3259
3228
  setShowChats(false);
3260
3229
  setViewingChat(null);
3261
3230
  resumeAskRef.current = (last == null ? void 0 : last.role) === "user";
3262
- seedPendingRef.current = false;
3263
3231
  }
3264
3232
  useEffect2(() => {
3265
3233
  if (!resumeAskRef.current) return;
@@ -3647,7 +3615,6 @@ function AssistSheet({
3647
3615
  ),
3648
3616
  /* @__PURE__ */ jsxs3("div", { style: { fontSize: "11.5px", color: t.textMuted, marginTop: "3px" }, children: [
3649
3617
  phase === "type" || !typePicked || inferredTypeRef.current && phase !== "draft" ? null : reportTypeLabel,
3650
- phase !== "type" && severityAsked && severity ? ` \xB7 ${SEVERITY_LABELS[severity]}` : null,
3651
3618
  projectSlot ? /* @__PURE__ */ jsx3("span", { style: { marginLeft: "6px" }, children: projectSlot }) : null
3652
3619
  ] })
3653
3620
  ] }),
@@ -3758,63 +3725,6 @@ function AssistSheet({
3758
3725
  minWidth: 0
3759
3726
  },
3760
3727
  children: /* @__PURE__ */ jsxs3("div", { style: { display: showChats ? "none" : "contents" }, children: [
3761
- phase === "severity" && /* @__PURE__ */ jsxs3("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
3762
- resumeCard,
3763
- /* @__PURE__ */ jsxs3("div", { style: { display: "flex", gap: "8px" }, children: [
3764
- /* @__PURE__ */ jsx3(Avatar, { who: "assistant", theme: t }),
3765
- /* @__PURE__ */ jsx3(
3766
- "div",
3767
- {
3768
- style: {
3769
- padding: "9px 12px",
3770
- borderRadius: "12px 12px 12px 4px",
3771
- backgroundColor: t.bgSecondary,
3772
- fontSize: "13px",
3773
- lineHeight: 1.55,
3774
- maxWidth: "88%"
3775
- },
3776
- children: "How bad is it?"
3777
- }
3778
- )
3779
- ] }),
3780
- /* @__PURE__ */ jsx3(
3781
- "div",
3782
- {
3783
- role: "radiogroup",
3784
- "aria-label": "Severity",
3785
- style: {
3786
- display: "flex",
3787
- flexWrap: "wrap",
3788
- gap: "6px",
3789
- paddingLeft: "32px"
3790
- },
3791
- children: SEVERITY_LEVELS.map((s) => /* @__PURE__ */ jsx3(
3792
- "button",
3793
- {
3794
- type: "button",
3795
- role: "radio",
3796
- "aria-checked": severity === s,
3797
- "data-gg-chip": "",
3798
- "data-gg-severity": s,
3799
- onClick: () => answerSeverity(s),
3800
- style: {
3801
- border: `1px solid ${t.inputBorder}`,
3802
- background: "transparent",
3803
- color: t.textMuted,
3804
- borderRadius: "999px",
3805
- // Same as the picker and option chips — one chip size.
3806
- padding: "8px 12px",
3807
- fontSize: "12px",
3808
- fontFamily: "inherit",
3809
- cursor: "pointer"
3810
- },
3811
- children: SEVERITY_LABELS[s]
3812
- },
3813
- s
3814
- ))
3815
- }
3816
- )
3817
- ] }),
3818
3728
  phase === "rating" && !submitted && /* @__PURE__ */ jsxs3("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: [
3819
3729
  /* @__PURE__ */ jsxs3("div", { style: { display: "flex", gap: "8px" }, children: [
3820
3730
  /* @__PURE__ */ jsx3(Avatar, { who: "assistant", theme: t }),
@@ -4417,71 +4327,6 @@ function AssistSheet({
4417
4327
  }
4418
4328
  }
4419
4329
  ),
4420
- severityAsked && /* @__PURE__ */ jsxs3("div", { children: [
4421
- /* @__PURE__ */ jsxs3(
4422
- "span",
4423
- {
4424
- style: {
4425
- fontSize: "11.5px",
4426
- color: t.textMuted,
4427
- display: "block",
4428
- marginBottom: "6px"
4429
- },
4430
- children: [
4431
- "How bad is it?",
4432
- !severity && /* @__PURE__ */ jsx3(
4433
- "span",
4434
- {
4435
- style: {
4436
- marginLeft: "6px",
4437
- fontSize: "11px",
4438
- color: severityRefused ? "#ef4444" : t.textMuted
4439
- },
4440
- children: "\xB7 required"
4441
- }
4442
- )
4443
- ]
4444
- }
4445
- ),
4446
- /* @__PURE__ */ jsx3(
4447
- "div",
4448
- {
4449
- role: "radiogroup",
4450
- "aria-label": "Severity",
4451
- style: { display: "flex", gap: "6px" },
4452
- children: SEVERITY_LEVELS.map((s) => {
4453
- const on = severity === s;
4454
- return /* @__PURE__ */ jsx3(
4455
- "button",
4456
- {
4457
- type: "button",
4458
- onClick: () => onSeverityChange(s),
4459
- role: "radio",
4460
- "aria-checked": on,
4461
- style: {
4462
- flex: 1,
4463
- minWidth: 0,
4464
- padding: "8px 2px",
4465
- borderRadius: "8px",
4466
- border: `1px solid ${on ? t.accent : severityRefused ? "#ef4444" : t.inputBorder}`,
4467
- backgroundColor: on ? t.accent : "transparent",
4468
- color: on ? t.accentText : t.textMuted,
4469
- fontSize: "12px",
4470
- fontWeight: 600,
4471
- fontFamily: "inherit",
4472
- whiteSpace: "nowrap",
4473
- overflow: "hidden",
4474
- textOverflow: "ellipsis",
4475
- cursor: "pointer"
4476
- },
4477
- children: SEVERITY_LABELS[s]
4478
- },
4479
- s
4480
- );
4481
- })
4482
- }
4483
- )
4484
- ] }),
4485
4330
  attachmentCount > 0 && /* @__PURE__ */ jsxs3("span", { style: { fontSize: "11.5px", color: t.textMuted }, children: [
4486
4331
  attachmentCount,
4487
4332
  " ",
@@ -4537,7 +4382,7 @@ function AssistSheet({
4537
4382
  ]
4538
4383
  }
4539
4384
  ),
4540
- !submitted && !showChats && phase !== "severity" && /* @__PURE__ */ jsxs3(
4385
+ !submitted && !showChats && /* @__PURE__ */ jsxs3(
4541
4386
  "div",
4542
4387
  {
4543
4388
  style: {
@@ -5798,7 +5643,6 @@ function detectHostAccent() {
5798
5643
  return null;
5799
5644
  }
5800
5645
  }
5801
- var SEVERITY_REQUIRED = "Pick how bad it is before sending.";
5802
5646
  var SHOT_WAIT_MS = 3e3;
5803
5647
  var SIMILAR_WAIT_MS = 2500;
5804
5648
  var MAX_SIMILAR_SHOWN = 3;
@@ -6029,7 +5873,6 @@ function ReportDialog({
6029
5873
  assistContext = null,
6030
5874
  transcribeAudio: transcribeAudio2,
6031
5875
  types,
6032
- showSeverity = true,
6033
5876
  captureScreenshot = captureDefaultScreenshot,
6034
5877
  reporter: reporter2,
6035
5878
  onClose,
@@ -6156,14 +5999,12 @@ function ReportDialog({
6156
5999
  }, [isOpen]);
6157
6000
  const [step, setStep] = useState4(1);
6158
6001
  const [reportType, setReportType] = useState4("BUG");
6159
- const [severity, setSeverity] = useState4(null);
6160
6002
  const [validationError, setValidationError] = useState4(null);
6161
6003
  const [placeholderIdx, setPlaceholderIdx] = useState4(0);
6162
6004
  const [rating, setRating] = useState4(0);
6163
6005
  const [hoveredStar, setHoveredStar] = useState4(0);
6164
6006
  const isRating = reportType === "RATING";
6165
6007
  const submitDisabled = isSubmitting || (isRating ? rating < 1 : !description.trim());
6166
- const needsSeverity = validationError === SEVERITY_REQUIRED && showSeverity && reportType === "BUG" && !severity;
6167
6008
  const availableTypes = types != null ? types : [
6168
6009
  "BUG",
6169
6010
  "FEATURE_REQUEST",
@@ -6508,7 +6349,6 @@ function ReportDialog({
6508
6349
  setPickedSimilar(null);
6509
6350
  setCheckingSimilar(false);
6510
6351
  setAttachingTo(null);
6511
- setSeverity(null);
6512
6352
  setValidationError(null);
6513
6353
  setSelfReportFrom(null);
6514
6354
  setVoiceError(null);
@@ -6734,11 +6574,6 @@ function ReportDialog({
6734
6574
  setStep(2);
6735
6575
  return;
6736
6576
  }
6737
- if (showSeverity && reportType === "BUG" && !severity) {
6738
- setValidationError(SEVERITY_REQUIRED);
6739
- setStep(2);
6740
- return;
6741
- }
6742
6577
  const duplicateOf = (_a2 = opts == null ? void 0 : opts.duplicateOf) != null ? _a2 : duplicateIssueNumber;
6743
6578
  const attachKind = (opts == null ? void 0 : opts.duplicateOf) ? (_b = opts.kind) != null ? _b : "duplicate" : duplicateKind;
6744
6579
  if (findSimilarIssues2 && !(opts == null ? void 0 : opts.skipSimilar) && !duplicateOf) {
@@ -6779,9 +6614,6 @@ function ReportDialog({
6779
6614
  const metadata = {};
6780
6615
  if (shots.length > 0) metadata.screenshots = JSON.stringify(shots);
6781
6616
  if (attachments.length > 0) metadata.attachments = JSON.stringify(attachments);
6782
- if (showSeverity && reportType === "BUG" && severity) {
6783
- metadata.severity = severity;
6784
- }
6785
6617
  if (duplicateOf) {
6786
6618
  metadata.duplicateIssueNumber = String(duplicateOf);
6787
6619
  if (attachKind === "related") metadata.duplicateKind = "related";
@@ -8547,82 +8379,6 @@ function ReportDialog({
8547
8379
  }
8548
8380
  )
8549
8381
  ] }),
8550
- showSeverity && reportType === "BUG" && /* @__PURE__ */ jsxs5("div", { style: { marginTop: "10px" }, children: [
8551
- /* @__PURE__ */ jsxs5(
8552
- "span",
8553
- {
8554
- style: {
8555
- fontSize: "12px",
8556
- color: t.textMuted,
8557
- marginBottom: "6px",
8558
- display: "flex",
8559
- alignItems: "center",
8560
- gap: "6px"
8561
- },
8562
- children: [
8563
- "How bad is it?",
8564
- /* @__PURE__ */ jsx5(
8565
- "span",
8566
- {
8567
- style: {
8568
- color: severity ? t.textMuted : needsSeverity ? "#ef4444" : t.textMuted,
8569
- fontSize: "11px"
8570
- },
8571
- children: severity ? "" : "\xB7 required"
8572
- }
8573
- )
8574
- ]
8575
- }
8576
- ),
8577
- /* @__PURE__ */ jsx5(
8578
- "div",
8579
- {
8580
- role: "radiogroup",
8581
- "aria-label": "Severity",
8582
- style: { display: "flex", gap: "6px" },
8583
- children: SEVERITY_LEVELS.map((s) => {
8584
- const on = severity === s;
8585
- return /* @__PURE__ */ jsx5(
8586
- "button",
8587
- {
8588
- type: "button",
8589
- role: "radio",
8590
- "aria-checked": on,
8591
- onClick: () => {
8592
- setSeverity(s);
8593
- if (validationError)
8594
- setValidationError(null);
8595
- },
8596
- style: {
8597
- flex: 1,
8598
- minWidth: 0,
8599
- // 9px + 12px line + borders clears a 36px
8600
- // tap target; 6px left it at ~29px.
8601
- padding: "9px 2px",
8602
- borderRadius: "6px",
8603
- border: `1px solid ${on ? t.accent : needsSeverity ? "#ef4444" : t.inputBorder}`,
8604
- background: on ? t.accent : "transparent",
8605
- color: on ? t.accentText : t.text,
8606
- fontSize: "12px",
8607
- fontWeight: 600,
8608
- cursor: "pointer",
8609
- fontFamily: "inherit",
8610
- whiteSpace: "nowrap",
8611
- // Four labels where there were three: clip
8612
- // rather than spill if a host squeezes the
8613
- // dialog below ~260px.
8614
- overflow: "hidden",
8615
- textOverflow: "ellipsis",
8616
- transition: "all 0.15s ease"
8617
- },
8618
- children: SEVERITY_LABELS[s]
8619
- },
8620
- s
8621
- );
8622
- })
8623
- }
8624
- )
8625
- ] }),
8626
8382
  validationError && /* @__PURE__ */ jsx5(
8627
8383
  "p",
8628
8384
  {
@@ -8973,14 +8729,6 @@ function ReportDialog({
8973
8729
  },
8974
8730
  issueTitle,
8975
8731
  onIssueTitleChange: setIssueTitle,
8976
- severity,
8977
- onSeverityChange: (value) => {
8978
- setSeverity(value);
8979
- if (validationError) setValidationError(null);
8980
- },
8981
- showSeverity,
8982
- validationError,
8983
- severityRefused: needsSeverity,
8984
8732
  isSubmitting,
8985
8733
  submitted,
8986
8734
  onSend: () => void handleSubmit(),
@@ -11021,7 +10769,6 @@ function GlitchgrabProviderInner({
11021
10769
  children,
11022
10770
  fallback,
11023
10771
  types,
11024
- showSeverity,
11025
10772
  ignoreErrors,
11026
10773
  release: release2,
11027
10774
  context: appContext2,
@@ -11596,7 +11343,6 @@ function GlitchgrabProviderInner({
11596
11343
  reportGlitchgrabProblem: glitchgrabReport ? reportGlitchgrabProblem : void 0,
11597
11344
  transcribeAudio: aiBlockedUnsigned ? void 0 : transcribe,
11598
11345
  types,
11599
- showSeverity,
11600
11346
  reporter: reporter2,
11601
11347
  chatHistoryKey: chatHistoryKey("sdk", token, session == null ? void 0 : session.userId),
11602
11348
  headerSlot: projectName ? /* @__PURE__ */ jsxs7("div", { style: { fontSize: 11, color: "#9aa0a6" }, children: [