@celljs/ta-feedback 4.17.0 → 4.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/host/index.mjs CHANGED
@@ -659,7 +659,7 @@ class FeedbackHost {
659
659
  const items = await this.items();
660
660
  const inRoom = items.filter((item2) => item2.room === turn.room);
661
661
  if (inRoom.filter((item2) => FeedbackUtil.open(item2.status)).length >= OPEN_MAX) {
662
- throw new Error(`${OPEN_MAX} reports are open in this room: not filed. Tell them it is noted and will be looked at later.`);
662
+ throw new Error(`${OPEN_MAX} reports are open in this group chat: not filed. Tell them it is noted and will be looked at later.`);
663
663
  }
664
664
  const now = this.options.now();
665
665
  const item = {
@@ -682,7 +682,7 @@ class FeedbackHost {
682
682
  const items = await this.items();
683
683
  const item = items.find((each) => each.room === turn.room && each.n === Number(input.n));
684
684
  if (!item) {
685
- throw new Error(`No report #${input.n} in this room.`);
685
+ throw new Error(`No report #${input.n} in this group chat.`);
686
686
  }
687
687
  const reporters = await this.reporters(turn.room, input.lines);
688
688
  const note = FeedbackUtil.clip(String(input.note ?? ""), 1000);
@@ -730,7 +730,7 @@ ${note}`, 6000) } : {}
730
730
  async enable(request) {
731
731
  const room = (await this.host.rooms.listRooms()).find((each) => each.id === request.room);
732
732
  if (!room?.owner || room.status !== "member" || room.unlisted) {
733
- throw new Error("Feedback is for a room of your own.");
733
+ throw new Error("Feedback is for a group chat of your own.");
734
734
  }
735
735
  const { top } = await this.options.git.top(String(request.cwd ?? ""));
736
736
  const settings = await this.settings();
@@ -786,7 +786,7 @@ ${note}`, 6000) } : {}
786
786
  this.timers.set(room, setTimeout(() => {
787
787
  this.timers.delete(room);
788
788
  const before = this.queues.get(room) ?? Promise.resolve();
789
- const next = before.then(() => this.triage(room)).catch((error) => console.error("ta-feedback could not read the room:", error)).finally(() => {
789
+ const next = before.then(() => this.triage(room)).catch((error) => console.error("ta-feedback could not read the group chat:", error)).finally(() => {
790
790
  if (this.queues.get(room) === next) {
791
791
  this.queues.delete(room);
792
792
  }
@@ -1031,7 +1031,7 @@ ${note}`, 6000) } : {}
1031
1031
  async self(room) {
1032
1032
  const found = (await this.host.rooms.listRooms()).find((each) => each.id === room)?.members.find((member) => member.self);
1033
1033
  if (!found) {
1034
- throw new Error("Not in that room.");
1034
+ throw new Error("Not in that group chat.");
1035
1035
  }
1036
1036
  return found.member;
1037
1037
  }
@@ -1069,7 +1069,7 @@ ${note}`, 6000) } : {}
1069
1069
  triageTurn(sessionFile) {
1070
1070
  const turn = this.turnOf(sessionFile);
1071
1071
  if (turn?.kind !== "triage" || !turn.active) {
1072
- throw new Error("Only while reading a room with feedback.");
1072
+ throw new Error("Only while reading a group chat with feedback.");
1073
1073
  }
1074
1074
  return turn;
1075
1075
  }
@@ -1156,10 +1156,10 @@ ${note}`, 6000) } : {}
1156
1156
  "ja-JP": `${names} ご報告の #${n}「${title}」は修正してリリースしました。ありがとうございます!`
1157
1157
  }),
1158
1158
  off: () => say({
1159
- "zh-CN": "这个房间的反馈已关闭",
1160
- "zh-TW": "這個房間的回饋已關閉",
1161
- "en-US": "Feedback is off in this room",
1162
- "ja-JP": "このルームのフィードバックはオフです"
1159
+ "zh-CN": "这个群聊的反馈已关闭",
1160
+ "zh-TW": "這個群聊的回饋已關閉",
1161
+ "en-US": "Feedback is off in this group chat",
1162
+ "ja-JP": "このグループチャットのフィードバックはオフです"
1163
1163
  }),
1164
1164
  cutOff: () => say({
1165
1165
  "zh-CN": "Ta 重启时上线被打断了,可以再批准一次",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-feedback",
3
- "version": "4.17.0",
3
+ "version": "4.19.0",
4
4
  "description": "A pi package for Ta: feedback in a room, sorted into reports, each fixed in a worktree of its own, put out once the owner approves, and those who reported it told",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -27,9 +27,9 @@
27
27
  "watch": "tsc -b -w --preserveWatchOutput"
28
28
  },
29
29
  "devDependencies": {
30
- "@celljs/ta-protocol": "4.17.0",
31
- "@celljs/ta-relay": "4.17.0",
32
- "@celljs/ta-web": "4.17.0",
30
+ "@celljs/ta-protocol": "4.19.0",
31
+ "@celljs/ta-relay": "4.19.0",
32
+ "@celljs/ta-web": "4.19.0",
33
33
  "@types/react": "^19.3.0"
34
34
  },
35
35
  "publishConfig": {
@@ -43,10 +43,10 @@
43
43
  "ja-JP": "フィードバック"
44
44
  },
45
45
  "summary": {
46
- "en": "Turn a room into a place for feedback: people report there, even from a browser; Ta sorts it, fixes each report on a branch of its own, and puts out what you approve, telling those who reported it.",
47
- "zh-CN": "把房间变成反馈群:大家在里面说问题,浏览器也能进;Ta 整理成反馈、每条在单独的分支上修好,你批准后上线,并告诉反馈的人。",
48
- "zh-TW": "把房間變成回饋群:大家在裡面說問題,瀏覽器也能進;Ta 整理成回饋、每條在單獨的分支上修好,你批准後上線,並告訴回饋的人。",
49
- "ja-JP": "ルームをフィードバックの場に:ブラウザからも参加して報告でき、Ta が整理してそれぞれ別のブランチで修正し、あなたが承認したものをリリースして報告者に知らせます。"
46
+ "en": "Turn a group chat into a place for feedback: people report there, even from a browser; Ta sorts it, fixes each report on a branch of its own, and puts out what you approve, telling those who reported it.",
47
+ "zh-CN": "把群聊变成反馈群:大家在里面说问题,浏览器也能进;Ta 整理成反馈、每条在单独的分支上修好,你批准后上线,并告诉反馈的人。",
48
+ "zh-TW": "把群聊變成回饋群:大家在裡面說問題,瀏覽器也能進;Ta 整理成回饋、每條在單獨的分支上修好,你批准後上線,並告訴回饋的人。",
49
+ "ja-JP": "グループチャットをフィードバックの場に:ブラウザからも参加して報告でき、Ta が整理してそれぞれ別のブランチで修正し、あなたが承認したものをリリースして報告者に知らせます。"
50
50
  },
51
51
  "icon": "Bug",
52
52
  "web": [
package/web/index.js CHANGED
@@ -12,6 +12,28 @@ var MEMBER_CHOICES = [16, 50, 100];
12
12
  var DEFAULT_MEMBERS = 50;
13
13
  var INVITE_DAYS = 365;
14
14
 
15
+ // ../ta-web/esm/browser/extension/share-sheet-compat.js
16
+ function ShareSheetCompat({ pi, ...props }) {
17
+ const h = pi.React.createElement;
18
+ if (pi.ui.ShareSheet) {
19
+ return h(pi.ui.ShareSheet, props);
20
+ }
21
+ const { title, link, error, name, gets, notes, password, own, onClose, children } = props;
22
+ const quiet = { margin: 0, opacity: 0.7, textAlign: "center" };
23
+ return h(pi.ui.Dialog, { title, onClose }, h("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 12 } }, error !== undefined ? h("p", { role: "alert" }, error) : [
24
+ name || gets ? h("p", { key: "who", style: { margin: 0, textAlign: "center" } }, [name, gets].filter(Boolean).join(" · ")) : null,
25
+ link && !own ? h(pi.ui.QrCode, { key: "qr", text: link, label: name || title }) : null,
26
+ h("code", { key: "link", style: { maxWidth: "100%", overflowWrap: "anywhere", userSelect: "all" } }, link !== null && link !== undefined ? link : "…"),
27
+ password ? h("code", { key: "password", style: { userSelect: "all" } }, password) : null,
28
+ link ? h("button", { key: "copy", type: "button", className: "ta-button ta-primary", onClick: () => {
29
+ var _a;
30
+ return void ((_a = navigator.clipboard) === null || _a === undefined ? undefined : _a.writeText(link));
31
+ } }, "Copy") : null,
32
+ children,
33
+ ...(notes !== null && notes !== undefined ? notes : []).filter(Boolean).map((line) => h("p", { key: String(line), style: quiet }, line))
34
+ ]));
35
+ }
36
+
15
37
  // ../ta-protocol/esm/common/language.js
16
38
  var TaLanguageUtil;
17
39
  (function(TaLanguageUtil2) {
@@ -75,14 +97,12 @@ var EN = {
75
97
  settings: "Settings",
76
98
  turnOff: "Turn off feedback",
77
99
  turnOffTitle: 'Turn off feedback in "{title}"?',
78
- turnOffHint: "Reports are kept. Ta stops reading the room.",
100
+ turnOffHint: "Reports are kept. Ta stops reading the group chat.",
79
101
  link: "Link that invites",
80
102
  linkValue: "For a year",
81
103
  linkTitle: "Link that invites, for a year",
82
104
  linkHint: "Anyone with it can join from a browser and report. Making it stops the links of before.",
83
105
  linkMake: "Make the link",
84
- copy: "Copy",
85
- copied: "Copied",
86
106
  review: "Waiting for you",
87
107
  working: "In progress",
88
108
  ended: "Done",
@@ -133,14 +153,12 @@ var ZH = {
133
153
  settings: "设置",
134
154
  turnOff: "关闭反馈",
135
155
  turnOffTitle: "关闭「{title}」的反馈?",
136
- turnOffHint: "已有的反馈会保留,Ta 不再读这个房间。",
156
+ turnOffHint: "已有的反馈会保留,Ta 不再读这个群聊。",
137
157
  link: "邀请链接",
138
158
  linkValue: "一年有效",
139
159
  linkTitle: "邀请链接(一年有效)",
140
160
  linkHint: "拿到链接的人都能用浏览器进来反馈。生成新链接后,旧链接失效。",
141
161
  linkMake: "生成链接",
142
- copy: "复制",
143
- copied: "已复制",
144
162
  review: "待你决定",
145
163
  working: "处理中",
146
164
  ended: "已结束",
@@ -191,14 +209,12 @@ var ZH_TW = {
191
209
  settings: "設定",
192
210
  turnOff: "關閉回饋",
193
211
  turnOffTitle: "關閉「{title}」的回饋?",
194
- turnOffHint: "已有的回饋會保留,Ta 不再讀這個房間。",
212
+ turnOffHint: "已有的回饋會保留,Ta 不再讀這個群聊。",
195
213
  link: "邀請連結",
196
214
  linkValue: "一年有效",
197
215
  linkTitle: "邀請連結(一年有效)",
198
216
  linkHint: "拿到連結的人都能用瀏覽器進來回饋。產生新連結後,舊連結失效。",
199
217
  linkMake: "產生連結",
200
- copy: "複製",
201
- copied: "已複製",
202
218
  review: "待你決定",
203
219
  working: "處理中",
204
220
  ended: "已結束",
@@ -249,14 +265,12 @@ var JA = {
249
265
  settings: "設定",
250
266
  turnOff: "フィードバックをオフ",
251
267
  turnOffTitle: "「{title}」のフィードバックをオフにしますか?",
252
- turnOffHint: "報告は残ります。Ta はこのルームを読まなくなります。",
268
+ turnOffHint: "報告は残ります。Ta はこのグループチャットを読まなくなります。",
253
269
  link: "招待リンク",
254
270
  linkValue: "1 年有効",
255
271
  linkTitle: "招待リンク(1 年有効)",
256
272
  linkHint: "リンクを持っている人は誰でもブラウザから参加して報告できます。新しいリンクを作ると以前のリンクは無効になります。",
257
273
  linkMake: "リンクを作成",
258
- copy: "コピー",
259
- copied: "コピーしました",
260
274
  review: "あなたの判断待ち",
261
275
  working: "対応中",
262
276
  ended: "完了",
@@ -409,14 +423,6 @@ var store = new FeedbackStore;
409
423
  function useFeedback() {
410
424
  return React.useSyncExternalStore(store.subscribe, () => store.get());
411
425
  }
412
- async function copy(text) {
413
- try {
414
- await navigator.clipboard.writeText(text);
415
- pi.ui.notify(t("copied"));
416
- } catch (error) {
417
- pi.ui.notify(message(error), "error");
418
- }
419
- }
420
426
 
421
427
  // web-src/feedback-view.tsx
422
428
  var OPEN = new Set(["new", "fixing", "releasing"]);
@@ -570,6 +576,22 @@ function Setup({ room, settings, onDone }) {
570
576
  function LinkDialog({ room, close }) {
571
577
  const [link, setLink] = React.useState("");
572
578
  const [busy, act] = useBusy();
579
+ const make = () => act(async () => setLink((await pi.rooms.invite(room.id, { days: INVITE_DAYS, renew: true })).link));
580
+ if (link) {
581
+ const Bug = icon("MessageSquare");
582
+ return /* @__PURE__ */ React.createElement(ShareSheetCompat, {
583
+ pi,
584
+ title: t("linkTitle"),
585
+ link,
586
+ face: /* @__PURE__ */ React.createElement(Bug, {
587
+ size: 22
588
+ }),
589
+ name: room.title,
590
+ gets: t("linkHint"),
591
+ onRenew: make,
592
+ onClose: close
593
+ });
594
+ }
573
595
  return /* @__PURE__ */ React.createElement(pi.ui.Dialog, {
574
596
  title: t("linkTitle"),
575
597
  onClose: close
@@ -577,25 +599,13 @@ function LinkDialog({ room, close }) {
577
599
  className: "tfb-dialog"
578
600
  }, /* @__PURE__ */ React.createElement("p", {
579
601
  className: "tfb-note"
580
- }, t("linkHint")), link ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
581
- className: "tfb-qr"
582
- }, /* @__PURE__ */ React.createElement(pi.ui.QrCode, {
583
- text: link
584
- })), /* @__PURE__ */ React.createElement("code", {
585
- className: "tfb-link"
586
- }, link), /* @__PURE__ */ React.createElement("div", {
587
- className: "tfb-actions"
588
- }, /* @__PURE__ */ React.createElement("button", {
589
- type: "button",
590
- className: "ta-button ta-primary",
591
- onClick: () => void copy(link)
592
- }, t("copy")))) : /* @__PURE__ */ React.createElement("div", {
602
+ }, t("linkHint")), /* @__PURE__ */ React.createElement("div", {
593
603
  className: "tfb-actions"
594
604
  }, /* @__PURE__ */ React.createElement("button", {
595
605
  type: "button",
596
606
  className: `ta-button ta-primary${busy ? " ta-busy" : ""}`,
597
607
  disabled: busy,
598
- onClick: () => act(async () => setLink((await pi.rooms.invite(room.id, { days: INVITE_DAYS, renew: true })).link))
608
+ onClick: make
599
609
  }, t("linkMake")))));
600
610
  }
601
611
  function Decide({ item, here }) {
@@ -840,8 +850,6 @@ button.tfb-row:hover { background: var(--ta-hover); }
840
850
  .tfb-foot { display: flex; justify-content: center; padding: 24px 0 4px; }
841
851
  .tfb-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
842
852
  .tfb-dialog { display: flex; flex-direction: column; gap: 12px; }
843
- .tfb-qr { display: flex; justify-content: center; }
844
- .tfb-link { display: block; padding: 8px 10px; border-radius: 8px; background: var(--ta-side); font-family: var(--ta-mono); font-size: calc(11.5px * var(--ta-font-scale)); overflow-wrap: anywhere; }
845
853
  /* The card of a fix in its conversation */
846
854
  .tfb-card { display: flex; flex-direction: column; gap: 8px; max-width: 520px; padding: 12px; border: 1px solid var(--ta-border-muted); border-radius: 14px; background: var(--ta-side); }
847
855
  .tfb-card-title { font-weight: 500; }