@sphoro/bugcatch-web-sdk 0.18.0 → 0.19.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.19.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,37 @@ 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
+ To drive it from your own UI:
735
+
736
+ ```js
737
+ const report = await BugCatch.myReport(id);
738
+
739
+ if (report.ratingAsked) {
740
+ // report.rating is null until they rate, then
741
+ // { score: 4, comment: 'Quick, thanks', ratedAt, via: 'widget', current: true }
742
+ await BugCatch.rate(id, { score: 4, comment: 'Quick, thanks' });
743
+ }
744
+ ```
745
+
746
+ `ratingAsked` is true only for a settled report on a project that asks; `rate()`
747
+ rejects otherwise. `rating.current` is false when the report was reopened and
748
+ fixed again after the rating was given — the rating stands, but it was about an
749
+ earlier fix. In `myReports()`, each row carries `rating` (the score, or null)
750
+ and `ratingAsked`.
751
+
719
752
  ### Reporting from your own UI
720
753
 
721
754
  ```js