@eifi1/ui-kit 0.46.1 → 0.47.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.
Files changed (98) hide show
  1. package/README.md +5 -5
  2. package/dist/components/data-table.js +18 -1
  3. package/dist/components/data-table.js.map +1 -1
  4. package/dist/components/row-actions.d.ts +25 -0
  5. package/dist/components/row-actions.js +13 -3
  6. package/dist/components/row-actions.js.map +1 -1
  7. package/dist/components/tabs.d.ts +24 -16
  8. package/dist/components/tabs.js +37 -31
  9. package/dist/components/tabs.js.map +1 -1
  10. package/dist/components/ui-labels.js +1 -1
  11. package/dist/components/ui-labels.js.map +1 -1
  12. package/dist/eslint/index.js +1 -1
  13. package/dist/feedback/feedback-attachment-download.d.ts +19 -0
  14. package/dist/feedback/feedback-attachment-download.js +59 -0
  15. package/dist/feedback/feedback-attachment-download.js.map +1 -0
  16. package/dist/feedback/feedback-comment-thread.d.ts +17 -6
  17. package/dist/feedback/feedback-comment-thread.js +21 -2
  18. package/dist/feedback/feedback-comment-thread.js.map +1 -1
  19. package/dist/feedback/feedback-entry-file.d.ts +61 -0
  20. package/dist/feedback/feedback-entry-file.js +76 -0
  21. package/dist/feedback/feedback-entry-file.js.map +1 -0
  22. package/dist/feedback/feedback-public-list.d.ts +18 -5
  23. package/dist/feedback/feedback-public-list.js +8 -0
  24. package/dist/feedback/feedback-public-list.js.map +1 -1
  25. package/dist/feedback/feedback-public-types.d.ts +7 -2
  26. package/dist/feedback/feedback-replies.d.ts +26 -9
  27. package/dist/feedback/feedback-replies.js +20 -10
  28. package/dist/feedback/feedback-replies.js.map +1 -1
  29. package/dist/feedback/feedback-row-detail-labels.js +0 -1
  30. package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
  31. package/dist/feedback/feedback-row-detail.d.ts +23 -10
  32. package/dist/feedback/feedback-row-detail.js +10 -54
  33. package/dist/feedback/feedback-row-detail.js.map +1 -1
  34. package/dist/feedback.d.ts +1 -0
  35. package/dist/feedback.js +1 -0
  36. package/dist/feedback.js.map +1 -1
  37. package/dist/i18n/german.js +1 -6
  38. package/dist/i18n/german.js.map +1 -1
  39. package/dist/i18n/locales/en.js +1 -6
  40. package/dist/i18n/locales/en.js.map +2 -2
  41. package/dist/i18n/locales/es.js +1 -6
  42. package/dist/i18n/locales/es.js.map +1 -1
  43. package/dist/i18n/locales/fr.js +1 -6
  44. package/dist/i18n/locales/fr.js.map +1 -1
  45. package/dist/i18n/locales/hu.js +1 -6
  46. package/dist/i18n/locales/hu.js.map +1 -1
  47. package/dist/i18n/locales/it.js +1 -6
  48. package/dist/i18n/locales/it.js.map +1 -1
  49. package/dist/i18n/locales/zh.js +1 -6
  50. package/dist/i18n/locales/zh.js.map +1 -1
  51. package/dist/i18n/review.js +0 -1
  52. package/dist/i18n/review.js.map +1 -1
  53. package/dist/index.d.ts +2 -4
  54. package/dist/index.js +11 -4
  55. package/dist/index.js.map +1 -1
  56. package/dist/notifications/device-zone-report.d.ts +1 -1
  57. package/dist/notifications/device-zone-report.js.map +1 -1
  58. package/dist/notifications/notification-types.d.ts +0 -3
  59. package/dist/notifications/notifications-labels.d.ts +2 -15
  60. package/dist/notifications/notifications-labels.js +0 -4
  61. package/dist/notifications/notifications-labels.js.map +1 -1
  62. package/dist/notifications/quiet-hours-setting.d.ts +3 -8
  63. package/dist/notifications/quiet-hours-setting.js +8 -3
  64. package/dist/notifications/quiet-hours-setting.js.map +1 -1
  65. package/dist/theme/theme-store.d.ts +4 -4
  66. package/dist/theme/theme-store.js +1 -0
  67. package/dist/theme/theme-store.js.map +1 -1
  68. package/package.json +2 -2
  69. package/src/components/data-table.tsx +29 -3
  70. package/src/components/row-actions.tsx +42 -3
  71. package/src/components/tabs.tsx +66 -44
  72. package/src/components/ui-labels.ts +1 -1
  73. package/src/feedback/feedback-attachment-download.tsx +77 -0
  74. package/src/feedback/feedback-comment-thread.tsx +42 -7
  75. package/src/feedback/feedback-entry-file.tsx +150 -0
  76. package/src/feedback/feedback-public-list.tsx +25 -4
  77. package/src/feedback/feedback-public-types.ts +7 -2
  78. package/src/feedback/feedback-replies.tsx +46 -19
  79. package/src/feedback/feedback-row-detail-labels.ts +0 -1
  80. package/src/feedback/feedback-row-detail.tsx +35 -86
  81. package/src/feedback.ts +1 -0
  82. package/src/i18n/german.ts +1 -6
  83. package/src/i18n/locales/es.ts +1 -6
  84. package/src/i18n/locales/fr.ts +1 -6
  85. package/src/i18n/locales/hu.ts +1 -6
  86. package/src/i18n/locales/it.ts +1 -6
  87. package/src/i18n/locales/zh.ts +1 -6
  88. package/src/i18n/review.ts +0 -1
  89. package/src/index.ts +10 -3
  90. package/src/notifications/device-zone-report.ts +1 -1
  91. package/src/notifications/notification-types.ts +0 -3
  92. package/src/notifications/notifications-labels.ts +2 -19
  93. package/src/notifications/quiet-hours-setting.tsx +16 -11
  94. package/src/theme/theme-store.ts +13 -5
  95. package/dist/notifications/time-zone-select.d.ts +0 -54
  96. package/dist/notifications/time-zone-select.js +0 -71
  97. package/dist/notifications/time-zone-select.js.map +0 -1
  98. package/src/notifications/time-zone-select.tsx +0 -125
@@ -101,10 +101,6 @@ export interface FeedbackDetailLabels {
101
101
  outcomePlaceholder: string;
102
102
  /** The button that opens section 5 on an answered row. de-CH: "Nacharbeit" */
103
103
  rework: string;
104
- /** The link to the page the report was filed on. de-CH: "Seite öffnen"
105
- * @deprecated 0.46 — the Replies section's "Open page" button is gone (keksdose live #449:
106
- * it repeated the URL section's link); removed in 0.47. Unused, kept for one release. */
107
- openPage: string;
108
104
  /** Section 5's heading. de-CH: "Zur Nacharbeit senden" */
109
105
  reworkTitle: string;
110
106
  /** Section 5's send button. de-CH: "Nacharbeit senden" */
@@ -284,8 +280,8 @@ export interface FeedbackRowDetailProps {
284
280
  onUpdate: FeedbackDetailUpdate;
285
281
  /** `update.isPending`: the editors' save buttons wait for it. */
286
282
  pending?: boolean;
287
- /** `POST /feedback/attachments` for the rework's one file. Left out, a rework is a
288
- * note alone. */
283
+ /** `POST /feedback/attachments` for the rework's one file and, since 0.47 (§12) with
284
+ * `replyAttachments`, the admin reply's. Left out, a rework or a reply is text alone. */
289
285
  onUpload?: FeedbackUpload;
290
286
  /** The app's authenticated GET (`AuthedImage`'s) — the pictures and the downloads go
291
287
  * through it, since the attachment route wants the bearer token (§3.5). Left out,
@@ -298,9 +294,11 @@ export interface FeedbackRowDetailProps {
298
294
  * page's mutation (its observer outlives the row a status filter removes).
299
295
  */
300
296
  statusChange?: FeedbackStatusChange;
301
- /** For the rework's "Capture screenshot" — see {@link FeedbackReworkSectionProps}. */
297
+ /** For the rework's and (0.47, with `replyAttachments`) the reply composer's "Capture screenshot" — see
298
+ * {@link FeedbackReworkSectionProps}. */
302
299
  onCaptureScreenshot?: () => Promise<File | null>;
303
- /** The rework's file field, over the contract's defaults. */
300
+ /** The rework's and (0.47, with `replyAttachments`) the reply composer's file field,
301
+ * over the contract's defaults. */
304
302
  reworkAttachment?: Partial<FeedbackNoteAttachment>;
305
303
  /** How the `resolved_at` date reads — the app's date cell, as a string. Default: the
306
304
  * kit's `formatDate` in the provider's locale, `medium` style. */
@@ -324,8 +322,23 @@ export interface FeedbackRowDetailProps {
324
322
  * reply composer stands under the timeline. Return the promise: the box clears when it
325
323
  * resolves. A failure is the app's to toast — the server's `detail`, else
326
324
  * `feedbackToast.replyFailed` (0.38.1).
325
+ *
326
+ * 0.47 (§12, keksdose live #447): with `replyAttachments` (and `onUpload`) the
327
+ * composer takes one file as the rework note does — pasted into the box, captured or
328
+ * picked — uploaded first, and its URL is the third argument (`attachment_url` in the
329
+ * body; server-kit 0.18).
327
330
  */
328
- onReply?: (body: string, status?: FeedbackStatus) => void | Promise<unknown>;
331
+ onReply?: (body: string, status?: FeedbackStatus, attachmentUrl?: string) => void | Promise<unknown>;
332
+ /**
333
+ * 0.47 (§12): the reply composer takes one file — through `onUpload`,
334
+ * `onCaptureScreenshot` and `reworkAttachment`, the rework note's. Off by default:
335
+ * `onUpload` alone stays the rework's, so a page that passes it and an `onReply` of
336
+ * `(body, status)` does not grow a file field whose file its reply would drop (round
337
+ * 0.47 build reviews, keksdose and kastlan B1). Turn it on in the commit that makes
338
+ * `onReply` send its third argument as `attachment_url`, with server-kit 0.18 (an
339
+ * older server answers the field with a 422).
340
+ */
341
+ replyAttachments?: boolean;
329
342
  /** 0.38: the reply is in flight. */
330
343
  replying?: boolean;
331
344
  /**
@@ -374,4 +387,4 @@ export interface FeedbackRowDetailProps {
374
387
  * collapsing the row closes it. Each editor is keyed by the row's id, so a draft is
375
388
  * never thrown away by a list refresh under it.
376
389
  */
377
- export declare function FeedbackRowDetail({ row, canEdit, viewerId, onUpdate, pending, onUpload, fetcher, statusChange, onCaptureScreenshot, reworkAttachment, renderDate, commit, showSubject, onReply, replying, onRework, comments, onPublicChange, labels: labelsProp, className, }: FeedbackRowDetailProps): import("react").JSX.Element;
390
+ export declare function FeedbackRowDetail({ row, canEdit, viewerId, onUpdate, pending, onUpload, fetcher, statusChange, onCaptureScreenshot, reworkAttachment, renderDate, commit, showSubject, onReply, replyAttachments, replying, onRework, comments, onPublicChange, labels: labelsProp, className, }: FeedbackRowDetailProps): import("react").JSX.Element;
@@ -1,14 +1,13 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useRef, useState } from "react";
4
- import { Download, FileText, RotateCcw } from "lucide-react";
4
+ import { RotateCcw } from "lucide-react";
5
5
  import { AuthedImage } from "../components/authed-image.js";
6
6
  import { CopyButton } from "../components/copy-button.js";
7
7
  import { TextLink } from "../components/text-link.js";
8
8
  import { toast } from "../components/toast.js";
9
9
  import { Button } from "../components/button.js";
10
10
  import { useKitLabels, useKitLocale } from "../i18n/kit-labels.js";
11
- import { filenameFromDisposition, saveBlob } from "../lib/download.js";
12
11
  import { formatDate } from "../lib/format.js";
13
12
  import { DEFAULT_MAX_ATTACHMENT_BYTES } from "./feedback-attachment.js";
14
13
  import { DEFAULT_FEEDBACK_DIALOG_LABELS } from "./feedback-dialog.js";
@@ -28,7 +27,6 @@ import {
28
27
  FEEDBACK_AUTHOR_EDITABLE_STATUSES,
29
28
  FEEDBACK_REWORKABLE_STATUSES,
30
29
  appendRework,
31
- attachmentName,
32
30
  isImageAttachment,
33
31
  replaceDescription,
34
32
  splitBodyAttachments,
@@ -37,6 +35,7 @@ import {
37
35
  import { useFeedbackStatusUndo } from "./feedback-status-undo.js";
38
36
  import { DEFAULT_FEEDBACK_DETAIL_LABELS } from "./feedback-row-detail-labels.js";
39
37
  import { FeedbackReplyComposer, FeedbackReplyTimeline, feedbackReplyNudge } from "./feedback-replies.js";
38
+ import { FeedbackAttachmentDownload, plainFeedbackFetch } from "./feedback-attachment-download.js";
40
39
  import { FeedbackPublicSwitch } from "./feedback-public-switch.js";
41
40
  import { FeedbackRepliesDrawnAboveContext } from "./feedback-replies-context.js";
42
41
  import { DEFAULT_FEEDBACK_COMMENTS_LABELS } from "./feedback-thread-parts-labels.js";
@@ -81,53 +80,6 @@ function feedbackAttachmentUrls(row) {
81
80
  ];
82
81
  return [...new Set(urls)];
83
82
  }
84
- async function toBlob(answer) {
85
- if (typeof Response !== "undefined" && answer instanceof Response) {
86
- if (!answer.ok) throw new Error(`HTTP ${answer.status}`);
87
- return answer.blob();
88
- }
89
- return answer;
90
- }
91
- const plainFetch = (url, { signal }) => fetch(url, { signal, credentials: "same-origin" });
92
- function AttachmentDownload({
93
- url,
94
- fetcher,
95
- labels
96
- }) {
97
- const [busy, setBusy] = useState(false);
98
- const name = attachmentName(url);
99
- const download = async (event) => {
100
- event.stopPropagation();
101
- setBusy(true);
102
- try {
103
- const answer = await fetcher(url, { signal: new AbortController().signal });
104
- const blob = await toBlob(answer);
105
- const saveAs = typeof Response !== "undefined" && answer instanceof Response ? filenameFromDisposition(answer.headers.get("Content-Disposition"), name) : name;
106
- saveBlob(blob, saveAs);
107
- } catch {
108
- toast.error(labels.downloadFailed);
109
- } finally {
110
- setBusy(false);
111
- }
112
- };
113
- return /* @__PURE__ */ jsxs(
114
- Button,
115
- {
116
- type: "button",
117
- variant: "secondary",
118
- size: "sm",
119
- pending: busy,
120
- onClick: (event) => void download(event),
121
- "aria-label": labels.download(name),
122
- className: "max-w-full",
123
- children: [
124
- /* @__PURE__ */ jsx(FileText, { className: "size-3.5 shrink-0", "aria-hidden": true }),
125
- /* @__PURE__ */ jsx("span", { className: "min-w-0 max-w-[14rem] truncate-until-large", children: name }),
126
- /* @__PURE__ */ jsx(Download, { className: "size-3.5 shrink-0", "aria-hidden": true })
127
- ]
128
- }
129
- );
130
- }
131
83
  function feedbackRowAccess(row, { canEdit, viewerId }) {
132
84
  const isAuthor = row.user_id !== null && viewerId !== void 0 && viewerId !== null && viewerId === row.user_id;
133
85
  return {
@@ -245,6 +197,7 @@ function FeedbackRowDetail({
245
197
  commit,
246
198
  showSubject = true,
247
199
  onReply,
200
+ replyAttachments = false,
248
201
  replying = false,
249
202
  onRework,
250
203
  comments,
@@ -264,8 +217,8 @@ function FeedbackRowDetail({
264
217
  const { description } = splitDescription(row.body);
265
218
  const pageHref = feedbackPageHref(row.context);
266
219
  const pageUrl = feedbackPageUrl(row.context);
267
- const files = feedbackAttachmentUrls(row);
268
- const fetchFile = fetcher ?? plainFetch;
220
+ const files = feedbackAttachmentUrls(row.replies ? { ...row, replies: void 0 } : row);
221
+ const fetchFile = fetcher ?? plainFeedbackFetch;
269
222
  const dateText = (iso) => renderDate ? renderDate(iso) : formatDate(iso, "medium", { locale });
270
223
  const saveDescription = (value) => {
271
224
  if (value.trim() === description.trim()) {
@@ -337,7 +290,7 @@ function FeedbackRowDetail({
337
290
  className: "max-h-64 max-w-full rounded border border-subtle"
338
291
  },
339
292
  url
340
- ) : /* @__PURE__ */ jsx(AttachmentDownload, { url, fetcher: fetchFile, labels }, url)
293
+ ) : /* @__PURE__ */ jsx(FeedbackAttachmentDownload, { url, fetcher: fetchFile }, url)
341
294
  ) }) }),
342
295
  /* @__PURE__ */ jsx(
343
296
  FeedbackDetailSection,
@@ -345,13 +298,16 @@ function FeedbackRowDetail({
345
298
  title: replies ? labels.replies : labels.outcome,
346
299
  action: row.resolved_at ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted", children: labels.resolvedAt(dateText(row.resolved_at)) }) : void 0,
347
300
  children: /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
348
- replies ? /* @__PURE__ */ jsx(FeedbackReplyTimeline, { replies }) : /* @__PURE__ */ jsx(FeedbackProse, { children: row.outcome || void 0 }),
301
+ replies ? /* @__PURE__ */ jsx(FeedbackReplyTimeline, { replies, fetcher: fetchFile }) : /* @__PURE__ */ jsx(FeedbackProse, { children: row.outcome || void 0 }),
349
302
  composerShown && replies && onReply && /* @__PURE__ */ jsx(
350
303
  FeedbackReplyComposer,
351
304
  {
352
305
  status: row.status,
353
306
  onReply,
354
307
  pending: replying,
308
+ onUpload: replyAttachments ? onUpload : void 0,
309
+ onCaptureScreenshot: replyAttachments ? onCaptureScreenshot : void 0,
310
+ attachment: replyAttachments ? reworkAttachment : void 0,
355
311
  suggestedStatus: feedbackReplyNudge(row),
356
312
  commit
357
313
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/feedback/feedback-row-detail.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport type { MouseEvent, ReactNode } from \"react\";\nimport { Download, FileText, RotateCcw } from \"lucide-react\";\nimport { AuthedImage } from \"../components/authed-image\";\nimport { CopyButton } from \"../components/copy-button\";\nimport { TextLink } from \"../components/text-link\";\nimport { toast } from \"../components/toast\";\nimport { Button } from \"../components/button\";\nimport type { AuthedFetcher } from \"../hooks/use-authed-src\";\nimport { useKitLabels, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport { filenameFromDisposition, saveBlob } from \"../lib/download\";\nimport { formatDate } from \"../lib/format\";\nimport { DEFAULT_MAX_ATTACHMENT_BYTES } from \"./feedback-attachment\";\nimport { DEFAULT_FEEDBACK_DIALOG_LABELS } from \"./feedback-dialog\";\nimport {\n FeedbackCategoryBadge,\n FeedbackDetail,\n FeedbackDetailSection,\n FeedbackNoteEditor,\n FeedbackProse,\n FeedbackStatusTransitions,\n selectableFeedbackStatuses,\n visibleFeedbackStatuses,\n} from \"./feedback-inbox\";\nimport type { FeedbackNoteAttachment, FeedbackStatus } from \"./feedback-inbox\";\nimport { useFeedbackToastLabels } from \"./feedback-labels\";\nimport {\n FEEDBACK_ATTACHMENT_ACCEPT,\n FEEDBACK_AUTHOR_EDITABLE_STATUSES,\n FEEDBACK_REWORKABLE_STATUSES,\n appendRework,\n attachmentName,\n isImageAttachment,\n replaceDescription,\n splitBodyAttachments,\n splitDescription,\n} from \"./feedback-record\";\nimport type { FeedbackContext, FeedbackRecord } from \"./feedback-record\";\nimport { useFeedbackStatusUndo } from \"./feedback-status-undo\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_DETAIL_LABELS } from \"./feedback-row-detail-labels\";\nimport { FeedbackReplyComposer, FeedbackReplyTimeline, feedbackReplyNudge } from \"./feedback-replies\";\nimport { FeedbackPublicSwitch } from \"./feedback-public-switch\";\nimport { FeedbackRepliesDrawnAboveContext } from \"./feedback-replies-context\";\nimport { DEFAULT_FEEDBACK_COMMENTS_LABELS } from \"./feedback-thread-parts-labels\";\n\n/**\n * One report, opened — the panel a feedback table unfolds under its row (§4.4 of\n * docs/feedback-harmonization.md), lifted from keksdose's `FeedbackRow`\n * (`frontend/src/features/feedback/feedback-page.tsx:329-612`) with the contract's\n * changes applied.\n *\n * Until 0.27 each app wrote this panel itself out of the kit's shell\n * (`FeedbackDetail` / `FeedbackDetailSection` / `FeedbackNoteEditor`), and the three\n * copies had drifted in exactly the places a user notices:\n *\n * - **the description editor held the raw body** — keksdose `initial={fb.body}`\n * (`:420`), kastlan the same (`pages/feedback-page.tsx:226`) — so an author fixing a\n * typo could delete the `--- REWORK … ---` rounds and the `[screenshot]` file lines\n * with it, and the history was gone. Here the editor holds the ORIGINAL description\n * only ({@link splitDescription}) and saves through {@link replaceDescription}, which\n * puts every appended block and file line back unchanged;\n * - **kastlan's rework sent `status: \"OPEN\"`** from the client (`:189-195`) and offered it\n * on three statuses; keksdose sends the body alone and lets the server reopen the row\n * on five (live #331). The contract is keksdose's (§3.4) — {@link appendRework}, one\n * file, the server reopens;\n * - **kastlan showed only `screenshot_url`** (`:265-276`) and no downloads; keksdose the\n * screenshot, the other files and the rework pictures, a PDF as a download (dev #578);\n * - **the URL fell away on Kurvenschmiede's rows**, whose backfilled `context.url` is a\n * path (`/accounts?p=2`): keksdose's `new URL(…)` throws on one and the section\n * vanished. kastlan already fell back to `context.route` (`feedbackRaw`, `:97`).\n *\n * The sections, in the contract's order: **Subject** (the category and the title, §8.1;\n * `showSubject={false}` leaves it out), **Description** (the body; the author's\n * Edit while OPEN / READY / IN_PROGRESS), **URL**, **Attachment**, **Replies** (0.38,\n * §9.7: the timeline, the admin's reply composer with its status picker and the nudge,\n * Rework — on a row without `replies`, a server before 0.38, the frozen\n * **Outcome** read-only in its place), **Comments** (0.38: the app's\n * `FeedbackCommentThread`, when passed), **Send for rework** (only while reworking) and\n * **Status** (with the **Visible to others** switch when `onPublicChange` is passed).\n *\n * The app keeps its data and its API: the row it renders, the PATCH (`onUpdate`), the\n * upload (`onUpload`), the authenticated GET (`fetcher`) and who is looking (`canEdit`,\n * `viewerId`). Every word is the kit's `feedbackDetail` namespace.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackDetail` — the row detail's words (§4.4). English: keksdose's `en.json`\n * (`feedback.*`, `common.*`, `more.copy_url`) with the contract's changes; the de-CH\n * canon (keksdose `de-CH.json`, ss never ß, \"Nacharbeit\" throughout — §7.14) on each key.\n */\nexport interface FeedbackDetailLabels {\n /** The first section's heading: what the report is called (feedback contract §8.1,\n * keksdose live #395 — with the row expanded and the table scrolled, nothing said\n * which entry was being answered). de-CH: \"Betreff\" */\n subject: string;\n /** The description section's heading — keksdose's `feedback.body` (§7.3). The dialog's field asks\n * \"What happened? (optional)\"; the description, once filed, is headed as what it is\n * — and as the author's \"Edit description\" calls it. de-CH: \"Beschreibung\" */\n body: string;\n /** The author's button on that heading. de-CH: \"Bearbeiten\" */\n edit: string;\n /** Its accessible name — says WHAT is edited; contains the visible word.\n * de-CH: \"Beschreibung bearbeiten\" */\n editDescription: string;\n /** The editors' save button (description, outcome). de-CH: \"Speichern\" */\n save: string;\n /** Every editor's cancel button. de-CH: \"Abbrechen\" */\n cancel: string;\n /** Section 2's heading. de-CH: \"URL\" */\n url: string;\n /** The copy button beside the link — copies the FULL `context.url`.\n * de-CH: \"URL kopieren\" */\n copyUrl: string;\n /** Section 3's heading, and each picture's alt text. de-CH: \"Anhang\" */\n attachment: string;\n /** A PDF's / text file's download button, given the file's name.\n * de-CH: \"{{name}} herunterladen\" */\n download: (name: string) => string;\n /** The toast when that download failed. de-CH: \"Der Anhang konnte nicht\n * heruntergeladen werden.\" */\n downloadFailed: string;\n /** Section 4's heading on a row without `replies` (a server before 0.38), where the\n * frozen outcome is shown read-only. de-CH: \"Ergebnis\" */\n outcome: string;\n /** Section 4's heading since 0.38: the replies' timeline (§9.7). de-CH: \"Antworten\" */\n replies: string;\n /** On section 4's heading line once the row is settled, given the formatted\n * `resolved_at` date. de-CH: \"Erledigt am: {{date}}\" */\n resolvedAt: (date: string) => string;\n /** The admin's button while there is no outcome. **Unused since 0.38** (the outcome is\n * frozen, §9.7; a reply is written instead); kept for one release.\n * de-CH: \"Ergebnis hinzufügen\" */\n outcomeAdd: string;\n /** The same button once there is one. Unused since 0.38, as `outcomeAdd`.\n * de-CH: \"Aktualisieren\" */\n outcomeUpdate: string;\n /** The line above the outcome editor. Unused since 0.38, as `outcomeAdd`. de-CH: \"Was wurde umgesetzt, entschieden oder\n * warum nicht.\" */\n outcomePlaceholder: string;\n /** The button that opens section 5 on an answered row. de-CH: \"Nacharbeit\" */\n rework: string;\n /** The link to the page the report was filed on. de-CH: \"Seite öffnen\"\n * @deprecated 0.46 — the Replies section's \"Open page\" button is gone (keksdose live #449:\n * it repeated the URL section's link); removed in 0.47. Unused, kept for one release. */\n openPage: string;\n /** Section 5's heading. de-CH: \"Zur Nacharbeit senden\" */\n reworkTitle: string;\n /** Section 5's send button. de-CH: \"Nacharbeit senden\" */\n reworkSend: string;\n /** The line above the rework note. de-CH: \"Was muss noch angepasst werden? Neue\n * Anforderungen oder Richtungswechsel.\" */\n reworkPlaceholder: string;\n /** The toast when the rework's file did not upload — and so nothing was sent. Names\n * no screenshot: it fires for a PDF or a log too (§7.14; keksdose's said\n * \"screenshot\"). de-CH: \"Die Datei konnte nicht hochgeladen werden. Die Nacharbeit\n * wurde nicht gesendet.\" */\n reworkUploadFailed: string;\n /** Section 6's heading. de-CH: \"Status\" */\n status: string;\n /** A `FeedbackNoteEditor`'s box, named when no `placeholder` line names it and the\n * caller gives no `label` — without it the box was read out as just \"edit text\"\n * (round 0.34, the showcase's axe check). de-CH: \"Notiz\" */\n note: string;\n}\n\n// Defined in ./feedback-row-detail-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_DETAIL_LABELS };\n\n/** `feedbackDetail` resolved: English, then `<UiKitProvider labels>`, then `labels`. */\nexport function useFeedbackDetailLabels(labels?: LabelOverride<FeedbackDetailLabels>): FeedbackDetailLabels {\n return useKitLabels(\"feedbackDetail\", DEFAULT_FEEDBACK_DETAIL_LABELS, labels);\n}\n\n/* ── The page a report was filed on (§3.2, §4.4.2) ────────────────────────── */\n\n/** `context.url`, else `context.route` — a parsed URL, or null when neither is set or\n * the value is no http(s) address or path (a `javascript:` value is not a page). */\nfunction parsePage(context: FeedbackContext | null | undefined): URL | null {\n const raw = (context?.url || context?.route || \"\").trim();\n if (!raw) return null;\n try {\n // A base, so a PATH-ONLY value parses too: Kurvenschmiede backfills its old rows\n // with `url = page_path + search` (§3.2), and keksdose's `new URL(raw)` threw on\n // those and dropped the section.\n const url = new URL(raw, \"http://localhost\");\n return url.protocol === \"http:\" || url.protocol === \"https:\" ? url : null;\n } catch {\n return null;\n }\n}\n\n/** Collapses a leading `//` run: `/\\/\\/evil.example/` as a path would be a\n * protocol-relative link off the app. */\nconst localPath = (pathname: string) => pathname.replace(/^\\/{2,}/, \"/\");\n\n/**\n * The in-app link to the page a report was filed on — path + query + hash (keksdose\n * `localHref`: the query and hash carry the state worth restoring, `?tab=import`, a\n * drill-down). Read from `context.url`, else `context.route`; a path-only `url` works.\n * Always a path on THIS app, never another origin's address, so it is safe as an\n * `href` whatever the row says. `null` when there is nothing to link.\n */\nexport function feedbackPageHref(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? `${localPath(url.pathname)}${url.search}${url.hash}` : null;\n}\n\n/** The page's path alone — the compact text a URL column shows (§4.3). */\nexport function feedbackPagePath(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? localPath(url.pathname) : null;\n}\n\n/**\n * What \"Copy URL\" copies: the FULL `context.url` as the reporter's browser had it —\n * origin included, which is the one part that says which copy of the app it was\n * (feedback #278) — else `context.route`. `null` when there is no page.\n */\nexport function feedbackPageUrl(context: FeedbackContext | null | undefined): string | null {\n if (!parsePage(context)) return null;\n return (context?.url || context?.route || \"\").trim();\n}\n\n/* ── Attachments (§3.5, §4.4.3) ───────────────────────────────────────────── */\n\n/**\n * Every file a report carries, in the order the detail shows them (§4.4.3): the\n * screenshot it was filed with, then its other files, then whatever the rework rounds\n * brought, in body order (keksdose dev #578, live #291). One list rather than three —\n * a reader looking for \"the picture\" should not have to know at which point in the\n * conversation it was taken.\n *\n * Each URL once: keksdose and Kurvenschmiede content-address their keys, so the same\n * screenshot pasted twice is one URL — shown twice it is the same picture twice (and,\n * keyed by URL, a React key clash keksdose had).\n */\nexport function feedbackAttachmentUrls(\n row: Pick<FeedbackRecord, \"screenshot_url\" | \"attachment_urls\" | \"body\"> &\n Partial<Pick<FeedbackRecord, \"replies\">>,\n): string[] {\n const urls = [\n ...(row.screenshot_url ? [row.screenshot_url] : []),\n // `?? []`: NULL on rows filed before the column, and no key at all from a server\n // that predates it (keksdose dev #578).\n ...(row.attachment_urls ?? []),\n ...splitBodyAttachments(row.body).urls,\n // 0.40 (§10.3): a rework entry's one file, in entry order — where the rework\n // pictures of the body were before.\n ...(row.replies ?? []).flatMap((reply) =>\n reply.kind === \"rework\" && reply.attachment_url ? [reply.attachment_url] : [],\n ),\n ];\n return [...new Set(urls)];\n}\n\n/** The bytes behind a fetcher's answer — a `Blob` as it is, a `Response` checked. */\nasync function toBlob(answer: Blob | Response): Promise<Blob> {\n if (typeof Response !== \"undefined\" && answer instanceof Response) {\n if (!answer.ok) throw new Error(`HTTP ${answer.status}`);\n return answer.blob();\n }\n return answer as Blob;\n}\n\n/** No fetcher: the browser's own `fetch`, with the cookies a same-origin app uses. */\nconst plainFetch: AuthedFetcher = (url, { signal }) => fetch(url, { signal, credentials: \"same-origin\" });\n\n/**\n * A PDF or a text log (keksdose `FeedbackFileDownload`, dev #578): the bytes sit behind\n * an authenticated route that serves them as `attachment`, never inline (§3.5), so a\n * plain link would be a 401 the moment it was opened. Fetched through the app's\n * fetcher and saved with {@link saveBlob}; a failure says so in a toast.\n *\n * Saved under the name the server gives it when the fetcher answers with a `Response`\n * (server-kit's `content_disposition` puts the uploader's own name in `filename*`), and\n * under the URL's last segment — the name on the button — when it answers with a bare\n * `Blob`, which has no headers to ask.\n */\nfunction AttachmentDownload({\n url,\n fetcher,\n labels,\n}: {\n url: string;\n fetcher: AuthedFetcher;\n labels: FeedbackDetailLabels;\n}) {\n const [busy, setBusy] = useState(false);\n const name = attachmentName(url);\n const download = async (event: MouseEvent) => {\n // The row around the detail may toggle on a click.\n event.stopPropagation();\n setBusy(true);\n try {\n const answer = await fetcher(url, { signal: new AbortController().signal });\n const blob = await toBlob(answer);\n const saveAs =\n typeof Response !== \"undefined\" && answer instanceof Response\n ? filenameFromDisposition(answer.headers.get(\"Content-Disposition\"), name)\n : name;\n saveBlob(blob, saveAs);\n } catch {\n toast.error(labels.downloadFailed);\n } finally {\n setBusy(false);\n }\n };\n return (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n pending={busy}\n onClick={(event) => void download(event)}\n aria-label={labels.download(name)}\n className=\"max-w-full\"\n >\n <FileText className=\"size-3.5 shrink-0\" aria-hidden />\n <span className=\"min-w-0 max-w-[14rem] truncate-until-large\">{name}</span>\n <Download className=\"size-3.5 shrink-0\" aria-hidden />\n </Button>\n );\n}\n\n/* ── Who may do what (§3.4, §4.3, §4.4) ───────────────────────────────────── */\n\n/** What the person looking at a row may do with it — {@link feedbackRowAccess}. */\nexport interface FeedbackRowAccess {\n /** The viewer filed it (`viewerId === row.user_id`; never for an erased author). */\n isAuthor: boolean;\n /** \"Edit description\": the author, while the row is OPEN, READY or IN_PROGRESS — on either\n * page (keksdose `canAuthorEdit`, `feedback-page.tsx:398`, is not gated on `mine`). */\n canEditDescription: boolean;\n /** The admin on the inbox (`canEdit`): since 0.38 the reply composer (the outcome\n * itself is frozen, §9.7). */\n canEditOutcome: boolean;\n /** \"Rework\": the author, on an answered row ({@link FEEDBACK_REWORKABLE_STATUSES}).\n * Since 0.40 (§10.2 decision 6) the author's only — an admin sends a report back with\n * a reply whose status is `REWORK`; the server answers anyone else 403. */\n canRework: boolean;\n /** The status pills: the admin on the inbox; everyone else sees them read-only. */\n canChangeStatus: boolean;\n}\n\n/**\n * The detail's permission rules in one place — the same answers the server gives\n * (§3.4), so the panel never offers what the PATCH would refuse.\n *\n * `canEdit` is the app's \"admin on `/feedback`\": an admin on `/my-feedback` edits no\n * status and no outcome there (§4.3), but as the author still edits the description\n * and sends for rework. `viewerId` is the signed-in user's id.\n */\nexport function feedbackRowAccess(\n row: Pick<FeedbackRecord, \"user_id\" | \"status\">,\n { canEdit, viewerId }: { canEdit: boolean; viewerId?: number | null },\n): FeedbackRowAccess {\n // `user_id: null` is an erased author (keksdose live #275): nobody is that author,\n // least of all a viewer whose id happens to be missing too.\n const isAuthor = row.user_id !== null && viewerId !== undefined && viewerId !== null && viewerId === row.user_id;\n return {\n isAuthor,\n canEditDescription: isAuthor && FEEDBACK_AUTHOR_EDITABLE_STATUSES.includes(row.status),\n canEditOutcome: canEdit,\n canRework: isAuthor && FEEDBACK_REWORKABLE_STATUSES.includes(row.status),\n canChangeStatus: canEdit,\n };\n}\n\n/* ── The PATCH ─────────────────────────────────────────────────────────────── */\n\n/** What the detail sends as `PATCH /feedback/{id}` (§3.4): the body (a description\n * edit, a rework append) or the outcome — and, through {@link useFeedbackStatusUndo}\n * when no `statusChange` is given, the status. Never two at once: a rework PATCH must\n * carry the body ALONE for the server to read it as an append (keksdose live #331). */\nexport interface FeedbackDetailPatch {\n id: number;\n body?: string;\n /** `null` clears it — a real edit. **Frozen since 0.38** (§9.7): server-kit 0.11\n * answers 422; the detail no longer sends it (a reply is written instead). */\n outcome?: string | null;\n status?: FeedbackStatus;\n /** 0.38.1: the **Visible to others** flip (§9.3) — what `onPublicChange`'s\n * `PATCH /feedback/{id} {\"public\": next}` carries, alone, so an app can send it\n * through the same `onUpdate` mutation. */\n public?: boolean;\n}\n\n/**\n * The page's update mutation. **TanStack Query's `mutate` fits as it stands** — pass\n * `update.mutate` (and `pending={update.isPending}`), the same function\n * `useFeedbackStatusUndo` takes. A hand-written one sends the PATCH and calls\n * `onSuccess` once it has landed, and only then: that is when an editor closes. A\n * failure is the mutation's own to toast — the server's `detail`, else\n * `feedbackToast.updateFailed` (§4.4) — and leaves the editor open with its draft.\n */\nexport type FeedbackDetailUpdate = (patch: FeedbackDetailPatch, callbacks: { onSuccess: () => void }) => void;\n\n/** `POST /feedback/attachments` (§3.3): one file up, its URL\n * (`/api/v1/feedback/attachments/<key>`) back. Reject on failure. */\nexport type FeedbackUpload = (file: File) => Promise<string>;\n\n/* ── Send for rework (§4.4.5) ─────────────────────────────────────────────── */\n\n/** 0.40 (§10.3): `POST /feedback/{id}/rework` — the trimmed note and the uploaded file's\n * URL. Return the promise: the section closes when it resolves and keeps the note when\n * it rejects (the toast is the app's: the server's `detail`, else\n * `feedbackToast.updateFailed`). */\nexport type FeedbackReworkSend = (note: string, attachmentUrl?: string) => void | Promise<unknown>;\n\nexport interface FeedbackReworkSectionProps {\n /** The row being sent back: its id, and the body the round is appended to. */\n row: Pick<FeedbackRecord, \"id\" | \"body\">;\n /** 0.40: the rework as an entry of its own — see {@link FeedbackReworkSend}. With it,\n * `onUpdate` is not called. */\n onRework?: FeedbackReworkSend;\n /** The PATCH — see {@link FeedbackDetailUpdate}. Called with `{ id, body }` only, and\n * only without `onRework`: the legacy append (§3.4), which server-kit 0.13 still\n * turns into an entry for one release. Optional since 0.40; pass one of the two. */\n onUpdate?: FeedbackDetailUpdate;\n /** The PATCH is in flight (`update.isPending`). The upload adds its own. */\n pending?: boolean;\n /** The upload. Left out, the note goes without a file field. */\n onUpload?: FeedbackUpload;\n /** Snapshot the app view as a File — the kit's `captureAppScreenshot`, or the app's\n * own. A \"Capture screenshot\" button appears only with it; a rejection (no\n * `modern-screenshot`, a canvas that would not draw) toasts\n * `feedbackToast.captureFailed` and adds nothing. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The round landed — the server has the note and, on an answered row, reopened it. */\n onSent?: () => void;\n onCancel: () => void;\n /** Over the field's defaults: the contract's types and 10 MB (§3.5), the\n * `feedbackToast` refusals, the `feedbackAttachment` words. */\n attachment?: Partial<FeedbackNoteAttachment>;\n /** The send COMMITS — see `FeedbackNoteEditor`'s `commit`. */\n commit?: CommitScope;\n labels?: LabelOverride<FeedbackDetailLabels>;\n}\n\n/**\n * The rework editor (§4.4.5): the submitter sends an answered report\n * back with a note and at most one file, and the server reopens it (§3.4, keksdose\n * `submitRework`, `feedback-page.tsx:350`).\n *\n * - **The note is required** and trimmed: Send stays disabled on a blank box (a file\n * alone cannot be sent; keksdose `:577` dropped that click silently).\n * - **One file**, added, captured or pasted — the dialog's types and 10 MB. It is\n * uploaded FIRST and awaited: a body naming a file that never arrived would be a\n * rework whose evidence is missing, and the upload is the half that fails on its\n * own. If it fails nothing is sent and the toast says so; the note stays in the box.\n * - **0.40: an entry of its own** (§10.3) — with `onRework`, the note and the file's URL\n * go to `POST /feedback/{id}/rework` and the body is not touched. Without it, the\n * legacy append below, which server-kit 0.13 still converts (one minor).\n * - **The body alone goes in the PATCH** — {@link appendRework}'s strict extension of\n * the current body, which is how the server recognises the append and reopens the\n * row. Never a `status` (kastlan's client sent `OPEN`; an author may not write one,\n * so the server refused the whole PATCH, note and all — keksdose live #331).\n *\n * Exported on its own for an app that offers rework somewhere other than the row\n * detail. Kurvenschmiede's author verdict (\"That is it, done\") is NOT here: an answered\n * item stays answered unless its author sends it back (§7.2).\n */\nexport function FeedbackReworkSection({\n row,\n onRework,\n onUpdate,\n pending = false,\n onUpload,\n onCaptureScreenshot,\n onSent,\n onCancel,\n attachment,\n commit,\n labels: labelsProp,\n}: FeedbackReworkSectionProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n const toasts = useFeedbackToastLabels();\n const [uploading, setUploading] = useState(false);\n const [sending, setSending] = useState(false);\n // The body as it is NOW, not as it was when Send was pressed: the list can refresh\n // while the file uploads, and an append to a stale body is no longer a strict\n // extension of the stored one — the server would read it as an edit, and refuse it.\n const latestBody = useRef(row.body);\n useEffect(() => {\n latestBody.current = row.body;\n }, [row.body]);\n\n const capture = onCaptureScreenshot\n ? async () => {\n try {\n return await onCaptureScreenshot();\n } catch {\n toast.error(toasts.captureFailed);\n return null;\n }\n }\n : undefined;\n\n const send = async (value: string, file?: File | null) => {\n const note = value.trim();\n if (!note) return;\n let url: string | null = null;\n if (file && onUpload) {\n setUploading(true);\n try {\n url = await onUpload(file);\n } catch {\n toast.error(labels.reworkUploadFailed);\n return;\n } finally {\n setUploading(false);\n }\n }\n if (onRework) {\n // 0.40 (§10.3): the entry, not the body — the server checks the URL (a 422 outside\n // the app's attachment prefix).\n setSending(true);\n try {\n await onRework(note, url ?? undefined);\n } catch {\n return; // The app's toast; the note stays in the box.\n } finally {\n setSending(false);\n }\n onSent?.();\n return;\n }\n if (!onUpdate) return;\n let body: string | null;\n try {\n body = appendRework(latestBody.current, note, url);\n } catch {\n // The upload answered with something that is not an attachment URL of this\n // contract — written anyway it would sit in the body as prose no reader knows to\n // be a file. As far as the person is concerned, the file did not arrive.\n toast.error(labels.reworkUploadFailed);\n return;\n }\n if (body === null) return;\n onUpdate({ id: row.id, body }, { onSuccess: () => onSent?.() });\n };\n\n return (\n <FeedbackDetailSection title={labels.reworkTitle}>\n <FeedbackNoteEditor\n key={row.id}\n initial=\"\"\n required\n commit={commit}\n pending={pending || uploading || sending}\n onSave={(value, file) => void send(value, file)}\n onCancel={onCancel}\n saveLabel={labels.reworkSend}\n cancelLabel={labels.cancel}\n placeholder={labels.reworkPlaceholder}\n attachment={\n onUpload\n ? {\n accept: FEEDBACK_ATTACHMENT_ACCEPT,\n maxBytes: DEFAULT_MAX_ATTACHMENT_BYTES,\n onError: (kind) => {\n toast.error(kind === \"type\" ? toasts.attachmentUnsupported : toasts.attachmentTooLarge);\n },\n onCaptureScreenshot: capture,\n ...attachment,\n }\n : undefined\n }\n />\n </FeedbackDetailSection>\n );\n}\n\n/* ── The detail (§4.4) ─────────────────────────────────────────────────────── */\n\nexport interface FeedbackRowDetailProps {\n /** The report — the list's own row, as `GET /feedback` / `GET /feedback/my` sent it. */\n row: FeedbackRecord;\n /** The admin on the inbox (`/feedback`): status pills and the outcome editor. `false`\n * on `/my-feedback`, for an admin too (§4.3). */\n canEdit: boolean;\n /** The signed-in user's id — who the AUTHOR is: the description editor and rework. */\n viewerId?: number | null;\n /** The page's PATCH — `update.mutate` (see {@link FeedbackDetailUpdate}). */\n onUpdate: FeedbackDetailUpdate;\n /** `update.isPending`: the editors' save buttons wait for it. */\n pending?: boolean;\n /** `POST /feedback/attachments` for the rework's one file. Left out, a rework is a\n * note alone. */\n onUpload?: FeedbackUpload;\n /** The app's authenticated GET (`AuthedImage`'s) — the pictures and the downloads go\n * through it, since the attachment route wants the bearer token (§3.5). Left out,\n * the browser's own fetch with same-origin cookies. */\n fetcher?: AuthedFetcher | null;\n /**\n * The undoable status change — what `useFeedbackStatusUndo(update.mutate)` returns,\n * the SAME one the table's status cell and the swipes use (§4.5). Left out, the\n * detail builds one from `onUpdate`, which is equivalent as long as `onUpdate` is the\n * page's mutation (its observer outlives the row a status filter removes).\n */\n statusChange?: FeedbackStatusChange;\n /** For the rework's \"Capture screenshot\" — see {@link FeedbackReworkSectionProps}. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The rework's file field, over the contract's defaults. */\n reworkAttachment?: Partial<FeedbackNoteAttachment>;\n /** How the `resolved_at` date reads — the app's date cell, as a string. Default: the\n * kit's `formatDate` in the provider's locale, `medium` style. */\n renderDate?: (iso: string) => string;\n /**\n * The detail's saves COMMIT (description, outcome, rework, status): under a locked\n * `WriteLockProvider` each is `aria-disabled` with the lock's reason, and nothing\n * reaches `onUpdate`. Off by default — keksdose's shell lock is a read-only demo\n * BUDGET, and a person viewing one still owns their own reports.\n */\n commit?: CommitScope;\n /**\n * Open with the subject: the category badge and the title (feedback contract §8.1,\n * keksdose live #395). On by default; `false` for a page that already shows the title\n * beside the detail.\n */\n showSubject?: boolean;\n /**\n * 0.38: `POST /feedback/{id}/replies` (§9.7) — the body and the status picked\n * (`undefined`: \"No change\"). With `canEdit` and a row that carries `replies`, the\n * reply composer stands under the timeline. Return the promise: the box clears when it\n * resolves. A failure is the app's to toast — the server's `detail`, else\n * `feedbackToast.replyFailed` (0.38.1).\n */\n onReply?: (body: string, status?: FeedbackStatus) => void | Promise<unknown>;\n /** 0.38: the reply is in flight. */\n replying?: boolean;\n /**\n * 0.40 (§10.3): `POST /feedback/{id}/rework` — the author's rework as an entry of its\n * own (see {@link FeedbackReworkSend}). The **Rework** button shows only to the author\n * on an answered row, and only where the reply composer is not shown (§10.2 decision 6:\n * an admin answering a report sends it back with a reply whose status is `REWORK`).\n * Left out, the rework goes through `onUpdate` as the legacy body append — for one\n * minor, while the server converts it.\n */\n onRework?: FeedbackReworkSend;\n /** 0.38: the report's comments — the app's `FeedbackCommentThread` — in a section of\n * their own under the replies. A thread here draws the comments alone (0.38.1): the\n * Replies section above has the replies, so whatever `replies` the thread is handed\n * are dropped, and nothing is drawn twice. */\n comments?: ReactNode;\n /** 0.38: `PATCH /feedback/{id} {\"public\": next}` — draws the **Visible to others**\n * switch (`FeedbackPublicSwitch`) in the Status section, for the admin (`canEdit`)\n * and, within §9.3's window, the author. The page's own mutation fits:\n * `onPublicChange={(next) => update.mutate({ id: row.id, public: next })}` —\n * {@link FeedbackDetailPatch}'s `public` (0.38.1). */\n onPublicChange?: (next: boolean) => void;\n labels?: LabelOverride<FeedbackDetailLabels>;\n className?: string;\n}\n\n/**\n * The expanded row of a feedback table (§4.4): what was reported, where, with which\n * files, what the answer was, and where it stands — with the edits each viewer may\n * make. Hand it to `DataTable`'s `expandedRow`:\n *\n * ```tsx\n * const update = useMutation({ mutationFn: ({ id, ...patch }) => api.updateFeedback(id, patch),\n * onSuccess: invalidate, onError: (e) => toast.error(detailOf(e) ?? toastLabels.updateFailed) });\n * const changeStatus = useFeedbackStatusUndo(update.mutate);\n * <DataTable\n * isExpanded={(row) => expandedId === row.id}\n * expandedRow={(row) => (\n * <FeedbackRowDetail row={row} canEdit={isAdmin && !mine} viewerId={user?.id}\n * onUpdate={update.mutate} pending={update.isPending} statusChange={changeStatus}\n * onUpload={api.uploadFeedbackAttachment} fetcher={authedImageFetcher}\n * onCaptureScreenshot={captureAppScreenshot} />\n * )} … />\n * ```\n *\n * Mounted only while its row is expanded, so which editor is open lives here, and\n * collapsing the row closes it. Each editor is keyed by the row's id, so a draft is\n * never thrown away by a list refresh under it.\n */\nexport function FeedbackRowDetail({\n row,\n canEdit,\n viewerId,\n onUpdate,\n pending = false,\n onUpload,\n fetcher,\n statusChange,\n onCaptureScreenshot,\n reworkAttachment,\n renderDate,\n commit,\n showSubject = true,\n onReply,\n replying = false,\n onRework,\n comments,\n onPublicChange,\n labels: labelsProp,\n className,\n}: FeedbackRowDetailProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n // \"placeholder = the dialog's body label\" (§4.4.1): read from the dialog's own\n // namespace, so the two can never say different things.\n const dialogText = useKitLabels(\"feedbackDialog\", DEFAULT_FEEDBACK_DIALOG_LABELS);\n const locale = useKitLocale();\n const ownStatusChange = useFeedbackStatusUndo(onUpdate);\n const changeStatus = statusChange ?? ownStatusChange;\n const [editingBody, setEditingBody] = useState(false);\n const [reworking, setReworking] = useState(false);\n\n const access = feedbackRowAccess(row, { canEdit, viewerId });\n // The body as written, without its file lines (they are shown as files below) — the\n // rework rounds stay in the prose: they are what was said after the answer.\n const bodyText = splitBodyAttachments(row.body).text;\n const { description } = splitDescription(row.body);\n const pageHref = feedbackPageHref(row.context);\n const pageUrl = feedbackPageUrl(row.context);\n const files = feedbackAttachmentUrls(row);\n const fetchFile = fetcher ?? plainFetch;\n const dateText = (iso: string) => (renderDate ? renderDate(iso) : formatDate(iso, \"medium\", { locale }));\n\n const saveDescription = (value: string) => {\n // Only a real change makes a round trip; clearing it is one (\"\" — the description\n // is optional, §7.4), and the rounds and file lines go back unchanged.\n if (value.trim() === description.trim()) {\n setEditingBody(false);\n return;\n }\n onUpdate({ id: row.id, body: replaceDescription(row.body, value) }, { onSuccess: () => setEditingBody(false) });\n };\n\n // 0.38 (§9.7): the replies replace the outcome; a row without them is a server before\n // 0.38, whose frozen outcome is shown as it is, read-only.\n const replies = row.replies;\n const commentLabels = useKitLabels(\"feedbackComments\", DEFAULT_FEEDBACK_COMMENTS_LABELS);\n // 0.40 (§10.2 decision 6): whoever has the reply composer answers with it — REWORK is\n // one of its statuses — so the Rework button is for an author without it.\n const composerShown = Boolean(replies && access.canEditOutcome && onReply);\n const canRework = access.canRework && !composerShown;\n const showRework = canRework && reworking;\n\n return (\n <FeedbackDetail className={className}>\n {showSubject && (\n <FeedbackDetailSection title={labels.subject}>\n <p className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm\" data-feedback-subject=\"\">\n <FeedbackCategoryBadge category={row.category} />\n <span className=\"min-w-0 font-medium text-primary [overflow-wrap:anywhere]\">\n {row.title}\n </span>\n </p>\n </FeedbackDetailSection>\n )}\n <FeedbackDetailSection\n title={labels.body}\n action={\n access.canEditDescription && !editingBody ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={(event) => {\n event.stopPropagation();\n setEditingBody(true);\n }}\n aria-label={labels.editDescription}\n >\n {labels.edit}\n </Button>\n ) : undefined\n }\n >\n {access.canEditDescription && editingBody ? (\n <FeedbackNoteEditor\n key={row.id}\n // The ORIGINAL description only — see the module note.\n initial={description}\n pending={pending}\n commit={commit}\n onSave={saveDescription}\n onCancel={() => setEditingBody(false)}\n saveLabel={labels.save}\n cancelLabel={labels.cancel}\n placeholder={dialogText.bodyOptional ?? dialogText.body}\n />\n ) : (\n <FeedbackProse>{bodyText.trim() ? bodyText : undefined}</FeedbackProse>\n )}\n </FeedbackDetailSection>\n\n {pageHref && pageUrl && (\n // The page it was filed on, with the full URL a click away (keksdose #278).\n <FeedbackDetailSection title={labels.url}>\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <TextLink href={pageHref} tone=\"secondary\" underline=\"hover\" stopPropagation className=\"min-w-0\">\n <code className=\"break-all text-xs\">{pageHref}</code>\n </TextLink>\n <CopyButton size=\"xs\" className=\"shrink-0\" text={pageUrl} label={labels.copyUrl} stopPropagation />\n </div>\n </FeedbackDetailSection>\n )}\n\n {files.length > 0 && (\n <FeedbackDetailSection title={labels.attachment}>\n <div className=\"flex min-w-0 flex-wrap items-start gap-2\">\n {files.map((url) =>\n isImageAttachment(url) ? (\n <AuthedImage\n key={url}\n src={url}\n alt={labels.attachment}\n fetcher={fetchFile}\n link\n stopPropagation\n // A broken attachment is simply not in the row (keksdose's\n // AuthedImage default) rather than a grey tile per failure.\n errorFallback={null}\n wrapperClassName=\"inline-block max-w-full\"\n className=\"max-h-64 max-w-full rounded border border-subtle\"\n />\n ) : (\n <AttachmentDownload key={url} url={url} fetcher={fetchFile} labels={labels} />\n ),\n )}\n </div>\n </FeedbackDetailSection>\n )}\n\n <FeedbackDetailSection\n title={replies ? labels.replies : labels.outcome}\n // When the row entered DONE / WONT_DO (keksdose feedback #96).\n action={\n row.resolved_at ? (\n <span className=\"text-xs text-muted\">{labels.resolvedAt(dateText(row.resolved_at))}</span>\n ) : undefined\n }\n >\n <div className=\"space-y-3\">\n {replies ? (\n <FeedbackReplyTimeline replies={replies} />\n ) : (\n <FeedbackProse>{row.outcome || undefined}</FeedbackProse>\n )}\n {composerShown && replies && onReply && (\n <FeedbackReplyComposer\n key={row.id}\n status={row.status}\n onReply={onReply}\n pending={replying}\n suggestedStatus={feedbackReplyNudge(row)}\n commit={commit}\n />\n )}\n {/* No \"Open page\" button here since 0.46 (keksdose live #449): the URL section\n above already links the page, with the path on screen. */}\n {canRework && !reworking && (\n <div className=\"flex flex-wrap gap-2\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={(event) => {\n event.stopPropagation();\n setReworking(true);\n }}\n >\n <RotateCcw className=\"size-3.5\" aria-hidden /> {labels.rework}\n </Button>\n </div>\n )}\n </div>\n </FeedbackDetailSection>\n\n {comments != null && (\n <FeedbackDetailSection title={commentLabels.comments}>\n <FeedbackRepliesDrawnAboveContext.Provider value>{comments}</FeedbackRepliesDrawnAboveContext.Provider>\n </FeedbackDetailSection>\n )}\n\n {showRework && (\n <FeedbackReworkSection\n row={row}\n onRework={onRework}\n onUpdate={onUpdate}\n pending={pending}\n onUpload={onUpload}\n onCaptureScreenshot={onCaptureScreenshot}\n onSent={() => setReworking(false)}\n onCancel={() => setReworking(false)}\n attachment={reworkAttachment}\n commit={commit}\n labels={labelsProp}\n />\n )}\n\n <FeedbackDetailSection title={labels.status}>\n {/* Expanded: the whole enum in one click for the admin (keksdose feedback #421);\n everyone else the narrow set, read-only — a picture of the workflow. */}\n <FeedbackStatusTransitions\n status={row.status}\n statuses={\n access.canChangeStatus ? selectableFeedbackStatuses(row.status) : visibleFeedbackStatuses(row.status)\n }\n canEdit={access.canChangeStatus}\n commit={commit}\n onPick={(status) => changeStatus(row, status)}\n variant=\"pill\"\n />\n {onPublicChange && (\n <FeedbackPublicSwitch\n row={row}\n isAdmin={canEdit}\n viewerId={viewerId}\n onChange={onPublicChange}\n pending={pending}\n commit={commit}\n className=\"mt-3\"\n />\n )}\n </FeedbackDetailSection>\n </FeedbackDetail>\n );\n}\n"],"mappings":";AAwTI,SASE,KATF;AAxTJ,SAAS,WAAW,QAAQ,gBAAgB;AAE5C,SAAS,UAAU,UAAU,iBAAiB;AAC9C,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB,SAAS,cAAc,oBAAwC;AAC/D,SAAS,yBAAyB,gBAAgB;AAClD,SAAS,kBAAkB;AAC3B,SAAS,oCAAoC;AAC7C,SAAS,sCAAsC;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,6BAA6B;AAGtC,SAAS,sCAAsC;AAC/C,SAAS,uBAAuB,uBAAuB,0BAA0B;AACjF,SAAS,4BAA4B;AACrC,SAAS,wCAAwC;AACjD,SAAS,wCAAwC;AAgI1C,SAAS,wBAAwB,QAAoE;AAC1G,SAAO,aAAa,kBAAkB,gCAAgC,MAAM;AAC9E;AAMA,SAAS,UAAU,SAAyD;AAC1E,QAAM,OAAO,SAAS,OAAO,SAAS,SAAS,IAAI,KAAK;AACxD,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AAIF,UAAM,MAAM,IAAI,IAAI,KAAK,kBAAkB;AAC3C,WA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QAAC;AAAA;AAAA,UACC,QAAQ,IAAI;AAAA,UACZ,UACE,OAAO,kBAAkB,2BAA2B,IAAI,MAAM,IAAI,wBAAwB,IAAI,MAAM;AAAA,UAEtG,SAAS,OAAO;AAAA,UAChB;AAAA,UACA,QAAQ,CAAC,WAAW,aAAa,KAAK,MAAM;AAAA,UAC5C,SAAQ;AAAA;AAAA,MACV;AAAA,MACC,kBACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA,WAAU;AAAA;AAAA,MACZ;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/feedback/feedback-row-detail.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { RotateCcw } from \"lucide-react\";\nimport { AuthedImage } from \"../components/authed-image\";\nimport { CopyButton } from \"../components/copy-button\";\nimport { TextLink } from \"../components/text-link\";\nimport { toast } from \"../components/toast\";\nimport { Button } from \"../components/button\";\nimport type { AuthedFetcher } from \"../hooks/use-authed-src\";\nimport { useKitLabels, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport { formatDate } from \"../lib/format\";\nimport { DEFAULT_MAX_ATTACHMENT_BYTES } from \"./feedback-attachment\";\nimport { DEFAULT_FEEDBACK_DIALOG_LABELS } from \"./feedback-dialog\";\nimport {\n FeedbackCategoryBadge,\n FeedbackDetail,\n FeedbackDetailSection,\n FeedbackNoteEditor,\n FeedbackProse,\n FeedbackStatusTransitions,\n selectableFeedbackStatuses,\n visibleFeedbackStatuses,\n} from \"./feedback-inbox\";\nimport type { FeedbackNoteAttachment, FeedbackStatus } from \"./feedback-inbox\";\nimport { useFeedbackToastLabels } from \"./feedback-labels\";\nimport {\n FEEDBACK_ATTACHMENT_ACCEPT,\n FEEDBACK_AUTHOR_EDITABLE_STATUSES,\n FEEDBACK_REWORKABLE_STATUSES,\n appendRework,\n isImageAttachment,\n replaceDescription,\n splitBodyAttachments,\n splitDescription,\n} from \"./feedback-record\";\nimport type { FeedbackContext, FeedbackRecord } from \"./feedback-record\";\nimport { useFeedbackStatusUndo } from \"./feedback-status-undo\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_DETAIL_LABELS } from \"./feedback-row-detail-labels\";\nimport { FeedbackReplyComposer, FeedbackReplyTimeline, feedbackReplyNudge } from \"./feedback-replies\";\nimport { FeedbackAttachmentDownload, plainFeedbackFetch } from \"./feedback-attachment-download\";\nimport { FeedbackPublicSwitch } from \"./feedback-public-switch\";\nimport { FeedbackRepliesDrawnAboveContext } from \"./feedback-replies-context\";\nimport { DEFAULT_FEEDBACK_COMMENTS_LABELS } from \"./feedback-thread-parts-labels\";\n\n/**\n * One report, opened — the panel a feedback table unfolds under its row (§4.4 of\n * docs/feedback-harmonization.md), lifted from keksdose's `FeedbackRow`\n * (`frontend/src/features/feedback/feedback-page.tsx:329-612`) with the contract's\n * changes applied.\n *\n * Until 0.27 each app wrote this panel itself out of the kit's shell\n * (`FeedbackDetail` / `FeedbackDetailSection` / `FeedbackNoteEditor`), and the three\n * copies had drifted in exactly the places a user notices:\n *\n * - **the description editor held the raw body** — keksdose `initial={fb.body}`\n * (`:420`), kastlan the same (`pages/feedback-page.tsx:226`) — so an author fixing a\n * typo could delete the `--- REWORK … ---` rounds and the `[screenshot]` file lines\n * with it, and the history was gone. Here the editor holds the ORIGINAL description\n * only ({@link splitDescription}) and saves through {@link replaceDescription}, which\n * puts every appended block and file line back unchanged;\n * - **kastlan's rework sent `status: \"OPEN\"`** from the client (`:189-195`) and offered it\n * on three statuses; keksdose sends the body alone and lets the server reopen the row\n * on five (live #331). The contract is keksdose's (§3.4) — {@link appendRework}, one\n * file, the server reopens;\n * - **kastlan showed only `screenshot_url`** (`:265-276`) and no downloads; keksdose the\n * screenshot, the other files and the rework pictures, a PDF as a download (dev #578);\n * - **the URL fell away on Kurvenschmiede's rows**, whose backfilled `context.url` is a\n * path (`/accounts?p=2`): keksdose's `new URL(…)` throws on one and the section\n * vanished. kastlan already fell back to `context.route` (`feedbackRaw`, `:97`).\n *\n * The sections, in the contract's order: **Subject** (the category and the title, §8.1;\n * `showSubject={false}` leaves it out), **Description** (the body; the author's\n * Edit while OPEN / READY / IN_PROGRESS), **URL**, **Attachment**, **Replies** (0.38,\n * §9.7: the timeline, the admin's reply composer with its status picker and the nudge,\n * Rework — on a row without `replies`, a server before 0.38, the frozen\n * **Outcome** read-only in its place), **Comments** (0.38: the app's\n * `FeedbackCommentThread`, when passed), **Send for rework** (only while reworking) and\n * **Status** (with the **Visible to others** switch when `onPublicChange` is passed).\n *\n * The app keeps its data and its API: the row it renders, the PATCH (`onUpdate`), the\n * upload (`onUpload`), the authenticated GET (`fetcher`) and who is looking (`canEdit`,\n * `viewerId`). Every word is the kit's `feedbackDetail` namespace.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackDetail` — the row detail's words (§4.4). English: keksdose's `en.json`\n * (`feedback.*`, `common.*`, `more.copy_url`) with the contract's changes; the de-CH\n * canon (keksdose `de-CH.json`, ss never ß, \"Nacharbeit\" throughout — §7.14) on each key.\n */\nexport interface FeedbackDetailLabels {\n /** The first section's heading: what the report is called (feedback contract §8.1,\n * keksdose live #395 — with the row expanded and the table scrolled, nothing said\n * which entry was being answered). de-CH: \"Betreff\" */\n subject: string;\n /** The description section's heading — keksdose's `feedback.body` (§7.3). The dialog's field asks\n * \"What happened? (optional)\"; the description, once filed, is headed as what it is\n * — and as the author's \"Edit description\" calls it. de-CH: \"Beschreibung\" */\n body: string;\n /** The author's button on that heading. de-CH: \"Bearbeiten\" */\n edit: string;\n /** Its accessible name — says WHAT is edited; contains the visible word.\n * de-CH: \"Beschreibung bearbeiten\" */\n editDescription: string;\n /** The editors' save button (description, outcome). de-CH: \"Speichern\" */\n save: string;\n /** Every editor's cancel button. de-CH: \"Abbrechen\" */\n cancel: string;\n /** Section 2's heading. de-CH: \"URL\" */\n url: string;\n /** The copy button beside the link — copies the FULL `context.url`.\n * de-CH: \"URL kopieren\" */\n copyUrl: string;\n /** Section 3's heading, and each picture's alt text. de-CH: \"Anhang\" */\n attachment: string;\n /** A PDF's / text file's download button, given the file's name.\n * de-CH: \"{{name}} herunterladen\" */\n download: (name: string) => string;\n /** The toast when that download failed. de-CH: \"Der Anhang konnte nicht\n * heruntergeladen werden.\" */\n downloadFailed: string;\n /** Section 4's heading on a row without `replies` (a server before 0.38), where the\n * frozen outcome is shown read-only. de-CH: \"Ergebnis\" */\n outcome: string;\n /** Section 4's heading since 0.38: the replies' timeline (§9.7). de-CH: \"Antworten\" */\n replies: string;\n /** On section 4's heading line once the row is settled, given the formatted\n * `resolved_at` date. de-CH: \"Erledigt am: {{date}}\" */\n resolvedAt: (date: string) => string;\n /** The admin's button while there is no outcome. **Unused since 0.38** (the outcome is\n * frozen, §9.7; a reply is written instead); kept for one release.\n * de-CH: \"Ergebnis hinzufügen\" */\n outcomeAdd: string;\n /** The same button once there is one. Unused since 0.38, as `outcomeAdd`.\n * de-CH: \"Aktualisieren\" */\n outcomeUpdate: string;\n /** The line above the outcome editor. Unused since 0.38, as `outcomeAdd`. de-CH: \"Was wurde umgesetzt, entschieden oder\n * warum nicht.\" */\n outcomePlaceholder: string;\n /** The button that opens section 5 on an answered row. de-CH: \"Nacharbeit\" */\n rework: string;\n /** Section 5's heading. de-CH: \"Zur Nacharbeit senden\" */\n reworkTitle: string;\n /** Section 5's send button. de-CH: \"Nacharbeit senden\" */\n reworkSend: string;\n /** The line above the rework note. de-CH: \"Was muss noch angepasst werden? Neue\n * Anforderungen oder Richtungswechsel.\" */\n reworkPlaceholder: string;\n /** The toast when the rework's file did not upload — and so nothing was sent. Names\n * no screenshot: it fires for a PDF or a log too (§7.14; keksdose's said\n * \"screenshot\"). de-CH: \"Die Datei konnte nicht hochgeladen werden. Die Nacharbeit\n * wurde nicht gesendet.\" */\n reworkUploadFailed: string;\n /** Section 6's heading. de-CH: \"Status\" */\n status: string;\n /** A `FeedbackNoteEditor`'s box, named when no `placeholder` line names it and the\n * caller gives no `label` — without it the box was read out as just \"edit text\"\n * (round 0.34, the showcase's axe check). de-CH: \"Notiz\" */\n note: string;\n}\n\n// Defined in ./feedback-row-detail-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_DETAIL_LABELS };\n\n/** `feedbackDetail` resolved: English, then `<UiKitProvider labels>`, then `labels`. */\nexport function useFeedbackDetailLabels(labels?: LabelOverride<FeedbackDetailLabels>): FeedbackDetailLabels {\n return useKitLabels(\"feedbackDetail\", DEFAULT_FEEDBACK_DETAIL_LABELS, labels);\n}\n\n/* ── The page a report was filed on (§3.2, §4.4.2) ────────────────────────── */\n\n/** `context.url`, else `context.route` — a parsed URL, or null when neither is set or\n * the value is no http(s) address or path (a `javascript:` value is not a page). */\nfunction parsePage(context: FeedbackContext | null | undefined): URL | null {\n const raw = (context?.url || context?.route || \"\").trim();\n if (!raw) return null;\n try {\n // A base, so a PATH-ONLY value parses too: Kurvenschmiede backfills its old rows\n // with `url = page_path + search` (§3.2), and keksdose's `new URL(raw)` threw on\n // those and dropped the section.\n const url = new URL(raw, \"http://localhost\");\n return url.protocol === \"http:\" || url.protocol === \"https:\" ? url : null;\n } catch {\n return null;\n }\n}\n\n/** Collapses a leading `//` run: `/\\/\\/evil.example/` as a path would be a\n * protocol-relative link off the app. */\nconst localPath = (pathname: string) => pathname.replace(/^\\/{2,}/, \"/\");\n\n/**\n * The in-app link to the page a report was filed on — path + query + hash (keksdose\n * `localHref`: the query and hash carry the state worth restoring, `?tab=import`, a\n * drill-down). Read from `context.url`, else `context.route`; a path-only `url` works.\n * Always a path on THIS app, never another origin's address, so it is safe as an\n * `href` whatever the row says. `null` when there is nothing to link.\n */\nexport function feedbackPageHref(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? `${localPath(url.pathname)}${url.search}${url.hash}` : null;\n}\n\n/** The page's path alone — the compact text a URL column shows (§4.3). */\nexport function feedbackPagePath(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? localPath(url.pathname) : null;\n}\n\n/**\n * What \"Copy URL\" copies: the FULL `context.url` as the reporter's browser had it —\n * origin included, which is the one part that says which copy of the app it was\n * (feedback #278) — else `context.route`. `null` when there is no page.\n */\nexport function feedbackPageUrl(context: FeedbackContext | null | undefined): string | null {\n if (!parsePage(context)) return null;\n return (context?.url || context?.route || \"\").trim();\n}\n\n/* ── Attachments (§3.5, §4.4.3) ───────────────────────────────────────────── */\n\n/**\n * Every file a report carries, in the order the detail shows them (§4.4.3): the\n * screenshot it was filed with, then its other files, then whatever the rework rounds\n * brought, in body order (keksdose dev #578, live #291). One list rather than three —\n * a reader looking for \"the picture\" should not have to know at which point in the\n * conversation it was taken.\n *\n * Each URL once: keksdose and Kurvenschmiede content-address their keys, so the same\n * screenshot pasted twice is one URL — shown twice it is the same picture twice (and,\n * keyed by URL, a React key clash keksdose had).\n */\nexport function feedbackAttachmentUrls(\n row: Pick<FeedbackRecord, \"screenshot_url\" | \"attachment_urls\" | \"body\"> &\n Partial<Pick<FeedbackRecord, \"replies\">>,\n): string[] {\n const urls = [\n ...(row.screenshot_url ? [row.screenshot_url] : []),\n // `?? []`: NULL on rows filed before the column, and no key at all from a server\n // that predates it (keksdose dev #578).\n ...(row.attachment_urls ?? []),\n ...splitBodyAttachments(row.body).urls,\n // 0.40 (§10.3): a rework entry's one file, in entry order — where the rework\n // pictures of the body were before.\n ...(row.replies ?? []).flatMap((reply) =>\n reply.kind === \"rework\" && reply.attachment_url ? [reply.attachment_url] : [],\n ),\n ];\n return [...new Set(urls)];\n}\n\n/* ── Who may do what (§3.4, §4.3, §4.4) ───────────────────────────────────── */\n\n/** What the person looking at a row may do with it — {@link feedbackRowAccess}. */\nexport interface FeedbackRowAccess {\n /** The viewer filed it (`viewerId === row.user_id`; never for an erased author). */\n isAuthor: boolean;\n /** \"Edit description\": the author, while the row is OPEN, READY or IN_PROGRESS — on either\n * page (keksdose `canAuthorEdit`, `feedback-page.tsx:398`, is not gated on `mine`). */\n canEditDescription: boolean;\n /** The admin on the inbox (`canEdit`): since 0.38 the reply composer (the outcome\n * itself is frozen, §9.7). */\n canEditOutcome: boolean;\n /** \"Rework\": the author, on an answered row ({@link FEEDBACK_REWORKABLE_STATUSES}).\n * Since 0.40 (§10.2 decision 6) the author's only — an admin sends a report back with\n * a reply whose status is `REWORK`; the server answers anyone else 403. */\n canRework: boolean;\n /** The status pills: the admin on the inbox; everyone else sees them read-only. */\n canChangeStatus: boolean;\n}\n\n/**\n * The detail's permission rules in one place — the same answers the server gives\n * (§3.4), so the panel never offers what the PATCH would refuse.\n *\n * `canEdit` is the app's \"admin on `/feedback`\": an admin on `/my-feedback` edits no\n * status and no outcome there (§4.3), but as the author still edits the description\n * and sends for rework. `viewerId` is the signed-in user's id.\n */\nexport function feedbackRowAccess(\n row: Pick<FeedbackRecord, \"user_id\" | \"status\">,\n { canEdit, viewerId }: { canEdit: boolean; viewerId?: number | null },\n): FeedbackRowAccess {\n // `user_id: null` is an erased author (keksdose live #275): nobody is that author,\n // least of all a viewer whose id happens to be missing too.\n const isAuthor = row.user_id !== null && viewerId !== undefined && viewerId !== null && viewerId === row.user_id;\n return {\n isAuthor,\n canEditDescription: isAuthor && FEEDBACK_AUTHOR_EDITABLE_STATUSES.includes(row.status),\n canEditOutcome: canEdit,\n canRework: isAuthor && FEEDBACK_REWORKABLE_STATUSES.includes(row.status),\n canChangeStatus: canEdit,\n };\n}\n\n/* ── The PATCH ─────────────────────────────────────────────────────────────── */\n\n/** What the detail sends as `PATCH /feedback/{id}` (§3.4): the body (a description\n * edit, a rework append) or the outcome — and, through {@link useFeedbackStatusUndo}\n * when no `statusChange` is given, the status. Never two at once: a rework PATCH must\n * carry the body ALONE for the server to read it as an append (keksdose live #331). */\nexport interface FeedbackDetailPatch {\n id: number;\n body?: string;\n /** `null` clears it — a real edit. **Frozen since 0.38** (§9.7): server-kit 0.11\n * answers 422; the detail no longer sends it (a reply is written instead). */\n outcome?: string | null;\n status?: FeedbackStatus;\n /** 0.38.1: the **Visible to others** flip (§9.3) — what `onPublicChange`'s\n * `PATCH /feedback/{id} {\"public\": next}` carries, alone, so an app can send it\n * through the same `onUpdate` mutation. */\n public?: boolean;\n}\n\n/**\n * The page's update mutation. **TanStack Query's `mutate` fits as it stands** — pass\n * `update.mutate` (and `pending={update.isPending}`), the same function\n * `useFeedbackStatusUndo` takes. A hand-written one sends the PATCH and calls\n * `onSuccess` once it has landed, and only then: that is when an editor closes. A\n * failure is the mutation's own to toast — the server's `detail`, else\n * `feedbackToast.updateFailed` (§4.4) — and leaves the editor open with its draft.\n */\nexport type FeedbackDetailUpdate = (patch: FeedbackDetailPatch, callbacks: { onSuccess: () => void }) => void;\n\n/** `POST /feedback/attachments` (§3.3): one file up, its URL\n * (`/api/v1/feedback/attachments/<key>`) back. Reject on failure. */\nexport type FeedbackUpload = (file: File) => Promise<string>;\n\n/* ── Send for rework (§4.4.5) ─────────────────────────────────────────────── */\n\n/** 0.40 (§10.3): `POST /feedback/{id}/rework` — the trimmed note and the uploaded file's\n * URL. Return the promise: the section closes when it resolves and keeps the note when\n * it rejects (the toast is the app's: the server's `detail`, else\n * `feedbackToast.updateFailed`). */\nexport type FeedbackReworkSend = (note: string, attachmentUrl?: string) => void | Promise<unknown>;\n\nexport interface FeedbackReworkSectionProps {\n /** The row being sent back: its id, and the body the round is appended to. */\n row: Pick<FeedbackRecord, \"id\" | \"body\">;\n /** 0.40: the rework as an entry of its own — see {@link FeedbackReworkSend}. With it,\n * `onUpdate` is not called. */\n onRework?: FeedbackReworkSend;\n /** The PATCH — see {@link FeedbackDetailUpdate}. Called with `{ id, body }` only, and\n * only without `onRework`: the legacy append (§3.4), which server-kit 0.13 still\n * turns into an entry for one release. Optional since 0.40; pass one of the two. */\n onUpdate?: FeedbackDetailUpdate;\n /** The PATCH is in flight (`update.isPending`). The upload adds its own. */\n pending?: boolean;\n /** The upload. Left out, the note goes without a file field. */\n onUpload?: FeedbackUpload;\n /** Snapshot the app view as a File — the kit's `captureAppScreenshot`, or the app's\n * own. A \"Capture screenshot\" button appears only with it; a rejection (no\n * `modern-screenshot`, a canvas that would not draw) toasts\n * `feedbackToast.captureFailed` and adds nothing. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The round landed — the server has the note and, on an answered row, reopened it. */\n onSent?: () => void;\n onCancel: () => void;\n /** Over the field's defaults: the contract's types and 10 MB (§3.5), the\n * `feedbackToast` refusals, the `feedbackAttachment` words. */\n attachment?: Partial<FeedbackNoteAttachment>;\n /** The send COMMITS — see `FeedbackNoteEditor`'s `commit`. */\n commit?: CommitScope;\n labels?: LabelOverride<FeedbackDetailLabels>;\n}\n\n/**\n * The rework editor (§4.4.5): the submitter sends an answered report\n * back with a note and at most one file, and the server reopens it (§3.4, keksdose\n * `submitRework`, `feedback-page.tsx:350`).\n *\n * - **The note is required** and trimmed: Send stays disabled on a blank box (a file\n * alone cannot be sent; keksdose `:577` dropped that click silently).\n * - **One file**, added, captured or pasted — the dialog's types and 10 MB. It is\n * uploaded FIRST and awaited: a body naming a file that never arrived would be a\n * rework whose evidence is missing, and the upload is the half that fails on its\n * own. If it fails nothing is sent and the toast says so; the note stays in the box.\n * - **0.40: an entry of its own** (§10.3) — with `onRework`, the note and the file's URL\n * go to `POST /feedback/{id}/rework` and the body is not touched. Without it, the\n * legacy append below, which server-kit 0.13 still converts (one minor).\n * - **The body alone goes in the PATCH** — {@link appendRework}'s strict extension of\n * the current body, which is how the server recognises the append and reopens the\n * row. Never a `status` (kastlan's client sent `OPEN`; an author may not write one,\n * so the server refused the whole PATCH, note and all — keksdose live #331).\n *\n * Exported on its own for an app that offers rework somewhere other than the row\n * detail. Kurvenschmiede's author verdict (\"That is it, done\") is NOT here: an answered\n * item stays answered unless its author sends it back (§7.2).\n */\nexport function FeedbackReworkSection({\n row,\n onRework,\n onUpdate,\n pending = false,\n onUpload,\n onCaptureScreenshot,\n onSent,\n onCancel,\n attachment,\n commit,\n labels: labelsProp,\n}: FeedbackReworkSectionProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n const toasts = useFeedbackToastLabels();\n const [uploading, setUploading] = useState(false);\n const [sending, setSending] = useState(false);\n // The body as it is NOW, not as it was when Send was pressed: the list can refresh\n // while the file uploads, and an append to a stale body is no longer a strict\n // extension of the stored one — the server would read it as an edit, and refuse it.\n const latestBody = useRef(row.body);\n useEffect(() => {\n latestBody.current = row.body;\n }, [row.body]);\n\n const capture = onCaptureScreenshot\n ? async () => {\n try {\n return await onCaptureScreenshot();\n } catch {\n toast.error(toasts.captureFailed);\n return null;\n }\n }\n : undefined;\n\n const send = async (value: string, file?: File | null) => {\n const note = value.trim();\n if (!note) return;\n let url: string | null = null;\n if (file && onUpload) {\n setUploading(true);\n try {\n url = await onUpload(file);\n } catch {\n toast.error(labels.reworkUploadFailed);\n return;\n } finally {\n setUploading(false);\n }\n }\n if (onRework) {\n // 0.40 (§10.3): the entry, not the body — the server checks the URL (a 422 outside\n // the app's attachment prefix).\n setSending(true);\n try {\n await onRework(note, url ?? undefined);\n } catch {\n return; // The app's toast; the note stays in the box.\n } finally {\n setSending(false);\n }\n onSent?.();\n return;\n }\n if (!onUpdate) return;\n let body: string | null;\n try {\n body = appendRework(latestBody.current, note, url);\n } catch {\n // The upload answered with something that is not an attachment URL of this\n // contract — written anyway it would sit in the body as prose no reader knows to\n // be a file. As far as the person is concerned, the file did not arrive.\n toast.error(labels.reworkUploadFailed);\n return;\n }\n if (body === null) return;\n onUpdate({ id: row.id, body }, { onSuccess: () => onSent?.() });\n };\n\n return (\n <FeedbackDetailSection title={labels.reworkTitle}>\n <FeedbackNoteEditor\n key={row.id}\n initial=\"\"\n required\n commit={commit}\n pending={pending || uploading || sending}\n onSave={(value, file) => void send(value, file)}\n onCancel={onCancel}\n saveLabel={labels.reworkSend}\n cancelLabel={labels.cancel}\n placeholder={labels.reworkPlaceholder}\n attachment={\n onUpload\n ? {\n accept: FEEDBACK_ATTACHMENT_ACCEPT,\n maxBytes: DEFAULT_MAX_ATTACHMENT_BYTES,\n onError: (kind) => {\n toast.error(kind === \"type\" ? toasts.attachmentUnsupported : toasts.attachmentTooLarge);\n },\n onCaptureScreenshot: capture,\n ...attachment,\n }\n : undefined\n }\n />\n </FeedbackDetailSection>\n );\n}\n\n/* ── The detail (§4.4) ─────────────────────────────────────────────────────── */\n\nexport interface FeedbackRowDetailProps {\n /** The report — the list's own row, as `GET /feedback` / `GET /feedback/my` sent it. */\n row: FeedbackRecord;\n /** The admin on the inbox (`/feedback`): status pills and the outcome editor. `false`\n * on `/my-feedback`, for an admin too (§4.3). */\n canEdit: boolean;\n /** The signed-in user's id — who the AUTHOR is: the description editor and rework. */\n viewerId?: number | null;\n /** The page's PATCH — `update.mutate` (see {@link FeedbackDetailUpdate}). */\n onUpdate: FeedbackDetailUpdate;\n /** `update.isPending`: the editors' save buttons wait for it. */\n pending?: boolean;\n /** `POST /feedback/attachments` for the rework's one file and, since 0.47 (§12) with\n * `replyAttachments`, the admin reply's. Left out, a rework or a reply is text alone. */\n onUpload?: FeedbackUpload;\n /** The app's authenticated GET (`AuthedImage`'s) — the pictures and the downloads go\n * through it, since the attachment route wants the bearer token (§3.5). Left out,\n * the browser's own fetch with same-origin cookies. */\n fetcher?: AuthedFetcher | null;\n /**\n * The undoable status change — what `useFeedbackStatusUndo(update.mutate)` returns,\n * the SAME one the table's status cell and the swipes use (§4.5). Left out, the\n * detail builds one from `onUpdate`, which is equivalent as long as `onUpdate` is the\n * page's mutation (its observer outlives the row a status filter removes).\n */\n statusChange?: FeedbackStatusChange;\n /** For the rework's and (0.47, with `replyAttachments`) the reply composer's \"Capture screenshot\" — see\n * {@link FeedbackReworkSectionProps}. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The rework's and (0.47, with `replyAttachments`) the reply composer's file field,\n * over the contract's defaults. */\n reworkAttachment?: Partial<FeedbackNoteAttachment>;\n /** How the `resolved_at` date reads — the app's date cell, as a string. Default: the\n * kit's `formatDate` in the provider's locale, `medium` style. */\n renderDate?: (iso: string) => string;\n /**\n * The detail's saves COMMIT (description, outcome, rework, status): under a locked\n * `WriteLockProvider` each is `aria-disabled` with the lock's reason, and nothing\n * reaches `onUpdate`. Off by default — keksdose's shell lock is a read-only demo\n * BUDGET, and a person viewing one still owns their own reports.\n */\n commit?: CommitScope;\n /**\n * Open with the subject: the category badge and the title (feedback contract §8.1,\n * keksdose live #395). On by default; `false` for a page that already shows the title\n * beside the detail.\n */\n showSubject?: boolean;\n /**\n * 0.38: `POST /feedback/{id}/replies` (§9.7) — the body and the status picked\n * (`undefined`: \"No change\"). With `canEdit` and a row that carries `replies`, the\n * reply composer stands under the timeline. Return the promise: the box clears when it\n * resolves. A failure is the app's to toast — the server's `detail`, else\n * `feedbackToast.replyFailed` (0.38.1).\n *\n * 0.47 (§12, keksdose live #447): with `replyAttachments` (and `onUpload`) the\n * composer takes one file as the rework note does — pasted into the box, captured or\n * picked — uploaded first, and its URL is the third argument (`attachment_url` in the\n * body; server-kit 0.18).\n */\n onReply?: (body: string, status?: FeedbackStatus, attachmentUrl?: string) => void | Promise<unknown>;\n /**\n * 0.47 (§12): the reply composer takes one file — through `onUpload`,\n * `onCaptureScreenshot` and `reworkAttachment`, the rework note's. Off by default:\n * `onUpload` alone stays the rework's, so a page that passes it and an `onReply` of\n * `(body, status)` does not grow a file field whose file its reply would drop (round\n * 0.47 build reviews, keksdose and kastlan B1). Turn it on in the commit that makes\n * `onReply` send its third argument as `attachment_url`, with server-kit 0.18 (an\n * older server answers the field with a 422).\n */\n replyAttachments?: boolean;\n /** 0.38: the reply is in flight. */\n replying?: boolean;\n /**\n * 0.40 (§10.3): `POST /feedback/{id}/rework` — the author's rework as an entry of its\n * own (see {@link FeedbackReworkSend}). The **Rework** button shows only to the author\n * on an answered row, and only where the reply composer is not shown (§10.2 decision 6:\n * an admin answering a report sends it back with a reply whose status is `REWORK`).\n * Left out, the rework goes through `onUpdate` as the legacy body append — for one\n * minor, while the server converts it.\n */\n onRework?: FeedbackReworkSend;\n /** 0.38: the report's comments — the app's `FeedbackCommentThread` — in a section of\n * their own under the replies. A thread here draws the comments alone (0.38.1): the\n * Replies section above has the replies, so whatever `replies` the thread is handed\n * are dropped, and nothing is drawn twice. */\n comments?: ReactNode;\n /** 0.38: `PATCH /feedback/{id} {\"public\": next}` — draws the **Visible to others**\n * switch (`FeedbackPublicSwitch`) in the Status section, for the admin (`canEdit`)\n * and, within §9.3's window, the author. The page's own mutation fits:\n * `onPublicChange={(next) => update.mutate({ id: row.id, public: next })}` —\n * {@link FeedbackDetailPatch}'s `public` (0.38.1). */\n onPublicChange?: (next: boolean) => void;\n labels?: LabelOverride<FeedbackDetailLabels>;\n className?: string;\n}\n\n/**\n * The expanded row of a feedback table (§4.4): what was reported, where, with which\n * files, what the answer was, and where it stands — with the edits each viewer may\n * make. Hand it to `DataTable`'s `expandedRow`:\n *\n * ```tsx\n * const update = useMutation({ mutationFn: ({ id, ...patch }) => api.updateFeedback(id, patch),\n * onSuccess: invalidate, onError: (e) => toast.error(detailOf(e) ?? toastLabels.updateFailed) });\n * const changeStatus = useFeedbackStatusUndo(update.mutate);\n * <DataTable\n * isExpanded={(row) => expandedId === row.id}\n * expandedRow={(row) => (\n * <FeedbackRowDetail row={row} canEdit={isAdmin && !mine} viewerId={user?.id}\n * onUpdate={update.mutate} pending={update.isPending} statusChange={changeStatus}\n * onUpload={api.uploadFeedbackAttachment} fetcher={authedImageFetcher}\n * onCaptureScreenshot={captureAppScreenshot} />\n * )} … />\n * ```\n *\n * Mounted only while its row is expanded, so which editor is open lives here, and\n * collapsing the row closes it. Each editor is keyed by the row's id, so a draft is\n * never thrown away by a list refresh under it.\n */\nexport function FeedbackRowDetail({\n row,\n canEdit,\n viewerId,\n onUpdate,\n pending = false,\n onUpload,\n fetcher,\n statusChange,\n onCaptureScreenshot,\n reworkAttachment,\n renderDate,\n commit,\n showSubject = true,\n onReply,\n replyAttachments = false,\n replying = false,\n onRework,\n comments,\n onPublicChange,\n labels: labelsProp,\n className,\n}: FeedbackRowDetailProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n // \"placeholder = the dialog's body label\" (§4.4.1): read from the dialog's own\n // namespace, so the two can never say different things.\n const dialogText = useKitLabels(\"feedbackDialog\", DEFAULT_FEEDBACK_DIALOG_LABELS);\n const locale = useKitLocale();\n const ownStatusChange = useFeedbackStatusUndo(onUpdate);\n const changeStatus = statusChange ?? ownStatusChange;\n const [editingBody, setEditingBody] = useState(false);\n const [reworking, setReworking] = useState(false);\n\n const access = feedbackRowAccess(row, { canEdit, viewerId });\n // The body as written, without its file lines (they are shown as files below) — the\n // rework rounds stay in the prose: they are what was said after the answer.\n const bodyText = splitBodyAttachments(row.body).text;\n const { description } = splitDescription(row.body);\n const pageHref = feedbackPageHref(row.context);\n const pageUrl = feedbackPageUrl(row.context);\n // 0.47 (§12): with the entries, each entry's file is drawn inline in the Replies\n // timeline, so the Attachment section holds the report's own files.\n const files = feedbackAttachmentUrls(row.replies ? { ...row, replies: undefined } : row);\n const fetchFile = fetcher ?? plainFeedbackFetch;\n const dateText = (iso: string) => (renderDate ? renderDate(iso) : formatDate(iso, \"medium\", { locale }));\n\n const saveDescription = (value: string) => {\n // Only a real change makes a round trip; clearing it is one (\"\" — the description\n // is optional, §7.4), and the rounds and file lines go back unchanged.\n if (value.trim() === description.trim()) {\n setEditingBody(false);\n return;\n }\n onUpdate({ id: row.id, body: replaceDescription(row.body, value) }, { onSuccess: () => setEditingBody(false) });\n };\n\n // 0.38 (§9.7): the replies replace the outcome; a row without them is a server before\n // 0.38, whose frozen outcome is shown as it is, read-only.\n const replies = row.replies;\n const commentLabels = useKitLabels(\"feedbackComments\", DEFAULT_FEEDBACK_COMMENTS_LABELS);\n // 0.40 (§10.2 decision 6): whoever has the reply composer answers with it — REWORK is\n // one of its statuses — so the Rework button is for an author without it.\n const composerShown = Boolean(replies && access.canEditOutcome && onReply);\n const canRework = access.canRework && !composerShown;\n const showRework = canRework && reworking;\n\n return (\n <FeedbackDetail className={className}>\n {showSubject && (\n <FeedbackDetailSection title={labels.subject}>\n <p className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm\" data-feedback-subject=\"\">\n <FeedbackCategoryBadge category={row.category} />\n <span className=\"min-w-0 font-medium text-primary [overflow-wrap:anywhere]\">\n {row.title}\n </span>\n </p>\n </FeedbackDetailSection>\n )}\n <FeedbackDetailSection\n title={labels.body}\n action={\n access.canEditDescription && !editingBody ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={(event) => {\n event.stopPropagation();\n setEditingBody(true);\n }}\n aria-label={labels.editDescription}\n >\n {labels.edit}\n </Button>\n ) : undefined\n }\n >\n {access.canEditDescription && editingBody ? (\n <FeedbackNoteEditor\n key={row.id}\n // The ORIGINAL description only — see the module note.\n initial={description}\n pending={pending}\n commit={commit}\n onSave={saveDescription}\n onCancel={() => setEditingBody(false)}\n saveLabel={labels.save}\n cancelLabel={labels.cancel}\n placeholder={dialogText.bodyOptional ?? dialogText.body}\n />\n ) : (\n <FeedbackProse>{bodyText.trim() ? bodyText : undefined}</FeedbackProse>\n )}\n </FeedbackDetailSection>\n\n {pageHref && pageUrl && (\n // The page it was filed on, with the full URL a click away (keksdose #278).\n <FeedbackDetailSection title={labels.url}>\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <TextLink href={pageHref} tone=\"secondary\" underline=\"hover\" stopPropagation className=\"min-w-0\">\n <code className=\"break-all text-xs\">{pageHref}</code>\n </TextLink>\n <CopyButton size=\"xs\" className=\"shrink-0\" text={pageUrl} label={labels.copyUrl} stopPropagation />\n </div>\n </FeedbackDetailSection>\n )}\n\n {files.length > 0 && (\n <FeedbackDetailSection title={labels.attachment}>\n <div className=\"flex min-w-0 flex-wrap items-start gap-2\">\n {files.map((url) =>\n isImageAttachment(url) ? (\n <AuthedImage\n key={url}\n src={url}\n alt={labels.attachment}\n fetcher={fetchFile}\n link\n stopPropagation\n // A broken attachment is simply not in the row (keksdose's\n // AuthedImage default) rather than a grey tile per failure.\n errorFallback={null}\n wrapperClassName=\"inline-block max-w-full\"\n className=\"max-h-64 max-w-full rounded border border-subtle\"\n />\n ) : (\n <FeedbackAttachmentDownload key={url} url={url} fetcher={fetchFile} />\n ),\n )}\n </div>\n </FeedbackDetailSection>\n )}\n\n <FeedbackDetailSection\n title={replies ? labels.replies : labels.outcome}\n // When the row entered DONE / WONT_DO (keksdose feedback #96).\n action={\n row.resolved_at ? (\n <span className=\"text-xs text-muted\">{labels.resolvedAt(dateText(row.resolved_at))}</span>\n ) : undefined\n }\n >\n <div className=\"space-y-3\">\n {replies ? (\n <FeedbackReplyTimeline replies={replies} fetcher={fetchFile} />\n ) : (\n <FeedbackProse>{row.outcome || undefined}</FeedbackProse>\n )}\n {composerShown && replies && onReply && (\n <FeedbackReplyComposer\n key={row.id}\n status={row.status}\n onReply={onReply}\n pending={replying}\n onUpload={replyAttachments ? onUpload : undefined}\n onCaptureScreenshot={replyAttachments ? onCaptureScreenshot : undefined}\n attachment={replyAttachments ? reworkAttachment : undefined}\n suggestedStatus={feedbackReplyNudge(row)}\n commit={commit}\n />\n )}\n {/* No \"Open page\" button here since 0.46 (keksdose live #449): the URL section\n above already links the page, with the path on screen. */}\n {canRework && !reworking && (\n <div className=\"flex flex-wrap gap-2\">\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={(event) => {\n event.stopPropagation();\n setReworking(true);\n }}\n >\n <RotateCcw className=\"size-3.5\" aria-hidden /> {labels.rework}\n </Button>\n </div>\n )}\n </div>\n </FeedbackDetailSection>\n\n {comments != null && (\n <FeedbackDetailSection title={commentLabels.comments}>\n <FeedbackRepliesDrawnAboveContext.Provider value>{comments}</FeedbackRepliesDrawnAboveContext.Provider>\n </FeedbackDetailSection>\n )}\n\n {showRework && (\n <FeedbackReworkSection\n row={row}\n onRework={onRework}\n onUpdate={onUpdate}\n pending={pending}\n onUpload={onUpload}\n onCaptureScreenshot={onCaptureScreenshot}\n onSent={() => setReworking(false)}\n onCancel={() => setReworking(false)}\n attachment={reworkAttachment}\n commit={commit}\n labels={labelsProp}\n />\n )}\n\n <FeedbackDetailSection title={labels.status}>\n {/* Expanded: the whole enum in one click for the admin (keksdose feedback #421);\n everyone else the narrow set, read-only — a picture of the workflow. */}\n <FeedbackStatusTransitions\n status={row.status}\n statuses={\n access.canChangeStatus ? selectableFeedbackStatuses(row.status) : visibleFeedbackStatuses(row.status)\n }\n canEdit={access.canChangeStatus}\n commit={commit}\n onPick={(status) => changeStatus(row, status)}\n variant=\"pill\"\n />\n {onPublicChange && (\n <FeedbackPublicSwitch\n row={row}\n isAdmin={canEdit}\n viewerId={viewerId}\n onChange={onPublicChange}\n pending={pending}\n commit={commit}\n className=\"mt-3\"\n />\n )}\n </FeedbackDetailSection>\n </FeedbackDetail>\n );\n}\n"],"mappings":";AA0dM,cA6NI,YA7NJ;AA1dN,SAAS,WAAW,QAAQ,gBAAgB;AAE5C,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB,SAAS,cAAc,oBAAwC;AAC/D,SAAS,kBAAkB;AAC3B,SAAS,oCAAoC;AAC7C,SAAS,sCAAsC;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,6BAA6B;AAGtC,SAAS,sCAAsC;AAC/C,SAAS,uBAAuB,uBAAuB,0BAA0B;AACjF,SAAS,4BAA4B,0BAA0B;AAC/D,SAAS,4B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AAAA,UACzD,GACF;AAAA,WAEJ;AAAA;AAAA,IACF;AAAA,IAEC,YAAY,QACX,oBAAC,yBAAsB,OAAO,cAAc,UAC1C,8BAAC,iCAAiC,UAAjC,EAA0C,OAAK,MAAE,oBAAS,GAC7D;AAAA,IAGD,cACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QAAQ,MAAM,aAAa,KAAK;AAAA,QAChC,UAAU,MAAM,aAAa,KAAK;AAAA,QAClC,YAAY;AAAA,QACZ;AAAA,QACA,QAAQ;AAAA;AAAA,IACV;AAAA,IAGF,qBAAC,yBAAsB,OAAO,OAAO,QAGnC;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,QAAQ,IAAI;AAAA,UACZ,UACE,OAAO,kBAAkB,2BAA2B,IAAI,MAAM,IAAI,wBAAwB,IAAI,MAAM;AAAA,UAEtG,SAAS,OAAO;AAAA,UAChB;AAAA,UACA,QAAQ,CAAC,WAAW,aAAa,KAAK,MAAM;AAAA,UAC5C,SAAQ;AAAA;AAAA,MACV;AAAA,MACC,kBACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA,WAAU;AAAA;AAAA,MACZ;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
@@ -19,3 +19,4 @@ export * from "./feedback/feedback-public-types.js";
19
19
  export * from "./feedback/feedback-vote-button.js";
20
20
  export * from "./feedback/feedback-comment-thread.js";
21
21
  export * from "./feedback/feedback-replies.js";
22
+ export * from "./feedback/feedback-entry-file.js";
package/dist/feedback.js CHANGED
@@ -20,4 +20,5 @@ export * from "./feedback/feedback-public-types.js";
20
20
  export * from "./feedback/feedback-vote-button.js";
21
21
  export * from "./feedback/feedback-comment-thread.js";
22
22
  export * from "./feedback/feedback-replies.js";
23
+ export * from "./feedback/feedback-entry-file.js";
23
24
  //# sourceMappingURL=feedback.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/feedback.ts"],"sourcesContent":["// `@eifi1/ui-kit/feedback` — the report form and the parts an inbox is built from.\n//\n// A re-slicing of the main barrel, not a new API. The kit owns the status vocabulary,\n// the transition policy and the look; each app still wires its own API, columns,\n// strings and permissions — see the note at the top of feedback/feedback-inbox.tsx.\nexport * from \"./feedback/feedback-attachment\";\nexport * from \"./feedback/feedback-dialog\";\nexport * from \"./feedback/feedback-inbox\";\nexport * from \"./feedback/feedback-thread\";\n// 0.27.0: the feedback harmonization (docs/feedback-harmonization.md) — one record,\n// one menu, dialog, table, detail and crash reporter for keksdose, kastlan, Kurvenschmiede.\nexport * from \"./feedback/feedback-record\";\nexport * from \"./feedback/feedback-labels\";\nexport * from \"./feedback/feedback-status-undo\";\nexport * from \"./feedback/feedback-swipe\";\nexport * from \"./feedback/feedback-menu\";\nexport * from \"./feedback/feedback-context\";\nexport * from \"./feedback/feedback-capture\";\nexport * from \"./feedback/feedback-submit\";\nexport * from \"./feedback/feedback-table\";\nexport * from \"./feedback/feedback-row-detail\";\nexport * from \"./feedback/feedback-crash\";\n// 0.38.0: the public pages (§9.15) — the \"Visible to others\" switch, the list every user\n// reads and one report opened.\nexport * from \"./feedback/feedback-public-switch\";\nexport * from \"./feedback/feedback-public-list\";\n// 0.38.0: public feedback (docs/feedback-harmonization.md §9) — the shapes, the vote, the\n// comment thread, the replies' timeline and composer.\nexport * from \"./feedback/feedback-public-types\";\nexport * from \"./feedback/feedback-vote-button\";\nexport * from \"./feedback/feedback-comment-thread\";\nexport * from \"./feedback/feedback-replies\";\n"],"mappings":";AAKA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/feedback.ts"],"sourcesContent":["// `@eifi1/ui-kit/feedback` — the report form and the parts an inbox is built from.\n//\n// A re-slicing of the main barrel, not a new API. The kit owns the status vocabulary,\n// the transition policy and the look; each app still wires its own API, columns,\n// strings and permissions — see the note at the top of feedback/feedback-inbox.tsx.\nexport * from \"./feedback/feedback-attachment\";\nexport * from \"./feedback/feedback-dialog\";\nexport * from \"./feedback/feedback-inbox\";\nexport * from \"./feedback/feedback-thread\";\n// 0.27.0: the feedback harmonization (docs/feedback-harmonization.md) — one record,\n// one menu, dialog, table, detail and crash reporter for keksdose, kastlan, Kurvenschmiede.\nexport * from \"./feedback/feedback-record\";\nexport * from \"./feedback/feedback-labels\";\nexport * from \"./feedback/feedback-status-undo\";\nexport * from \"./feedback/feedback-swipe\";\nexport * from \"./feedback/feedback-menu\";\nexport * from \"./feedback/feedback-context\";\nexport * from \"./feedback/feedback-capture\";\nexport * from \"./feedback/feedback-submit\";\nexport * from \"./feedback/feedback-table\";\nexport * from \"./feedback/feedback-row-detail\";\nexport * from \"./feedback/feedback-crash\";\n// 0.38.0: the public pages (§9.15) — the \"Visible to others\" switch, the list every user\n// reads and one report opened.\nexport * from \"./feedback/feedback-public-switch\";\nexport * from \"./feedback/feedback-public-list\";\n// 0.38.0: public feedback (docs/feedback-harmonization.md §9) — the shapes, the vote, the\n// comment thread, the replies' timeline and composer.\nexport * from \"./feedback/feedback-public-types\";\nexport * from \"./feedback/feedback-vote-button\";\nexport * from \"./feedback/feedback-comment-thread\";\nexport * from \"./feedback/feedback-replies\";\nexport * from \"./feedback/feedback-entry-file\";\n"],"mappings":";AAKA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -170,7 +170,6 @@ function germanLabels(numberLocale) {
170
170
  outcomeUpdate: "Aktualisieren",
171
171
  outcomePlaceholder: "Was wurde umgesetzt, entschieden oder warum nicht.",
172
172
  rework: "Nacharbeit",
173
- openPage: "Seite \xF6ffnen",
174
173
  reworkTitle: "Zur Nacharbeit senden",
175
174
  reworkSend: "Nacharbeit senden",
176
175
  reworkPlaceholder: "Was muss noch angepasst werden? Neue Anforderungen oder Richtungswechsel.",
@@ -504,7 +503,7 @@ function germanLabels(numberLocale) {
504
503
  add: "Tab hinzuf\xFCgen",
505
504
  remove: (tab) => `${tab} entfernen`,
506
505
  more: "Weitere Tabs",
507
- backToFirst: "Zur\xFCck zum ersten Tab"
506
+ previous: "Vorherige Tabs"
508
507
  },
509
508
  appShell: {
510
509
  collapse: "Seitenleiste einklappen",
@@ -1128,7 +1127,6 @@ Die vollst\xE4ndige Postanschrift wird betroffenen Personen und Aufsichtsbeh\xF6
1128
1127
  notifications: {
1129
1128
  typesTitle: "Benachrichtigungen zu",
1130
1129
  typesDescription: "W\xE4hlen Sie, wor\xFCber Sie benachrichtigt werden, und wie.",
1131
- byEmail: "Per E-Mail",
1132
1130
  channelApp: "In der App",
1133
1131
  channelPush: "Push",
1134
1132
  channelEmail: "E-Mail",
@@ -1144,9 +1142,6 @@ Die vollst\xE4ndige Postanschrift wird betroffenen Personen und Aufsichtsbeh\xF6
1144
1142
  quietFrom: "Von",
1145
1143
  quietUntil: "Bis",
1146
1144
  quietIncomplete: "Legen Sie eine Start- und eine Endzeit fest. Ruhezeiten gelten erst, wenn beide gesetzt sind.",
1147
- timeZone: "Zeitzone",
1148
- deviceZone: (zone) => `Dieses Ger\xE4t ist in der Zeitzone ${zone}.`,
1149
- useDeviceZone: "\xDCbernehmen",
1150
1145
  regions: {
1151
1146
  Africa: "Afrika",
1152
1147
  America: "Amerika",