@sphoro/bugcatch-web-sdk 0.18.0 → 0.20.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/README.md CHANGED
@@ -55,7 +55,7 @@ BugCatch.init({
55
55
  ```html
56
56
  <!-- Pin the version. Without one the CDN serves whatever is latest, so a
57
57
  future release changes behaviour on a site nobody redeployed. -->
58
- <script src="https://unpkg.com/@sphoro/bugcatch-web-sdk@0.18.0/dist/bugcatch.umd.js"></script>
58
+ <script src="https://unpkg.com/@sphoro/bugcatch-web-sdk@0.20.0/dist/bugcatch.umd.js"></script>
59
59
  <script>
60
60
  BugCatch.init({ apiBase: '…', apiKey: 'bc_live_…', projectId: '…' });
61
61
  </script>
@@ -372,8 +372,8 @@ On top of that:
372
372
  | `onError` | — | See [Events](#events). |
373
373
  | `widget` | `true` | Floating launcher and panel. `false` to drive everything from your own UI. |
374
374
  | `widgetPosition` | `'bottom-right'` | `bottom-left`, `top-right`, `top-left`. |
375
- | `theme` | `'auto'` | `auto` follows the system; `light` / `dark` pin it. A visitor's own choice in the widget wins on later visits. |
376
- | `accent` | `'#4F46E5'` | Any CSS colour. |
375
+ | `theme` | `'auto'` | `auto` follows the system; `light` / `dark` pin it. Visitors can change it from the panel's header, and their choice wins on later visits. |
376
+ | `accent` | `null` | Any CSS colour, for the launcher, buttons and the assistant's orb. Text on it is white or near-black, whichever reads. `null` is ink: black on light, white on dark. |
377
377
  | `captureConsole` / `captureNetwork` / `captureErrors` | `true` | Each capture can be switched off. |
378
378
  | `consoleLimit` / `networkLimit` | `100` / `50` | Entries retained. |
379
379
  | `attachments` | `true` | Offer screenshot, recording and file attach. |
@@ -414,6 +414,8 @@ BugCatch.off(event, handler);
414
414
  await BugCatch.myReports(); // everything filed from this browser
415
415
  await BugCatch.myReport(bugId); // one report, with timeline and assistant phase
416
416
  await BugCatch.replyToReport(bugId, { body, attachments });
417
+ await BugCatch.verifyFix(bugId, { result, resolvedAt, note }); // 'CONFIRMED' | 'STILL_HAPPENING'
418
+ await BugCatch.rate(bugId, { score, comment }); // 1–5, once it is settled
417
419
  BugCatch.unreadUpdates(); BugCatch.markUpdateRead(id); BugCatch.markReportRead(bugId); BugCatch.markUpdatesRead();
418
420
  BugCatch.hasReports(); BugCatch.forgetReports();
419
421
 
@@ -716,6 +718,52 @@ attachments stay images and video, because they are typed `SCREENSHOT` or
716
718
  `report.canReply` says whether this reader can write back; the widget hides its
717
719
  composer when it is false rather than offering a box that would fail on send.
718
720
 
721
+ ### Asking how it went
722
+
723
+ Once a report is resolved or closed, the widget asks the reporter **How did we
724
+ do?** under it: five stars, one tap to send, and a box for a note after the
725
+ tap rather than before — a form that asks for a sentence first is a form people
726
+ close. Their list of reports says **Rate it** against the settled ones still
727
+ waiting for a rating, and shows the score on the ones that have one.
728
+
729
+ The same rating is asked for on the reporter's own page and in the email that
730
+ tells them it was fixed, so whichever they answer is the one that counts.
731
+ Rating again replaces the earlier score. Whether a project asks at all is
732
+ **Project Settings → Resolutions → Ask the reporter to rate it**, on by default.
733
+
734
+ The reporter does not have to go looking for it. The next time they open the
735
+ widget, the latest report settled for them in the last 30 days waits above the
736
+ form as a **How did we do?** card: one tap on a star rates it. How firmly it
737
+ asks is **Project Settings → Resolutions → Where the widget asks**:
738
+
739
+ | Setting | The first screen |
740
+ | --- | --- |
741
+ | Only on the report | Nothing. The stars are on the report's own screen, under Your reports. |
742
+ | When they next open the widget (default) | The card, with **Not now**, which hides that report's card on this device. |
743
+ | Before they can report again | The card, and Send and Talk to the team wait until they have rated. One rating unlocks the form; if the rating cannot be sent, **Skip for now** appears so an outage never blocks a report. |
744
+
745
+ `myReports()` rows carry it as `ratingDue`: `'ask'`, `'require'` or `null`,
746
+ with `resolvedAt` beside it. Only the widget's own form is held —
747
+ `BugCatch.report()` from your code never is.
748
+
749
+ To drive it from your own UI:
750
+
751
+ ```js
752
+ const report = await BugCatch.myReport(id);
753
+
754
+ if (report.ratingAsked) {
755
+ // report.rating is null until they rate, then
756
+ // { score: 4, comment: 'Quick, thanks', ratedAt, via: 'widget', current: true }
757
+ await BugCatch.rate(id, { score: 4, comment: 'Quick, thanks' });
758
+ }
759
+ ```
760
+
761
+ `ratingAsked` is true only for a settled report on a project that asks; `rate()`
762
+ rejects otherwise. `rating.current` is false when the report was reopened and
763
+ fixed again after the rating was given — the rating stands, but it was about an
764
+ earlier fix. In `myReports()`, each row carries `rating` (the score, or null)
765
+ and `ratingAsked`.
766
+
719
767
  ### Reporting from your own UI
720
768
 
721
769
  ```js