@mushi-mushi/web 1.10.0 → 1.11.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.cts CHANGED
@@ -65,6 +65,8 @@ interface WidgetCallbacks {
65
65
  onReporterReportsRequest?(): Promise<MushiReporterReport[]>;
66
66
  onReporterCommentsRequest?(reportId: string): Promise<MushiReporterComment[]>;
67
67
  onReporterReply?(reportId: string, body: string): Promise<void>;
68
+ onReporterFeedback?(reportId: string, signal: string, note?: string): Promise<Record<string, unknown> | null>;
69
+ onReporterReopen?(reportId: string, note?: string): Promise<Record<string, unknown> | null>;
68
70
  onLeaderboardOpen?(): void;
69
71
  }
70
72
  declare class MushiWidget {
@@ -330,6 +332,7 @@ declare class MushiWidget {
330
332
  private unreadCount;
331
333
  private loadReporterReports;
332
334
  private loadReporterComments;
335
+ private submitReporterFeedback;
333
336
  private submitReporterReply;
334
337
  getRecorderStep(): WidgetStep;
335
338
  getRecorderTrigger(): Element | null;
package/dist/index.d.ts CHANGED
@@ -65,6 +65,8 @@ interface WidgetCallbacks {
65
65
  onReporterReportsRequest?(): Promise<MushiReporterReport[]>;
66
66
  onReporterCommentsRequest?(reportId: string): Promise<MushiReporterComment[]>;
67
67
  onReporterReply?(reportId: string, body: string): Promise<void>;
68
+ onReporterFeedback?(reportId: string, signal: string, note?: string): Promise<Record<string, unknown> | null>;
69
+ onReporterReopen?(reportId: string, note?: string): Promise<Record<string, unknown> | null>;
68
70
  onLeaderboardOpen?(): void;
69
71
  }
70
72
  declare class MushiWidget {
@@ -330,6 +332,7 @@ declare class MushiWidget {
330
332
  private unreadCount;
331
333
  private loadReporterReports;
332
334
  private loadReporterComments;
335
+ private submitReporterFeedback;
333
336
  private submitReporterReply;
334
337
  getRecorderStep(): WidgetStep;
335
338
  getRecorderTrigger(): Element | null;
package/dist/index.js CHANGED
@@ -1832,7 +1832,11 @@ function reporterStatusLabel(status) {
1832
1832
  case "fixed":
1833
1833
  case "resolved":
1834
1834
  case "completed":
1835
- return "Fixed";
1835
+ return "Fixed \u2014 confirm?";
1836
+ case "verified":
1837
+ return "Verified";
1838
+ case "reopened":
1839
+ return "Reopened";
1836
1840
  case "dismissed":
1837
1841
  return "Closed";
1838
1842
  default:
@@ -1857,6 +1861,10 @@ function reporterStatusTone(status) {
1857
1861
  case "resolved":
1858
1862
  case "completed":
1859
1863
  return "fixed";
1864
+ case "verified":
1865
+ return "fixed";
1866
+ case "reopened":
1867
+ return "fixing";
1860
1868
  case "dismissed":
1861
1869
  return "closed";
1862
1870
  default:
@@ -2937,6 +2945,12 @@ var MushiWidget = class _MushiWidget {
2937
2945
  <div class="mushi-thread">
2938
2946
  ${this.reporterLoading ? '<p class="mushi-muted">Loading thread\u2026</p>' : comments || '<p class="mushi-muted">No developer replies yet.</p>'}
2939
2947
  </div>
2948
+ ${["fixed", "resolved", "verified"].includes(status) ? `
2949
+ <div class="mushi-verify-actions" role="group" aria-label="Fix verification">
2950
+ <button type="button" class="mushi-intent-btn" data-action="reporter-confirms">Yes, fixed for me</button>
2951
+ <button type="button" class="mushi-intent-btn" data-action="reporter-not-fixed">Not fixed yet</button>
2952
+ </div>
2953
+ ` : ""}
2940
2954
  <textarea class="mushi-textarea" data-role="reporter-reply" rows="3" placeholder="Reply to the developer\u2026"></textarea>
2941
2955
  <button type="button" class="mushi-submit" data-action="reporter-reply">
2942
2956
  <span>Reply</span><span class="mushi-submit-arrow" aria-hidden="true">\u2192</span>
@@ -3268,6 +3282,12 @@ var MushiWidget = class _MushiWidget {
3268
3282
  panel.querySelector('[data-action="reporter-reply"]')?.addEventListener("click", () => {
3269
3283
  void this.submitReporterReply(panel);
3270
3284
  });
3285
+ panel.querySelector('[data-action="reporter-confirms"]')?.addEventListener("click", () => {
3286
+ void this.submitReporterFeedback("confirms");
3287
+ });
3288
+ panel.querySelector('[data-action="reporter-not-fixed"]')?.addEventListener("click", () => {
3289
+ void this.submitReporterFeedback("not_fixed");
3290
+ });
3271
3291
  panel.querySelector('[data-action="copy-report-id"]')?.addEventListener("click", (e) => {
3272
3292
  const btn = e.currentTarget;
3273
3293
  const id = btn.dataset.copyId;
@@ -3449,6 +3469,21 @@ var MushiWidget = class _MushiWidget {
3449
3469
  this.render();
3450
3470
  }
3451
3471
  }
3472
+ async submitReporterFeedback(signal) {
3473
+ const reportId = this.selectedReportId;
3474
+ if (!reportId || this.reporterLoading) return;
3475
+ this.reporterLoading = true;
3476
+ this.render();
3477
+ try {
3478
+ await this.callbacks.onReporterFeedback?.(reportId, signal);
3479
+ await this.loadReporterReports();
3480
+ if (reportId) await this.loadReporterComments(reportId);
3481
+ } catch (err) {
3482
+ this.reporterError = err instanceof Error ? err.message : "Could not send feedback.";
3483
+ this.reporterLoading = false;
3484
+ this.render();
3485
+ }
3486
+ }
3452
3487
  async submitReporterReply(panel) {
3453
3488
  const reportId = this.selectedReportId;
3454
3489
  const textarea = panel.querySelector('[data-role="reporter-reply"]');
@@ -5302,7 +5337,7 @@ function createProactiveManager(config = {}) {
5302
5337
 
5303
5338
  // src/version.ts
5304
5339
  var MUSHI_SDK_PACKAGE = "@mushi-mushi/web";
5305
- var MUSHI_SDK_VERSION = "1.10.0" ;
5340
+ var MUSHI_SDK_VERSION = "1.11.0" ;
5306
5341
 
5307
5342
  // src/mushi.ts
5308
5343
  var instance = null;
@@ -5581,6 +5616,16 @@ function createInstance(config) {
5581
5616
  const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(), body);
5582
5617
  if (!result.ok) throw new Error(result.error?.message ?? "Could not send reply");
5583
5618
  },
5619
+ async onReporterFeedback(reportId, signal, note) {
5620
+ const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(), note ?? "", signal);
5621
+ if (!result.ok) throw new Error(result.error?.message ?? "Could not send feedback");
5622
+ return result.data?.feedback ?? null;
5623
+ },
5624
+ async onReporterReopen(reportId, note) {
5625
+ const result = await apiClient2.reopenReporterReport(reportId, getReporterToken(), note);
5626
+ if (!result.ok) throw new Error(result.error?.message ?? "Could not reopen report");
5627
+ return result.data?.outcome ?? null;
5628
+ },
5584
5629
  onLeaderboardOpen() {
5585
5630
  widget.setLeaderboard(null, true);
5586
5631
  void fetchLeaderboard(10).then((entries) => {
@@ -6157,6 +6202,19 @@ function createInstance(config) {
6157
6202
  if (!result.ok) return null;
6158
6203
  return result.data?.comment ?? null;
6159
6204
  },
6205
+ async submitFeedbackSignal(reportId, signal, note) {
6206
+ const result = await apiClient2.replyToReporterReport(reportId, getReporterToken(), note ?? "", signal);
6207
+ if (!result.ok) return null;
6208
+ return result.data?.feedback ?? null;
6209
+ },
6210
+ async reopenReport(reportId, note) {
6211
+ const result = await apiClient2.reopenReporterReport(reportId, getReporterToken(), note);
6212
+ if (!result.ok) return null;
6213
+ return result.data?.outcome ?? null;
6214
+ },
6215
+ openMyReports() {
6216
+ widget.recorderOpenMyReports();
6217
+ },
6160
6218
  async getHallOfFame(limit = 20) {
6161
6219
  const result = await apiClient2.getHallOfFame(limit);
6162
6220
  if (!result.ok) return [];
@@ -6483,6 +6541,10 @@ function createNoopInstance() {
6483
6541
  listMyReports: async () => [],
6484
6542
  listMyComments: async () => [],
6485
6543
  replyToReport: async () => null,
6544
+ submitFeedbackSignal: async () => null,
6545
+ reopenReport: async () => null,
6546
+ openMyReports: () => {
6547
+ },
6486
6548
  getHallOfFame: async () => []
6487
6549
  };
6488
6550
  }