@eifi1/ui-kit 0.37.0 → 0.38.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 (122) hide show
  1. package/README.md +11 -4
  2. package/dist/eslint/index.js +1 -1
  3. package/dist/feedback/feedback-comment-thread.d.ts +80 -0
  4. package/dist/feedback/feedback-comment-thread.js +162 -0
  5. package/dist/feedback/feedback-comment-thread.js.map +1 -0
  6. package/dist/feedback/feedback-dialog-labels.js +2 -1
  7. package/dist/feedback/feedback-dialog-labels.js.map +1 -1
  8. package/dist/feedback/feedback-dialog.d.ts +13 -0
  9. package/dist/feedback/feedback-dialog.js +12 -4
  10. package/dist/feedback/feedback-dialog.js.map +1 -1
  11. package/dist/feedback/feedback-menu-labels.js +2 -1
  12. package/dist/feedback/feedback-menu-labels.js.map +1 -1
  13. package/dist/feedback/feedback-menu.d.ts +17 -3
  14. package/dist/feedback/feedback-menu.js +11 -1
  15. package/dist/feedback/feedback-menu.js.map +1 -1
  16. package/dist/feedback/feedback-public-labels.d.ts +50 -0
  17. package/dist/feedback/feedback-public-labels.js +26 -0
  18. package/dist/feedback/feedback-public-labels.js.map +1 -0
  19. package/dist/feedback/feedback-public-list.d.ts +118 -0
  20. package/dist/feedback/feedback-public-list.js +248 -0
  21. package/dist/feedback/feedback-public-list.js.map +1 -0
  22. package/dist/feedback/feedback-public-switch.d.ts +51 -0
  23. package/dist/feedback/feedback-public-switch.js +50 -0
  24. package/dist/feedback/feedback-public-switch.js.map +1 -0
  25. package/dist/feedback/feedback-public-types.d.ts +75 -0
  26. package/dist/feedback/feedback-public-types.js +2 -0
  27. package/dist/feedback/feedback-public-types.js.map +1 -0
  28. package/dist/feedback/feedback-record.d.ts +32 -1
  29. package/dist/feedback/feedback-record.js +10 -0
  30. package/dist/feedback/feedback-record.js.map +1 -1
  31. package/dist/feedback/feedback-replies.d.ts +97 -0
  32. package/dist/feedback/feedback-replies.js +114 -0
  33. package/dist/feedback/feedback-replies.js.map +1 -0
  34. package/dist/feedback/feedback-row-detail-labels.js +1 -0
  35. package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
  36. package/dist/feedback/feedback-row-detail.d.ts +38 -10
  37. package/dist/feedback/feedback-row-detail.js +50 -50
  38. package/dist/feedback/feedback-row-detail.js.map +1 -1
  39. package/dist/feedback/feedback-submit-dialog.d.ts +3 -1
  40. package/dist/feedback/feedback-submit-dialog.js +6 -1
  41. package/dist/feedback/feedback-submit-dialog.js.map +1 -1
  42. package/dist/feedback/feedback-submit.d.ts +8 -0
  43. package/dist/feedback/feedback-submit.js +3 -2
  44. package/dist/feedback/feedback-submit.js.map +1 -1
  45. package/dist/feedback/feedback-table.d.ts +15 -5
  46. package/dist/feedback/feedback-table.js +46 -5
  47. package/dist/feedback/feedback-table.js.map +1 -1
  48. package/dist/feedback/feedback-thread-parts-labels.d.ts +6 -0
  49. package/dist/feedback/feedback-thread-parts-labels.js +36 -0
  50. package/dist/feedback/feedback-thread-parts-labels.js.map +1 -0
  51. package/dist/feedback/feedback-thread.d.ts +8 -0
  52. package/dist/feedback/feedback-thread.js +7 -2
  53. package/dist/feedback/feedback-thread.js.map +1 -1
  54. package/dist/feedback/feedback-vote-button.d.ts +48 -0
  55. package/dist/feedback/feedback-vote-button.js +72 -0
  56. package/dist/feedback/feedback-vote-button.js.map +1 -0
  57. package/dist/feedback.d.ts +6 -0
  58. package/dist/feedback.js +6 -0
  59. package/dist/feedback.js.map +1 -1
  60. package/dist/i18n/defaults.js +12 -0
  61. package/dist/i18n/defaults.js.map +1 -1
  62. package/dist/i18n/german.js +64 -2
  63. package/dist/i18n/german.js.map +1 -1
  64. package/dist/i18n/kit-labels.d.ts +16 -0
  65. package/dist/i18n/kit-labels.js.map +1 -1
  66. package/dist/i18n/locales/en.js +79 -2
  67. package/dist/i18n/locales/en.js.map +3 -3
  68. package/dist/i18n/locales/es.js +64 -2
  69. package/dist/i18n/locales/es.js.map +1 -1
  70. package/dist/i18n/locales/fr.js +64 -2
  71. package/dist/i18n/locales/fr.js.map +1 -1
  72. package/dist/i18n/locales/hu.js +64 -2
  73. package/dist/i18n/locales/hu.js.map +1 -1
  74. package/dist/i18n/locales/it.js +64 -2
  75. package/dist/i18n/locales/it.js.map +1 -1
  76. package/dist/i18n/locales/zh.js +64 -2
  77. package/dist/i18n/locales/zh.js.map +1 -1
  78. package/dist/i18n/review.js +4 -0
  79. package/dist/i18n/review.js.map +1 -1
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.js +6 -0
  82. package/dist/index.js.map +1 -1
  83. package/dist/notifications/feedback-notification-types-labels.d.ts +15 -0
  84. package/dist/notifications/feedback-notification-types-labels.js +11 -0
  85. package/dist/notifications/feedback-notification-types-labels.js.map +1 -0
  86. package/dist/notifications/feedback-notification-types.d.ts +28 -0
  87. package/dist/notifications/feedback-notification-types.js +21 -0
  88. package/dist/notifications/feedback-notification-types.js.map +1 -0
  89. package/package.json +1 -1
  90. package/src/feedback/feedback-comment-thread.tsx +255 -0
  91. package/src/feedback/feedback-dialog-labels.ts +1 -0
  92. package/src/feedback/feedback-dialog.tsx +30 -2
  93. package/src/feedback/feedback-menu-labels.ts +1 -0
  94. package/src/feedback/feedback-menu.tsx +29 -3
  95. package/src/feedback/feedback-public-labels.ts +76 -0
  96. package/src/feedback/feedback-public-list.tsx +395 -0
  97. package/src/feedback/feedback-public-switch.tsx +102 -0
  98. package/src/feedback/feedback-public-types.ts +82 -0
  99. package/src/feedback/feedback-record.ts +39 -1
  100. package/src/feedback/feedback-replies.tsx +235 -0
  101. package/src/feedback/feedback-row-detail-labels.ts +1 -0
  102. package/src/feedback/feedback-row-detail.tsx +103 -74
  103. package/src/feedback/feedback-submit-dialog.tsx +9 -0
  104. package/src/feedback/feedback-submit.tsx +10 -1
  105. package/src/feedback/feedback-table.tsx +73 -6
  106. package/src/feedback/feedback-thread-parts-labels.ts +41 -0
  107. package/src/feedback/feedback-thread.tsx +18 -1
  108. package/src/feedback/feedback-vote-button.tsx +122 -0
  109. package/src/feedback.ts +10 -0
  110. package/src/i18n/defaults.ts +12 -0
  111. package/src/i18n/german.ts +62 -0
  112. package/src/i18n/kit-labels.tsx +16 -0
  113. package/src/i18n/locales/en.ts +7 -0
  114. package/src/i18n/locales/es.ts +62 -0
  115. package/src/i18n/locales/fr.ts +62 -0
  116. package/src/i18n/locales/hu.ts +62 -0
  117. package/src/i18n/locales/it.ts +62 -0
  118. package/src/i18n/locales/zh.ts +62 -0
  119. package/src/i18n/review.ts +4 -0
  120. package/src/index.ts +9 -0
  121. package/src/notifications/feedback-notification-types-labels.ts +24 -0
  122. package/src/notifications/feedback-notification-types.ts +46 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/feedback/feedback-submit.tsx"],"sourcesContent":["import { lazy, Suspense, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { toast } from \"../components/toast\";\n// Types only, gone from the built module: the dialog's modules load with the dialog.\nimport type { FeedbackSubmitter } from \"./feedback-context\";\nimport type { FeedbackMultipleSubmission } from \"./feedback-dialog\";\nimport { useFeedbackToastLabels } from \"./feedback-labels\";\nimport { FEEDBACK_PICKABLE_CATEGORIES, type FeedbackContext, type FeedbackEnvironment } from \"./feedback-record\";\nimport type { FeedbackCategory } from \"./feedback-vocabulary\";\n\n/**\n * The dialog, loaded when it is first opened rather than with the top bar that mounts the\n * hook (0.34, MOD-1 of the refactor audit 2026-10; see feedback-submit-dialog.tsx). A\n * LITERAL relative `import()`, as the catalogue loaders are (i18n/languages.ts): the\n * library build keeps the module its own (`bundle: false`), and a path an app's bundler\n * can read is a chunk it can split off.\n */\nconst LazySubmitDialog = lazy(() =>\n import(\"./feedback-submit-dialog\").then((module) => ({ default: module.FeedbackSubmitDialog })),\n);\n\n/**\n * `FeedbackCreate` — the body of `POST /feedback` (keksdose `schemas/feedback.py:25`, §3.4\n * of docs/feedback-harmonization.md), as {@link useFeedbackSubmit} hands it to the app's\n * `create`.\n */\nexport interface FeedbackCreatePayload {\n /** Trimmed; never blank (the dialog will not send a subject of spaces). */\n title: string;\n /** `\"\"` when the reporter wrote nothing or only whitespace — the server stores `\"\"`. */\n body: string;\n /** Never `CRASH` — the server answers that with a 422 (§3.4). */\n category: FeedbackCategory;\n /** §3.2, built by `feedbackContext` from what the context box showed. */\n context: FeedbackContext;\n /** The captured screenshot's upload URL, or `null`. */\n screenshot_url: string | null;\n /** The picked and pasted files' upload URLs, in the order they were added — `[]` when\n * none, as keksdose sends it. At most 5. */\n attachment_urls: string[];\n}\n\nexport interface UseFeedbackSubmitOptions<R = unknown> {\n /**\n * `POST /feedback/attachments` for ONE file → its URL (§3.3) — the app's authed client.\n * Every file goes up BEFORE the report is created, so a row never names a file that did\n * not arrive (keksdose `use-feedback-dialog.tsx:89`); if any upload rejects, nothing is\n * created and the failure toast says so.\n */\n upload: (file: File) => Promise<string>;\n /** `POST /feedback` with the payload. Whatever it resolves with reaches `onSubmitted`. */\n create: (payload: FeedbackCreatePayload) => Promise<R>;\n /** Who is filing — shown in the context box and sent in `context.user_*`. */\n user?: FeedbackSubmitter | null;\n /** `context.environment` — the app's own reading of which copy it is (keksdose\n * `deployEnvironment()`). */\n environment?: FeedbackEnvironment | (string & {});\n /** `context.version` — the app build (`__APP_VERSION__`). */\n version?: string;\n /** The report was filed: after the \"Thanks for the feedback!\" toast and the close. The\n * place to invalidate the app's feedback queries. */\n onSubmitted?: (result: R) => void;\n /**\n * The failure toast's text from what `upload` or `create` rejected with — the app's own\n * `extractApiErrorMessage(err, fallback)` (keksdose) / `apiErrorMessage` (Kurvenschmiede),\n * so the server's `detail` wins (§3.7: a 413, a 415, keksdose's demo-session 403). Without\n * it every failure says `feedbackToast.submitFailed`.\n */\n errorMessage?: (error: unknown, fallback: string) => string;\n /**\n * The \"Capture screenshot\" button's capture. Default {@link captureAppScreenshot} of\n * `#root`; another root is `() => captureAppScreenshot({ rootId: \"app\" })`. `false`\n * hides the button — for an app that does not install the optional peer\n * `modern-screenshot`. A rejection becomes the `captureFailed` toast.\n */\n capture?: false | (() => Promise<File | null>);\n}\n\nexport interface FeedbackSubmit {\n /**\n * Open the dialog on `category` — a `FeedbackMenu` row's (§4.2: \"default category when\n * opened from a row: that row's\"). Without one, or with `CRASH` (never pickable), it\n * opens on `OTHER`, the server's own default (§3.4). Each open starts a fresh form,\n * reads `location.href` for the context box and ticks \"Attach current page URL\" again.\n */\n open: (category?: FeedbackCategory) => void;\n /** Close it, as Cancel does. */\n close: () => void;\n /**\n * The dialog — render it once, anywhere (it portals). `null` while closed. Since 0.34\n * its module loads when it is first opened (MOD-1), so it appears a moment after\n * `open`: a test finds it with `await screen.findBy…`, not `getBy…`.\n */\n dialog: ReactNode;\n}\n\n/**\n * The feedback submit dialog, wired (0.27.0, docs/feedback-harmonization.md §4.2): the\n * one call that replaces keksdose's `use-feedback-dialog.tsx`, kastlan's `FeedbackButton`\n * and Kurvenschmiede's `use-feedback-dialog.tsx`.\n *\n * ```tsx\n * const feedback = useFeedbackSubmit({\n * upload: (file) => feedbackApi.uploadAttachment(file),\n * create: (payload) => feedbackApi.create(payload),\n * user, environment: deployEnvironment(), version: __APP_VERSION__,\n * errorMessage: extractApiErrorMessage,\n * onSubmitted: () => qc.invalidateQueries({ queryKey: queryKeys.feedback.all }),\n * });\n * <FeedbackMenu onFile={feedback.open} isAdmin={user?.role === \"ADMIN\"} />\n * {feedback.dialog}\n * ```\n *\n * What it settles, so no app restates it:\n *\n * - `FeedbackDialog` in `attachments=\"multiple\"` with `requireBody={false}` (§7.4): a\n * subject alone is a report. One captured screenshot in its own slot plus up to 5\n * picked or pasted files, `FEEDBACK_ATTACHMENT_ACCEPT` (images, PDF, text), 10 MB each.\n * - The pickable categories — Bug, Idea, Question, Other, in the kit's words. `CRASH` is\n * filed by the error boundary and is never offered (keksdose feedback #160).\n * - The context box, built from the same values as the `context` it sends\n * ({@link FeedbackContextBox} / `feedbackContext`), the URL read when the dialog OPENS.\n * - Upload every file, then create (keksdose `use-feedback-dialog.tsx:89`): the\n * screenshot to `screenshot_url`, the rest to `attachment_urls`, all in parallel.\n * - The toasts, from `feedbackToast`: filed, failed (the server's `detail` through\n * `errorMessage`), a refused file's type, size or count, a failed capture.\n *\n * What stays the app's: the API client, the user, the environment and version, and what\n * to refresh afterwards. No TanStack in here — `create` is a plain promise, so the hook\n * runs in any app; the app's mutation, if it wants one, lives inside `create`.\n *\n * A failure keeps the dialog open with the draft, as keksdose's did. A dialog closed and\n * opened again while a send is still running is NOT closed by that send's success — the\n * new draft is somebody's next report.\n */\nexport function useFeedbackSubmit<R = unknown>(options: UseFeedbackSubmitOptions<R>): FeedbackSubmit {\n const { upload, create, user, environment, version, onSubmitted, errorMessage, capture } = options;\n const toastText = useFeedbackToastLabels();\n const [isOpen, setIsOpen] = useState(false);\n const [category, setCategory] = useState<FeedbackCategory>(\"OTHER\");\n const [url, setUrl] = useState(\"\");\n const [attachUrl, setAttachUrl] = useState(true);\n const [submitting, setSubmitting] = useState(false);\n // Which opening a send belongs to — see \"closed and opened again\" above.\n const opening = useRef(0);\n const inFlight = useRef(false);\n\n const open = (next?: FeedbackCategory) => {\n opening.current += 1;\n setCategory(next && FEEDBACK_PICKABLE_CATEGORIES.includes(next) ? next : \"OTHER\");\n setUrl(typeof window === \"undefined\" ? \"\" : window.location.href);\n // Fresh every time (Kurvenschmiede use-feedback-dialog.tsx:80): a reporter who left the\n // page out of one idea is not saying the bug report after it is unrelated too.\n setAttachUrl(true);\n setIsOpen(true);\n };\n const close = () => setIsOpen(false);\n\n // `context` comes from the dialog, built off the values its context box shows.\n const submit = async (data: FeedbackMultipleSubmission, context: FeedbackContext) => {\n if (inFlight.current) return;\n inFlight.current = true;\n setSubmitting(true);\n const from = opening.current;\n let result: R;\n try {\n const [screenshot_url, attachment_urls] = await Promise.all([\n data.screenshot ? upload(data.screenshot) : Promise.resolve(null),\n Promise.all(data.attachments.map((file) => upload(file))),\n ]);\n result = await create({\n title: data.title.trim(),\n body: data.body.trim() ? data.body : \"\",\n category: data.category as FeedbackCategory,\n context,\n screenshot_url,\n attachment_urls,\n });\n } catch (error) {\n toast.error(errorMessage ? errorMessage(error, toastText.submitFailed) : toastText.submitFailed);\n return;\n } finally {\n inFlight.current = false;\n setSubmitting(false);\n }\n toast.success(toastText.submitted);\n if (opening.current === from) setIsOpen(false);\n onSubmitted?.(result);\n };\n\n // Nothing is drawn while the dialog's module is on its way — a few milliseconds, once per\n // page load; a spinner would only flash. A load that fails (a deploy replaced the chunk)\n // throws a chunk-load error to the app's error boundary, as a lazy route's does.\n const dialog = isOpen ? (\n <Suspense fallback={null}>\n <LazySubmitDialog\n onClose={close}\n category={category}\n onCategoryChange={setCategory}\n submitting={submitting}\n onSubmit={submit}\n user={user}\n url={url}\n attachUrl={attachUrl}\n onAttachUrlChange={setAttachUrl}\n environment={environment}\n version={version}\n capture={capture}\n />\n </Suspense>\n ) : null;\n\n return { open, close, dialog };\n}\n"],"mappings":";AAmMM;AAnMN,SAAS,MAAM,UAAU,QAAQ,gBAAgB;AAEjD,SAAS,aAAa;AAItB,SAAS,8BAA8B;AACvC,SAAS,oCAAoF;AAU7F,MAAM,mBAAmB;AAAA,EAAK,MAC5B,OAAO,0BAA0B,EAAE,KAAK,CAAC,YAAY,EAAE,SAAS,OAAO,qBAAqB,EAAE;AAChG;AAoHO,SAAS,kBAA+B,SAAsD;AACnG,QAAM,EAAE,QAAQ,QAAQ,MAAM,aAAa,SAAS,aAAa,cAAc,QAAQ,IAAI;AAC3F,QAAM,YAAY,uBAAuB;AACzC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,CAAC,UAAU,WAAW,IAAI,SAA2B,OAAO;AAClE,QAAM,CAAC,KAAK,MAAM,IAAI,SAAS,EAAE;AACjC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,IAAI;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAElD,QAAM,UAAU,OAAO,CAAC;AACxB,QAAM,WAAW,OAAO,KAAK;AAE7B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MACA;AAAA,MACA;AAAA,MACA,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF,GACF,IACE;AAEJ,SAAO,EAAE,MAAM,OAAO,OAAO;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/feedback/feedback-submit.tsx"],"sourcesContent":["import { lazy, Suspense, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { toast } from \"../components/toast\";\n// Types only, gone from the built module: the dialog's modules load with the dialog.\nimport type { FeedbackSubmitter } from \"./feedback-context\";\nimport type { FeedbackMultipleSubmission } from \"./feedback-dialog\";\nimport { useFeedbackToastLabels } from \"./feedback-labels\";\nimport { FEEDBACK_PICKABLE_CATEGORIES, type FeedbackContext, type FeedbackEnvironment } from \"./feedback-record\";\nimport type { FeedbackCategory } from \"./feedback-vocabulary\";\n\n/**\n * The dialog, loaded when it is first opened rather than with the top bar that mounts the\n * hook (0.34, MOD-1 of the refactor audit 2026-10; see feedback-submit-dialog.tsx). A\n * LITERAL relative `import()`, as the catalogue loaders are (i18n/languages.ts): the\n * library build keeps the module its own (`bundle: false`), and a path an app's bundler\n * can read is a chunk it can split off.\n */\nconst LazySubmitDialog = lazy(() =>\n import(\"./feedback-submit-dialog\").then((module) => ({ default: module.FeedbackSubmitDialog })),\n);\n\n/**\n * `FeedbackCreate` — the body of `POST /feedback` (keksdose `schemas/feedback.py:25`, §3.4\n * of docs/feedback-harmonization.md), as {@link useFeedbackSubmit} hands it to the app's\n * `create`.\n */\nexport interface FeedbackCreatePayload {\n /** Trimmed; never blank (the dialog will not send a subject of spaces). */\n title: string;\n /** `\"\"` when the reporter wrote nothing or only whitespace — the server stores `\"\"`. */\n body: string;\n /** Never `CRASH` — the server answers that with a 422 (§3.4). */\n category: FeedbackCategory;\n /** §3.2, built by `feedbackContext` from what the context box showed. */\n context: FeedbackContext;\n /** The captured screenshot's upload URL, or `null`. */\n screenshot_url: string | null;\n /** The picked and pasted files' upload URLs, in the order they were added — `[]` when\n * none, as keksdose sends it. At most 5. */\n attachment_urls: string[];\n}\n\nexport interface UseFeedbackSubmitOptions<R = unknown> {\n /**\n * `POST /feedback/attachments` for ONE file → its URL (§3.3) — the app's authed client.\n * Every file goes up BEFORE the report is created, so a row never names a file that did\n * not arrive (keksdose `use-feedback-dialog.tsx:89`); if any upload rejects, nothing is\n * created and the failure toast says so.\n */\n upload: (file: File) => Promise<string>;\n /** `POST /feedback` with the payload. Whatever it resolves with reaches `onSubmitted`. */\n create: (payload: FeedbackCreatePayload) => Promise<R>;\n /** Who is filing — shown in the context box and sent in `context.user_*`. */\n user?: FeedbackSubmitter | null;\n /** `context.environment` — the app's own reading of which copy it is (keksdose\n * `deployEnvironment()`). */\n environment?: FeedbackEnvironment | (string & {});\n /** `context.version` — the app build (`__APP_VERSION__`). */\n version?: string;\n /** The report was filed: after the \"Thanks for the feedback!\" toast and the close. The\n * place to invalidate the app's feedback queries. */\n onSubmitted?: (result: R) => void;\n /**\n * The failure toast's text from what `upload` or `create` rejected with — the app's own\n * `extractApiErrorMessage(err, fallback)` (keksdose) / `apiErrorMessage` (Kurvenschmiede),\n * so the server's `detail` wins (§3.7: a 413, a 415, keksdose's demo-session 403). Without\n * it every failure says `feedbackToast.submitFailed`.\n */\n errorMessage?: (error: unknown, fallback: string) => string;\n /**\n * The \"Capture screenshot\" button's capture. Default {@link captureAppScreenshot} of\n * `#root`; another root is `() => captureAppScreenshot({ rootId: \"app\" })`. `false`\n * hides the button — for an app that does not install the optional peer\n * `modern-screenshot`. A rejection becomes the `captureFailed` toast.\n */\n capture?: false | (() => Promise<File | null>);\n /**\n * The app's reports are public (0.38, docs/feedback-harmonization.md §9.2 decision 6):\n * `true` shows **\"Other users will see the title and text (never your screenshots or\n * files)\"** (`feedbackDialog.publicNotice`) under the body. keksdose and Kurvenschmiede\n * pass it — for a viewer who passes the app's `public_viewer` — and kastlan, whose\n * public parts are off, does not. Default `false`.\n */\n publicNotice?: boolean;\n}\n\nexport interface FeedbackSubmit {\n /**\n * Open the dialog on `category` — a `FeedbackMenu` row's (§4.2: \"default category when\n * opened from a row: that row's\"). Without one, or with `CRASH` (never pickable), it\n * opens on `OTHER`, the server's own default (§3.4). Each open starts a fresh form,\n * reads `location.href` for the context box and ticks \"Attach current page URL\" again.\n */\n open: (category?: FeedbackCategory) => void;\n /** Close it, as Cancel does. */\n close: () => void;\n /**\n * The dialog — render it once, anywhere (it portals). `null` while closed. Since 0.34\n * its module loads when it is first opened (MOD-1), so it appears a moment after\n * `open`: a test finds it with `await screen.findBy…`, not `getBy…`.\n */\n dialog: ReactNode;\n}\n\n/**\n * The feedback submit dialog, wired (0.27.0, docs/feedback-harmonization.md §4.2): the\n * one call that replaces keksdose's `use-feedback-dialog.tsx`, kastlan's `FeedbackButton`\n * and Kurvenschmiede's `use-feedback-dialog.tsx`.\n *\n * ```tsx\n * const feedback = useFeedbackSubmit({\n * upload: (file) => feedbackApi.uploadAttachment(file),\n * create: (payload) => feedbackApi.create(payload),\n * user, environment: deployEnvironment(), version: __APP_VERSION__,\n * errorMessage: extractApiErrorMessage,\n * onSubmitted: () => qc.invalidateQueries({ queryKey: queryKeys.feedback.all }),\n * });\n * <FeedbackMenu onFile={feedback.open} isAdmin={user?.role === \"ADMIN\"} />\n * {feedback.dialog}\n * ```\n *\n * What it settles, so no app restates it:\n *\n * - `FeedbackDialog` in `attachments=\"multiple\"` with `requireBody={false}` (§7.4): a\n * subject alone is a report. One captured screenshot in its own slot plus up to 5\n * picked or pasted files, `FEEDBACK_ATTACHMENT_ACCEPT` (images, PDF, text), 10 MB each.\n * - The pickable categories — Bug, Idea, Question, Other, in the kit's words. `CRASH` is\n * filed by the error boundary and is never offered (keksdose feedback #160).\n * - The context box, built from the same values as the `context` it sends\n * ({@link FeedbackContextBox} / `feedbackContext`), the URL read when the dialog OPENS.\n * - Upload every file, then create (keksdose `use-feedback-dialog.tsx:89`): the\n * screenshot to `screenshot_url`, the rest to `attachment_urls`, all in parallel.\n * - The toasts, from `feedbackToast`: filed, failed (the server's `detail` through\n * `errorMessage`), a refused file's type, size or count, a failed capture.\n *\n * What stays the app's: the API client, the user, the environment and version, and what\n * to refresh afterwards. No TanStack in here — `create` is a plain promise, so the hook\n * runs in any app; the app's mutation, if it wants one, lives inside `create`.\n *\n * A failure keeps the dialog open with the draft, as keksdose's did. A dialog closed and\n * opened again while a send is still running is NOT closed by that send's success — the\n * new draft is somebody's next report.\n */\nexport function useFeedbackSubmit<R = unknown>(options: UseFeedbackSubmitOptions<R>): FeedbackSubmit {\n const { upload, create, user, environment, version, onSubmitted, errorMessage, capture, publicNotice } = options;\n const toastText = useFeedbackToastLabels();\n const [isOpen, setIsOpen] = useState(false);\n const [category, setCategory] = useState<FeedbackCategory>(\"OTHER\");\n const [url, setUrl] = useState(\"\");\n const [attachUrl, setAttachUrl] = useState(true);\n const [submitting, setSubmitting] = useState(false);\n // Which opening a send belongs to — see \"closed and opened again\" above.\n const opening = useRef(0);\n const inFlight = useRef(false);\n\n const open = (next?: FeedbackCategory) => {\n opening.current += 1;\n setCategory(next && FEEDBACK_PICKABLE_CATEGORIES.includes(next) ? next : \"OTHER\");\n setUrl(typeof window === \"undefined\" ? \"\" : window.location.href);\n // Fresh every time (Kurvenschmiede use-feedback-dialog.tsx:80): a reporter who left the\n // page out of one idea is not saying the bug report after it is unrelated too.\n setAttachUrl(true);\n setIsOpen(true);\n };\n const close = () => setIsOpen(false);\n\n // `context` comes from the dialog, built off the values its context box shows.\n const submit = async (data: FeedbackMultipleSubmission, context: FeedbackContext) => {\n if (inFlight.current) return;\n inFlight.current = true;\n setSubmitting(true);\n const from = opening.current;\n let result: R;\n try {\n const [screenshot_url, attachment_urls] = await Promise.all([\n data.screenshot ? upload(data.screenshot) : Promise.resolve(null),\n Promise.all(data.attachments.map((file) => upload(file))),\n ]);\n result = await create({\n title: data.title.trim(),\n body: data.body.trim() ? data.body : \"\",\n category: data.category as FeedbackCategory,\n context,\n screenshot_url,\n attachment_urls,\n });\n } catch (error) {\n toast.error(errorMessage ? errorMessage(error, toastText.submitFailed) : toastText.submitFailed);\n return;\n } finally {\n inFlight.current = false;\n setSubmitting(false);\n }\n toast.success(toastText.submitted);\n if (opening.current === from) setIsOpen(false);\n onSubmitted?.(result);\n };\n\n // Nothing is drawn while the dialog's module is on its way — a few milliseconds, once per\n // page load; a spinner would only flash. A load that fails (a deploy replaced the chunk)\n // throws a chunk-load error to the app's error boundary, as a lazy route's does.\n const dialog = isOpen ? (\n <Suspense fallback={null}>\n <LazySubmitDialog\n onClose={close}\n category={category}\n onCategoryChange={setCategory}\n submitting={submitting}\n onSubmit={submit}\n user={user}\n url={url}\n attachUrl={attachUrl}\n onAttachUrlChange={setAttachUrl}\n environment={environment}\n version={version}\n capture={capture}\n publicNotice={publicNotice}\n />\n </Suspense>\n ) : null;\n\n return { open, close, dialog };\n}\n"],"mappings":";AA2MM;AA3MN,SAAS,MAAM,UAAU,QAAQ,gBAAgB;AAEjD,SAAS,aAAa;AAItB,SAAS,8BAA8B;AACvC,SAAS,oCAAoF;AAU7F,MAAM,mBAAmB;AAAA,EAAK,MAC5B,OAAO,0BAA0B,EAAE,KAAK,CAAC,YAAY,EAAE,SAAS,OAAO,qBAAqB,EAAE;AAChG;AA4HO,SAAS,kBAA+B,SAAsD;AACnG,QAAM,EAAE,QAAQ,QAAQ,MAAM,aAAa,SAAS,aAAa,cAAc,SAAS,aAAa,IAAI;AACzG,QAAM,YAAY,uBAAuB;AACzC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,CAAC,UAAU,WAAW,IAAI,SAA2B,OAAO;AAClE,QAAM,CAAC,KAAK,MAAM,IAAI,SAAS,EAAE;AACjC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,IAAI;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAElD,QAAM,UAAU,OAAO,CAAC;AACxB,QAAM,WAAW,OAAO,KAAK;AAE7B,QAAM,OAAO,CAAC,SAA4B;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mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF,GACF,IACE;AAEJ,SAAO,EAAE,MAAM,OAAO,OAAO;AAC/B;","names":[]}
@@ -96,7 +96,7 @@ export { DEFAULT_FEEDBACK_PAGE_LABELS };
96
96
  export declare function useFeedbackPageLabels(labels?: LabelOverride<FeedbackPageLabels>): FeedbackPageLabels;
97
97
  /** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own
98
98
  * row type with more of them passes as it is. */
99
- export type FeedbackTableRow = Pick<FeedbackRecord, "id" | "user_id" | "user_email" | "title" | "body" | "category" | "status" | "context" | "resolved_at" | "created_at">;
99
+ export type FeedbackTableRow = Pick<FeedbackRecord, "id" | "user_id" | "user_email" | "title" | "body" | "category" | "status" | "context" | "resolved_at" | "created_at" | "votes">;
100
100
  /**
101
101
  * The environment a report was filed from when it is NOT production, as filed — or
102
102
  * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's
@@ -185,6 +185,13 @@ export interface FeedbackColumnsOptions {
185
185
  labels: FeedbackPageLabels;
186
186
  statusLabels: FeedbackStatusLabels;
187
187
  categoryLabels: FeedbackCategoryLabels;
188
+ /** 0.38 (§9.6): a sortable **Votes** column before Status — `row.votes`, a missing
189
+ * one as 0 — hidden on the phone (the card's chip, {@link FeedbackMobileCardProps.votes},
190
+ * carries it there). Off by default. */
191
+ votes?: boolean;
192
+ /** The Votes header — `feedbackPublic.columnVotes`, so the inbox and the public list
193
+ * say the same ({@link useFeedbackColumns} reads it). Default "Votes". */
194
+ votesHeader?: string;
188
195
  }
189
196
  /**
190
197
  * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's
@@ -215,10 +222,10 @@ export interface FeedbackColumnsOptions {
215
222
  * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so
216
223
  * an app may drop or add a column (`columns.filter((c) => c.key !== "email")`).
217
224
  */
218
- export declare function feedbackColumns<T extends FeedbackTableRow>({ mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels, }: FeedbackColumnsOptions): DataTableColumn<T>[];
225
+ export declare function feedbackColumns<T extends FeedbackTableRow>({ mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels, votes, votesHeader, }: FeedbackColumnsOptions): DataTableColumn<T>[];
219
226
  /** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words
220
227
  * read from the provider, and `renderDate` optional. */
221
- export interface UseFeedbackColumnsOptions extends Omit<FeedbackColumnsOptions, "renderDate" | "labels" | "statusLabels" | "categoryLabels"> {
228
+ export interface UseFeedbackColumnsOptions extends Omit<FeedbackColumnsOptions, "renderDate" | "labels" | "statusLabels" | "categoryLabels" | "votesHeader"> {
222
229
  /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */
223
230
  renderDate?: FeedbackRenderDate;
224
231
  /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is
@@ -231,7 +238,7 @@ export interface UseFeedbackColumnsOptions extends Omit<FeedbackColumnsOptions,
231
238
  * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function
232
239
  * per render, or every row's columns are rebuilt on each render (keksdose :667).
233
240
  */
234
- export declare function useFeedbackColumns<T extends FeedbackTableRow>({ mine, canEdit, onStatus, renderDate: renderDateProp, commit, labels: labelsProp, }: UseFeedbackColumnsOptions): DataTableColumn<T>[];
241
+ export declare function useFeedbackColumns<T extends FeedbackTableRow>({ mine, canEdit, onStatus, renderDate: renderDateProp, commit, votes, labels: labelsProp, }: UseFeedbackColumnsOptions): DataTableColumn<T>[];
235
242
  /**
236
243
  * The phone list's day headers (keksdose feedback #325: the list "grouped by date, like
237
244
  * the transactions list"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.
@@ -249,6 +256,9 @@ export interface FeedbackMobileCardProps {
249
256
  /** See {@link FeedbackRenderDate}; the same function as the columns' and the day
250
257
  * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */
251
258
  renderDate?: FeedbackRenderDate;
259
+ /** 0.38: the vote count as a chip beside the category — with `useFeedbackColumns`'
260
+ * `votes`, whose column the phone hides. */
261
+ votes?: boolean;
252
262
  /** Over the `feedbackPage` namespace. */
253
263
  labels?: LabelOverride<FeedbackPageLabels>;
254
264
  }
@@ -262,7 +272,7 @@ export interface FeedbackMobileCardProps {
262
272
  * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,
263
273
  * which is how keksdose's cards lost them.
264
274
  */
265
- export declare function FeedbackMobileCard({ row, showSubmitter, renderDate: renderDateProp, labels: labelsProp }: FeedbackMobileCardProps): import("react").JSX.Element;
275
+ export declare function FeedbackMobileCard({ row, showSubmitter, renderDate: renderDateProp, votes, labels: labelsProp, }: FeedbackMobileCardProps): import("react").JSX.Element;
266
276
  export interface FeedbackAwaitingToggleProps {
267
277
  /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a
268
278
  * thumb gesture on one screen, not a view worth linking to. */
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useMemo } from "react";
4
- import { ExternalLink } from "lucide-react";
4
+ import { ExternalLink, ThumbsUp } from "lucide-react";
5
5
  import { cn } from "../lib/cn.js";
6
6
  import { toLocalIso } from "../lib/dates.js";
7
7
  import { EMPTY_FORMATTED_VALUE, formatDate, toDate } from "../lib/format.js";
@@ -26,6 +26,7 @@ import {
26
26
  import { FEEDBACK_AWAITING_STATUSES, reworkCount } from "./feedback-record.js";
27
27
  import { feedbackPageHref, feedbackPagePath } from "./feedback-row-detail.js";
28
28
  import { DEFAULT_FEEDBACK_PAGE_LABELS } from "./feedback-table-labels.js";
29
+ import { DEFAULT_FEEDBACK_PUBLIC_LABELS } from "./feedback-public-labels.js";
29
30
  function useFeedbackPageLabels(labels) {
30
31
  return useKitLabels("feedbackPage", DEFAULT_FEEDBACK_PAGE_LABELS, labels);
31
32
  }
@@ -113,6 +114,12 @@ function FeedbackPageLinkCell({ context, openPage }) {
113
114
  function RenderedLink({ render, ...props }) {
114
115
  return render(props);
115
116
  }
117
+ function FeedbackVoteCount({ votes, className }) {
118
+ return /* @__PURE__ */ jsxs(Chip, { size: "sm", className, "data-feedback-vote-count": votes ?? 0, children: [
119
+ /* @__PURE__ */ jsx(ThumbsUp, { className: "size-3", "aria-hidden": true }),
120
+ /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: votes ?? 0 })
121
+ ] });
122
+ }
116
123
  function statusRank(status) {
117
124
  const at = FEEDBACK_STATUS_ORDER.indexOf(status);
118
125
  return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;
@@ -125,9 +132,22 @@ function feedbackColumns({
125
132
  commit,
126
133
  labels,
127
134
  statusLabels,
128
- categoryLabels
135
+ categoryLabels,
136
+ votes = false,
137
+ votesHeader = DEFAULT_FEEDBACK_PUBLIC_LABELS.columnVotes
129
138
  }) {
130
139
  const editable = canEdit && !mine;
140
+ const votesColumn = votes ? [
141
+ {
142
+ key: "votes",
143
+ header: votesHeader,
144
+ className: "whitespace-nowrap",
145
+ cell: (row) => /* @__PURE__ */ jsx(FeedbackVoteCount, { votes: row.votes }),
146
+ sortBy: (row) => row.votes ?? 0,
147
+ filter: { type: "number", getValue: (row) => row.votes ?? 0 },
148
+ mobileHidden: true
149
+ }
150
+ ] : [];
131
151
  return [
132
152
  {
133
153
  key: "id",
@@ -206,6 +226,7 @@ function feedbackColumns({
206
226
  filterBy: (row) => feedbackPagePath(row.context) ?? "",
207
227
  mobileHidden: true
208
228
  },
229
+ ...votesColumn,
209
230
  {
210
231
  key: "status",
211
232
  header: labels.columnStatus,
@@ -248,21 +269,40 @@ function useFeedbackColumns({
248
269
  onStatus,
249
270
  renderDate: renderDateProp,
250
271
  commit,
272
+ votes,
251
273
  labels: labelsProp
252
274
  }) {
253
275
  const labels = useFeedbackPageLabels(labelsProp);
254
276
  const statusLabels = useFeedbackStatusLabels();
255
277
  const categoryLabels = useFeedbackCategoryLabels();
278
+ const votesHeader = useKitLabels("feedbackPublic", DEFAULT_FEEDBACK_PUBLIC_LABELS).columnVotes;
256
279
  const renderDate = useFeedbackRenderDate(renderDateProp);
257
280
  return useMemo(
258
- () => feedbackColumns({ mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels }),
259
- [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels]
281
+ () => feedbackColumns({
282
+ mine,
283
+ canEdit,
284
+ onStatus,
285
+ renderDate,
286
+ commit,
287
+ labels,
288
+ statusLabels,
289
+ categoryLabels,
290
+ votes,
291
+ votesHeader
292
+ }),
293
+ [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels, votes, votesHeader]
260
294
  );
261
295
  }
262
296
  function feedbackMobileGroupBy(renderDate) {
263
297
  return (row) => renderDate(row.created_at);
264
298
  }
265
- function FeedbackMobileCard({ row, showSubmitter = false, renderDate: renderDateProp, labels: labelsProp }) {
299
+ function FeedbackMobileCard({
300
+ row,
301
+ showSubmitter = false,
302
+ renderDate: renderDateProp,
303
+ votes = false,
304
+ labels: labelsProp
305
+ }) {
266
306
  const labels = useFeedbackPageLabels(labelsProp);
267
307
  const renderDate = useFeedbackRenderDate(renderDateProp);
268
308
  return /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
@@ -272,6 +312,7 @@ function FeedbackMobileCard({ row, showSubmitter = false, renderDate: renderDate
272
312
  ] }),
273
313
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted", children: [
274
314
  /* @__PURE__ */ jsx(FeedbackCategoryBadge, { category: row.category, compact: true }),
315
+ votes && /* @__PURE__ */ jsx(FeedbackVoteCount, { votes: row.votes }),
275
316
  /* @__PURE__ */ jsx(FeedbackDate, { value: row.created_at, renderDate }),
276
317
  showSubmitter && // The short id form: "#7" says enough on a card that has room for little.
277
318
  /* @__PURE__ */ jsxs("span", { className: "min-w-0 truncate", children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/feedback/feedback-table.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { MouseEvent, ReactElement, ReactNode } from \"react\";\nimport { ExternalLink } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { toLocalIso } from \"../lib/dates\";\nimport { EMPTY_FORMATTED_VALUE, formatDate, toDate } from \"../lib/format\";\nimport { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { KitLinkProps } from \"../i18n/kit-labels\";\nimport { Chip } from \"../components/chip\";\nimport { FloatingAction, FloatingActionGroup } from \"../components/floating-panel\";\nimport type { FloatingCorner } from \"../components/floating-panel\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport type { DataTableColumn } from \"../components/data-table\";\nimport {\n FEEDBACK_CATEGORY_ORDER,\n FEEDBACK_STATUS_META,\n FEEDBACK_STATUS_ORDER,\n FeedbackCategoryBadge,\n FeedbackStatusBadge,\n FeedbackStatusTransitions,\n feedbackCategoryRank,\n visibleFeedbackStatuses,\n type FeedbackStatus,\n} from \"./feedback-inbox\";\nimport {\n useFeedbackCategoryLabels,\n useFeedbackStatusLabels,\n type FeedbackCategoryLabels,\n type FeedbackStatusLabels,\n} from \"./feedback-labels\";\nimport { FEEDBACK_AWAITING_STATUSES, reworkCount, type FeedbackContext, type FeedbackRecord } from \"./feedback-record\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport { feedbackPageHref, feedbackPagePath } from \"./feedback-row-detail\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_PAGE_LABELS } from \"./feedback-table-labels\";\n\n/**\n * The two feedback pages' TABLE — `/feedback` (the admin inbox) and `/my-feedback` (the\n * user's own) — as the kit's parts: §4.3 of the feedback contract\n * (docs/feedback-harmonization.md), lifted from keksdose\n * `frontend/src/features/feedback/feedback-page.tsx` (columns :711–963, the phone card\n * :1038–1065, the awaiting toggle :689–709 and :1086–1101).\n *\n * Until 0.27 each app wrote this table itself, and the three had drifted exactly where a\n * table drifts: kastlan's showed five statuses and no environment, Kurvenschmiede's one\n * page served both audiences, and keksdose's — the canon, argued over a year of feedback\n * items — had a latent bug of its own: its subject cell carries the environment and\n * rework chips \"so a second attempt is marked on every surface at once\" (:760), but the\n * phone card is a `mobileCard`, and `DataTable` never renders the `mobilePrimary` cell\n * when `mobileCard` is set (data-table-mobile.tsx, `cardInner`). Its phone cards showed neither\n * chip. {@link FeedbackMobileCard} draws both itself, from the same\n * {@link FeedbackSubject} the column uses, so the two surfaces cannot part again.\n *\n * What stays the app's: the rows (its API client), who is an admin, the routes and the\n * `/feedback` → `/my-feedback` redirect, the `?row=` deep link and the row detail. What\n * is here: the nine columns ({@link feedbackColumns} / {@link useFeedbackColumns}), the\n * phone card and its day headers ({@link FeedbackMobileCard},\n * {@link feedbackMobileGroupBy}), the phone's \"Only what is waiting for you\" toggle\n * ({@link FeedbackAwaitingToggle}), the empty state ({@link FeedbackEmptyState}) and the\n * `feedbackPage` words. The swipes are `feedbackSwipePlan` (feedback-swipe.tsx), passed\n * by the app because whether the page may write is the app's call.\n */\n\n/* ── Labels ─────────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackPage` — the words of the two feedback pages (§4.3). The English is keksdose's\n * `en.json` (`feedback.*`, `common.none`); the de-CH canon is noted on each key (keksdose\n * `de-CH.json`, ss never ß).\n */\nexport interface FeedbackPageLabels {\n /** The admin inbox's page title, `/feedback`. de-CH: \"Feedback\" */\n title: string;\n /** The user's own list, `/my-feedback`. de-CH: \"Mein Feedback\" */\n myTitle: string;\n /** Column 1, the id. de-CH: \"#\" */\n columnId: string;\n /** Column 2, when it was filed. de-CH: \"Datum\" */\n columnDate: string;\n /** Column 3. de-CH: \"Kategorie\" */\n columnCategory: string;\n /** Column 4, the title with its chips. de-CH: \"Betreff\" */\n columnSubject: string;\n /** Column 5, who filed it. de-CH: \"Nutzer\" */\n columnUser: string;\n /** Column 6. de-CH: \"E-Mail\" */\n columnEmail: string;\n /** Column 7, the page it was filed from. de-CH: \"URL\" */\n columnUrl: string;\n /** Column 8. de-CH: \"Status\" */\n columnStatus: string;\n /** Column 9, when it was settled. de-CH: \"Erledigt am\" */\n columnResolved: string;\n /** What the URL cell's link does, said before the path to a screen reader.\n * de-CH: \"Seite öffnen\" */\n openPage: string;\n /** The table with nothing to show, on both pages (§7.13) — keksdose's `common.none`.\n * de-CH: \"Keine\" */\n empty: string;\n /** The submitter of a report whose account was erased (`user_id: null`, keksdose live\n * #275). de-CH: \"<gelöschter Nutzer>\" */\n deletedUser: string;\n /** The submitter when neither a name nor an email is known — `id` is `user_id`.\n * de-CH: \"Nutzer #{{id}}\" */\n userFallback: (id: number) => string;\n /** The chip for a report filed from a copy of the app that is not production —\n * `environment` is `context.environment` as filed (\"dev\", \"local\", or the app's own\n * word). Upper-cased like the top bar's environment badge, so the marker the tester saw\n * is the marker triage sees. Guarded: a context is untyped JSON, so a value that is no\n * string (an app calling it with `context.environment` as stored) is printed, never\n * thrown on. de-CH: the same. */\n environment: (environment: string) => string;\n /** The chip for a report sent back for rework — `count` ≥ 1 is how many times\n * (`reworkCount`, keksdose live #331). de-CH: \"Nacharbeit\" / \"Nacharbeit ×{{count}}\" */\n reworkChip: (count: number) => string;\n /** The phone toggle narrowing the inbox to IN_EVALUATION + NEEDS_LIVE_TEST.\n * de-CH: \"Nur was auf Sie wartet\" */\n awaitingFilter: string;\n /** The name of the phone's floating group that holds it. de-CH: \"Feedback-Aktionen\" */\n phoneActions: string;\n}\n\n// Defined in ./feedback-table-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_PAGE_LABELS };\n\n/** `feedbackPage` resolved: English, then `<UiKitProvider labels>`, then `labels`. The\n * page's title comes from here too: `mine ? labels.myTitle : labels.title`. */\nexport function useFeedbackPageLabels(labels?: LabelOverride<FeedbackPageLabels>): FeedbackPageLabels {\n return useKitLabels(\"feedbackPage\", DEFAULT_FEEDBACK_PAGE_LABELS, labels);\n}\n\n/* ── Reading a row ──────────────────────────────────────────────────────────── */\n\n/** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own\n * row type with more of them passes as it is. */\nexport type FeedbackTableRow = Pick<\n FeedbackRecord,\n \"id\" | \"user_id\" | \"user_email\" | \"title\" | \"body\" | \"category\" | \"status\" | \"context\" | \"resolved_at\" | \"created_at\"\n>;\n\n/** A context value as a trimmed string, or `\"\"` — every key is optional on read (§3.2)\n * and an app's own context type may say `unknown`. */\nfunction text(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/**\n * The environment a report was filed from when it is NOT production, as filed — or\n * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's\n * badge is: the marker earns attention by being rare. A missing value is production too —\n * every row filed before a test copy existed, and crash rows filed before the crash\n * payload carried `environment` (§3.2, §3.6). An unknown value is shown rather than swallowed: an environment\n * nobody recognises is exactly when triage needs to see one.\n */\nexport function feedbackEnvironment(context: FeedbackContext | null | undefined): string | null {\n const env = text(context?.environment);\n return !env || env.toLowerCase() === \"prod\" ? null : env;\n}\n\n/**\n * Who filed a report, as one string (keksdose `submitterLabel`, :163): the display name,\n * else the email, else `userFallback(user_id)`. An erased account (`user_id: null`) is\n * `deletedUser` FIRST, ahead of the context: the server scrubs the name with the account,\n * but a row that somehow kept one must still not go on naming somebody who asked to be\n * forgotten. The joined `user_email` (admin list) is preferred to the context snapshot.\n */\nexport function feedbackSubmitter(\n row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">,\n labels: Pick<FeedbackPageLabels, \"deletedUser\" | \"userFallback\">,\n): string {\n if (row.user_id == null) return labels.deletedUser;\n return (\n text(row.context?.user_display_name) ||\n text(row.user_email) ||\n text(row.context?.user_email) ||\n labels.userFallback(row.user_id)\n );\n}\n\n/**\n * The submitter's email (keksdose `submitterEmail`, :175): the joined `user_email` —\n * authoritative, the display name is self-chosen (feedback #108) — else the context\n * snapshot, which is what `/my-feedback` has (`GET /feedback/my` sends no join). `\"\"`\n * for an erased account, for the reason {@link feedbackSubmitter} gives.\n */\nexport function feedbackSubmitterEmail(row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">): string {\n if (row.user_id == null) return \"\";\n return text(row.user_email) || text(row.context?.user_email);\n}\n\n/** Whether a status is one the phone's awaiting toggle keeps — `FEEDBACK_AWAITING_STATUSES`,\n * the two that wait on the person triaging. `rows.filter((r) => isFeedbackAwaiting(r.status))`. */\nexport function isFeedbackAwaiting(status: FeedbackStatus): boolean {\n return FEEDBACK_AWAITING_STATUSES.includes(status);\n}\n\n/* ── Dates ──────────────────────────────────────────────────────────────────── */\n\n/**\n * How the pages write a date: an ISO timestamp in, one string out. keksdose passes its\n * `useDateCell()` (the app's date-format preference, weekday and all — dev#546), which\n * fits as it is.\n *\n * ONE function for the date column, the resolved column, the phone card and the phone's\n * day headers, so the four cannot disagree (keksdose dev#546 round 3: the header is a\n * string and must say what the card says).\n */\nexport type FeedbackRenderDate = (iso: string) => string;\n\n/** The kit's own date, weekday included: \"Sun, 4 Oct 2026\" / \"So., 4. Okt. 2026\". A date\n * in a column carries its weekday (keksdose's rule, date-cell.tsx). */\nconst FEEDBACK_DATE_STYLE: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n};\n\n/**\n * `renderDate` when the app gave one, else the kit's: the `<UiKitProvider formatDate>`\n * when the app set one (called with the LOCAL calendar day and `weekday: true`, as\n * `DateMark` calls it), else `Intl` in the provider's locale with the weekday. An\n * unparseable value is passed through rather than hidden.\n */\nexport function useFeedbackRenderDate(renderDate?: FeedbackRenderDate, locale?: string): FeedbackRenderDate {\n const kitLocale = useKitLocale(locale);\n const fromProvider = useKitDateFormatter();\n return useMemo<FeedbackRenderDate>(() => {\n if (renderDate) return renderDate;\n return (iso) => {\n const date = toDate(iso);\n if (!date) return iso || EMPTY_FORMATTED_VALUE;\n const own = fromProvider\n ? fromProvider(toLocalIso(date), { unit: \"day\", source: \"dateMark\", locale: kitLocale, weekday: true })\n : \"\";\n return own || formatDate(date, FEEDBACK_DATE_STYLE, { locale: kitLocale });\n };\n }, [renderDate, fromProvider, kitLocale]);\n}\n\n/** A date in a cell: `<time>`, nowrap, tabular figures; \"—\" when there is none. */\nfunction FeedbackDate({ value, renderDate }: { value: string | null | undefined; renderDate: FeedbackRenderDate }) {\n if (!value) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n return (\n <time dateTime={value} className=\"whitespace-nowrap tabular-nums text-muted\">\n {renderDate(value)}\n </time>\n );\n}\n\n/** An instant for sorting; a value that does not parse sorts with the empty ones. */\nfunction instant(value: string | null | undefined): number | null {\n const ms = value ? Date.parse(value) : NaN;\n return Number.isNaN(ms) ? null : ms;\n}\n\n/* ── The subject: title + environment chip + rework chip ───────────────────── */\n\nexport interface FeedbackSubjectProps {\n row: Pick<FeedbackRecord, \"title\" | \"body\" | \"context\">;\n /**\n * `false` (default): one line — the title truncates and the chips stay whole, as a\n * table cell wants. `true`: the title wraps and the chips flow after its last word, as\n * the phone card wants (a phone shows the whole title or nothing useful).\n */\n wrap?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n className?: string;\n}\n\n/**\n * A report's title with its two chips (§4.3, column 4): the environment when it is not\n * production (keksdose's amber outline, the top bar's environment badge — the marker the\n * tester saw is the marker triage sees) and **Rework** / **Rework ×n** when the author has\n * sent it back (keksdose live #331: *\"have a new category for items in rework\"*, as a fact\n * derived from the body rather than a seventh status).\n *\n * No tooltip on either chip (keksdose dev#523): each already says what it means.\n */\nexport function FeedbackSubject({ row, wrap = false, labels: labelsProp, className }: FeedbackSubjectProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const env = feedbackEnvironment(row.context);\n const rounds = reworkCount(row.body ?? \"\");\n const chipClass = wrap ? \"ms-1.5 align-middle\" : \"shrink-0\";\n const chips = (\n <>\n {env && (\n <Chip size=\"sm\" variant=\"outline\" shape=\"square\" tone=\"warning\" caps className={chipClass} data-feedback-env=\"\">\n {labels.environment(env)}\n </Chip>\n )}\n {rounds > 0 && (\n <Chip size=\"sm\" tone=\"warning\" caps className={chipClass} data-feedback-rework={rounds}>\n {labels.reworkChip(rounds)}\n </Chip>\n )}\n </>\n );\n if (wrap) {\n return (\n <span className={cn(\"min-w-0 font-medium [overflow-wrap:anywhere]\", className)}>\n {row.title}\n {chips}\n </span>\n );\n }\n return (\n <span className={cn(\"inline-flex min-w-0 max-w-full items-center gap-1.5 large:items-start\", className)}>\n {/* One line at Normal; from Large up the title wraps rather than losing its end (text\n size §10.17 — the release sweep's first CI run found it cut on the showcase). */}\n <span className=\"min-w-0 truncate-until-large font-medium\">{row.title}</span>\n {chips}\n </span>\n );\n}\n\n/* ── The URL cell ───────────────────────────────────────────────────────────── */\n\n/**\n * The page a report was filed from, as a link — the cell keksdose's column 7 draws\n * (:850): the path as text, path + query + hash as the `href`, read from `context.url`\n * else `context.route` by the row detail's own readers (`feedbackPagePath` /\n * `feedbackPageHref`, feedback-row-detail.tsx), so the column and the detail link the\n * same page the same way. A real link through the `<UiKitProvider linkComponent>` (the app's router, so it\n * does not reload the app; keksdose's plain `<a>` did), and its click stops at the cell so\n * the row does not open as well.\n *\n * Its name is the path, as on screen, with \"Open page\" said before it — keksdose's\n * `aria-label=\"Open page\"` replaced the path, so a screen reader heard forty identical\n * links down the column.\n */\nfunction FeedbackPageLinkCell({ context, openPage }: { context: FeedbackContext | null; openPage: string }) {\n const kitLink = useKitLink();\n const href = feedbackPageHref(context);\n const path = feedbackPagePath(context);\n if (!href || !path) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n const className =\n \"inline-flex min-w-0 max-w-full items-center gap-1 text-secondary hover:text-primary hover:underline\";\n const children = (\n <>\n {/* The space outside the hidden span: a flex container drops it from the layout,\n and the accessible name keeps it (\"Open page /accounts\"). */}\n <span className=\"sr-only\">{openPage}</span>{\" \"}\n <code className=\"min-w-0 truncate text-xs\">{path}</code>\n <ExternalLink className=\"size-3 shrink-0\" aria-hidden />\n </>\n );\n const onClick = (event: MouseEvent<HTMLAnchorElement>) => event.stopPropagation();\n const render = pickLinkRenderer<KitLinkProps>(undefined, kitLink, href);\n return render ? (\n <RenderedLink render={render} href={href} className={className} onClick={onClick}>\n {children}\n </RenderedLink>\n ) : (\n <a href={href} className={className} onClick={onClick}>\n {children}\n </a>\n );\n}\n\n/** The provider's link, drawn by a component declared once (as FloatingAction's). */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: (props: KitLinkProps) => ReactElement }) {\n return render(props);\n}\n\n/* ── The columns ────────────────────────────────────────────────────────────── */\n\n/** What {@link feedbackColumns} takes — every word already resolved (see\n * {@link useFeedbackColumns}, which resolves them from the provider). */\nexport interface FeedbackColumnsOptions {\n /** `/my-feedback`. The same nine columns (one page component, §4.3), but the status\n * cell is read-only there whatever `canEdit` says — \"no status or outcome editing\n * there (also for an admin)\". */\n mine?: boolean;\n /** The admin on `/feedback` — the status cell offers its steps. Otherwise it shows them\n * read-only. */\n canEdit: boolean;\n /** The undoable status change, `useFeedbackStatusUndo(update.mutate)` (§4.5) — the\n * same one the row detail and the swipes use. */\n onStatus: FeedbackStatusChange;\n /** See {@link FeedbackRenderDate}. */\n renderDate: FeedbackRenderDate;\n /** The status buttons SAVE when pressed: pass `true` to put them under the page's\n * `WriteLockProvider` (FeedbackStatusTransitions' `commit`). Off by default — a\n * feedback inbox is rarely what an app's lock is about. */\n commit?: CommitScope;\n labels: FeedbackPageLabels;\n statusLabels: FeedbackStatusLabels;\n categoryLabels: FeedbackCategoryLabels;\n}\n\n/** A status's place in the chain, unknown ones last (as `feedbackCategoryRank`). */\nfunction statusRank(status: FeedbackStatus): number {\n const at = FEEDBACK_STATUS_ORDER.indexOf(status);\n return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;\n}\n\n/**\n * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's\n * (:711–963) with the contract's changes:\n *\n * | # | key | cell | filter | phone |\n * |---|---|---|---|---|\n * | 1 | `id` | id, mono | number | hidden |\n * | 2 | `date` | `created_at`, weekday ({@link FeedbackRenderDate}) | date | |\n * | 3 | `category` | `FeedbackCategoryBadge`, sorted CRASH first | select, all five | |\n * | 4 | `title` | {@link FeedbackSubject} | text: title + environment | card heading |\n * | 5 | `user` | {@link feedbackSubmitter} | text: name + email, or \"deleted user\" | |\n * | 6 | `email` | {@link feedbackSubmitterEmail} | text | hidden |\n * | 7 | `url` | the page, a link (`noRowLink`) | text: path | hidden |\n * | 8 | `status` | `FeedbackStatusTransitions variant=\"icon\"`, `visibleFeedbackStatuses` | select, chain order | |\n * | 9 | `resolved` | `resolved_at` | date | hidden |\n *\n * - Both select filters list the WHOLE vocabulary in its own order, translated —\n * without `options` the popover lists the bare enum values found in the rows\n * (keksdose feedback #160), and kastlan's first CRASH row would otherwise appear in a\n * filter that never offered it.\n * - The status column owns the status filter, and only it (keksdose live #330's revert:\n * the phone's filter sheet already exposes every column filter).\n * - `/my-feedback` shows the same nine: the Email cell's context fallback exists for it\n * (the admin list's join is absent there, §3.1), and its phone card drops the submitter\n * instead ({@link FeedbackMobileCardProps.showSubmitter}).\n *\n * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so\n * an app may drop or add a column (`columns.filter((c) => c.key !== \"email\")`).\n */\nexport function feedbackColumns<T extends FeedbackTableRow>({\n mine = false,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n}: FeedbackColumnsOptions): DataTableColumn<T>[] {\n const editable = canEdit && !mine;\n return [\n {\n key: \"id\",\n header: labels.columnId,\n cell: (row) => <span className=\"font-mono text-xs text-muted\">{row.id}</span>,\n sortBy: (row) => row.id,\n filter: { type: \"number\", getValue: (row) => row.id },\n mobileHidden: true,\n },\n {\n key: \"date\",\n header: labels.columnDate,\n cell: (row) => <FeedbackDate value={row.created_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.created_at),\n filter: { type: \"date\", getValue: (row) => row.created_at },\n },\n {\n key: \"category\",\n header: labels.columnCategory,\n cell: (row) => <FeedbackCategoryBadge category={row.category} label={categoryLabels[row.category]} />,\n sortBy: (row) => feedbackCategoryRank(row.category),\n filter: {\n type: \"select\",\n getValue: (row) => row.category,\n options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] })),\n },\n },\n {\n key: \"title\",\n header: labels.columnSubject,\n cell: (row) => <FeedbackSubject row={row} labels={labels} />,\n sortBy: (row) => row.title,\n // Searchable by the environment too, so \"dev\" narrows to the test copy's reports —\n // a chip you can see but not filter by makes you read every row (keksdose :804).\n filterBy: (row) => {\n const env = feedbackEnvironment(row.context);\n return env ? `${row.title} ${labels.environment(env)}` : row.title;\n },\n mobilePrimary: true,\n },\n {\n key: \"user\",\n header: labels.columnUser,\n cell: (row) => <span className=\"text-secondary\">{feedbackSubmitter(row, labels)}</span>,\n sortBy: (row) => feedbackSubmitter(row, labels),\n // Name AND email, so either finds the person; the erased ones by the placeholder\n // (their context holds no name any more).\n filterBy: (row) =>\n row.user_id == null\n ? labels.deletedUser\n : `${feedbackSubmitter(row, labels)} ${feedbackSubmitterEmail(row)}`,\n },\n {\n key: \"email\",\n header: labels.columnEmail,\n // One line, like the URL beside it: keksdose's `break-all` let the browser squeeze\n // the column to its header and broke every address in two (\"user@exam / ple.test\"),\n // which made every row taller. Unbroken, a resized (pinned) column ellipsises it.\n className: \"whitespace-nowrap\",\n cell: (row) => {\n const email = feedbackSubmitterEmail(row);\n return email ? (\n <span className=\"text-secondary\">{email}</span>\n ) : (\n <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>\n );\n },\n sortBy: feedbackSubmitterEmail,\n filterBy: feedbackSubmitterEmail,\n mobileHidden: true,\n },\n {\n key: \"url\",\n header: labels.columnUrl,\n // A cell only ellipsises what it is told not to wrap (keksdose live #348: the path\n // clipped mid-character \"behind the next column\").\n className: \"whitespace-nowrap\",\n // The cell IS a link, so the row's own permalink must never wrap it (keksdose\n // feedback #451: <a> in <a>, and \"open the page\" silently did nothing).\n noRowLink: true,\n cell: (row) => <FeedbackPageLinkCell context={row.context} openPage={labels.openPage} />,\n sortBy: (row) => feedbackPagePath(row.context) ?? \"\",\n filterBy: (row) => feedbackPagePath(row.context) ?? \"\",\n mobileHidden: true,\n },\n {\n key: \"status\",\n header: labels.columnStatus,\n // A KNOWN width: at most six 28px icon buttons (from IN_PROGRESS or IN_EVALUATION:\n // one step either way and the three off the chain) — keksdose live #348 sized it\n // for five and the sixth pushed the column wider.\n className: \"w-[13.5rem] whitespace-nowrap\",\n cell: (row) => (\n <FeedbackStatusTransitions\n status={row.status}\n statuses={visibleFeedbackStatuses(row.status)}\n canEdit={editable}\n commit={commit}\n onPick={(status) => onStatus(row, status)}\n variant=\"icon\"\n label={(status) => statusLabels[status]}\n />\n ),\n sortBy: (row) => statusRank(row.status),\n filter: {\n type: \"select\",\n getValue: (row) => row.status,\n options: FEEDBACK_STATUS_ORDER.map((value) => ({ value, label: statusLabels[value] })),\n },\n },\n {\n key: \"resolved\",\n header: labels.columnResolved,\n cell: (row) => <FeedbackDate value={row.resolved_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.resolved_at),\n filter: { type: \"date\", getValue: (row) => row.resolved_at },\n mobileHidden: true,\n },\n ];\n}\n\n/** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words\n * read from the provider, and `renderDate` optional. */\nexport interface UseFeedbackColumnsOptions\n extends Omit<FeedbackColumnsOptions, \"renderDate\" | \"labels\" | \"statusLabels\" | \"categoryLabels\"> {\n /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is\n * a dependency of the memo. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * {@link feedbackColumns} with the `feedbackPage`, `feedbackStatus` and\n * `feedbackCategory` words from the provider, memoised on what it reads — pass\n * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function\n * per render, or every row's columns are rebuilt on each render (keksdose :667).\n */\nexport function useFeedbackColumns<T extends FeedbackTableRow>({\n mine,\n canEdit,\n onStatus,\n renderDate: renderDateProp,\n commit,\n labels: labelsProp,\n}: UseFeedbackColumnsOptions): DataTableColumn<T>[] {\n const labels = useFeedbackPageLabels(labelsProp);\n const statusLabels = useFeedbackStatusLabels();\n const categoryLabels = useFeedbackCategoryLabels();\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return useMemo(\n () =>\n feedbackColumns<T>({ mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels }),\n [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels],\n );\n}\n\n/* ── The phone ──────────────────────────────────────────────────────────────── */\n\n/**\n * The phone list's day headers (keksdose feedback #325: the list \"grouped by date, like\n * the transactions list\"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.\n *\n * The key IS the header — the same string the card's date says. DataTable groups runs of\n * equal keys, so the rows must come newest first, as `GET /feedback` and\n * `GET /feedback/my` send them (§3.3).\n */\nexport function feedbackMobileGroupBy(\n renderDate: FeedbackRenderDate,\n): (row: Pick<FeedbackRecord, \"created_at\">) => string {\n return (row) => renderDate(row.created_at);\n}\n\nexport interface FeedbackMobileCardProps {\n row: FeedbackTableRow;\n /** Add the submitter after the date — the admin inbox (`canEdit`). On `/my-feedback`\n * every row is the viewer's own and the name would repeat down the list. */\n showSubmitter?: boolean;\n /** See {@link FeedbackRenderDate}; the same function as the columns' and the day\n * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * One report as a phone card (§4.3; keksdose :1042, feedback #325 rework: *\"compact card\n * instead of a wasteful label/value row per field\"*): the title with its environment and\n * rework chips and the status badge on one line, then the compact category badge, the\n * date and (admin) the submitter beneath.\n *\n * `DataTable mobileCard={(row) => <FeedbackMobileCard row={row} … />}`. It draws the\n * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,\n * which is how keksdose's cards lost them.\n */\nexport function FeedbackMobileCard({ row, showSubmitter = false, renderDate: renderDateProp, labels: labelsProp }: FeedbackMobileCardProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return (\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <FeedbackSubject row={row} wrap labels={labels} className=\"flex-1\" />\n {/* The pill the desktop status column draws, so a status is the same colour and\n glyph on both layouts. */}\n <FeedbackStatusBadge status={row.status} className=\"shrink-0\" />\n </div>\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted\">\n <FeedbackCategoryBadge category={row.category} compact />\n <FeedbackDate value={row.created_at} renderDate={renderDate} />\n {showSubmitter && (\n // The short id form: \"#7\" says enough on a card that has room for little.\n <span className=\"min-w-0 truncate\">\n · {feedbackSubmitter(row, { deletedUser: labels.deletedUser, userFallback: (id) => `#${id}` })}\n </span>\n )}\n </div>\n </div>\n );\n}\n\nexport interface FeedbackAwaitingToggleProps {\n /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a\n * thumb gesture on one screen, not a view worth linking to. */\n pressed: boolean;\n onPressedChange: (pressed: boolean) => void;\n /** Further `FloatingAction`s, after the toggle — the group is what makes them free. */\n children?: ReactNode;\n /** Default `bottom-end`, the register's corner. */\n corner?: FloatingCorner;\n /** Over the group's default distance from the bottom. */\n offset?: string;\n /** On the group. It is `md:hidden` already: the desktop has the status column's\n * filter, the same question asked where there is room for it. */\n className?: string;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The phone inbox's one filter button — **\"Only what is waiting for you\"** (§4.3;\n * keksdose live #330 rework: *\"a button that toggles the evaluation items (in evaluation,\n * test when live) as toggle button similar to the show/hide upcoming/scheduled for the tx\n * page\"*).\n *\n * It narrows TO `FEEDBACK_AWAITING_STATUSES` rather than hiding them: after a loop run\n * those ARE the queue — the rows handed back for a verdict — and everything else is\n * history. A `FloatingActionGroup` with one member anyway, in the register's corner and\n * shape (keksdose feedback #58), so a second action costs nothing; the glyph is\n * IN_EVALUATION's own, so the button reads in the vocabulary of the badges it filters on.\n *\n * Admin inbox only: on `/my-feedback` the author is not waiting on their own verdict.\n * The filtering is the page's — `rows.filter((r) => isFeedbackAwaiting(r.status))` —\n * so the table's own filters, sort and URL stay untouched.\n */\nexport function FeedbackAwaitingToggle({\n pressed,\n onPressedChange,\n children,\n corner,\n offset,\n className,\n labels: labelsProp,\n}: FeedbackAwaitingToggleProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const Icon = FEEDBACK_STATUS_META.IN_EVALUATION.icon;\n return (\n <FloatingActionGroup\n aria-label={labels.phoneActions}\n corner={corner}\n offset={offset}\n className={cn(\"md:hidden\", className)}\n >\n <FloatingAction\n label={labels.awaitingFilter}\n icon={<Icon aria-hidden />}\n pressed={pressed}\n onClick={() => onPressedChange(!pressed)}\n />\n {children}\n </FloatingActionGroup>\n );\n}\n\n/* ── Empty ──────────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackEmptyStateProps {\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The table with nothing to show (§7.13): the one word **None** / **Keine**, on both\n * pages — keksdose's `empty={t(\"common.none\")}` (`feedback-page.tsx:982`). No hint\n * beneath it: where reports are sent from is the feedback menu's business, and the inbox\n * needs no sentence to say it is empty.\n *\n * For `DataTable empty`, which sits in a centred, muted cell — so no box of its own.\n * keksdose passes it unconditionally, so a filter (or the awaiting toggle) that leaves\n * nothing says \"None\" too: `empty={<FeedbackEmptyState />}`.\n */\nexport function FeedbackEmptyState({ labels: labelsProp }: FeedbackEmptyStateProps) {\n const labels = useFeedbackPageLabels(labelsProp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BAAgB,CAAC,OAAO;AAAA;AAAA,QACzC;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;AAmBO,SAAS,mBAAmB,EAAE,QAAQ,WAAW,GAA4B;AAClF,QAAM,SAAS,sBAAsB,UAAU;AAC/C,SAAO,oBAAC,UAAK,uBAAoB,IAAI,iBAAO,OAAM;AACpD;","names":[]}
1
+ {"version":3,"sources":["../../src/feedback/feedback-table.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport type { MouseEvent, ReactElement, ReactNode } from \"react\";\nimport { ExternalLink, ThumbsUp } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { toLocalIso } from \"../lib/dates\";\nimport { EMPTY_FORMATTED_VALUE, formatDate, toDate } from \"../lib/format\";\nimport { useKitDateFormatter, useKitLabels, useKitLink, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport type { KitLinkProps } from \"../i18n/kit-labels\";\nimport { Chip } from \"../components/chip\";\nimport { FloatingAction, FloatingActionGroup } from \"../components/floating-panel\";\nimport type { FloatingCorner } from \"../components/floating-panel\";\nimport { pickLinkRenderer } from \"../components/text-link\";\nimport type { DataTableColumn } from \"../components/data-table\";\nimport {\n FEEDBACK_CATEGORY_ORDER,\n FEEDBACK_STATUS_META,\n FEEDBACK_STATUS_ORDER,\n FeedbackCategoryBadge,\n FeedbackStatusBadge,\n FeedbackStatusTransitions,\n feedbackCategoryRank,\n visibleFeedbackStatuses,\n type FeedbackStatus,\n} from \"./feedback-inbox\";\nimport {\n useFeedbackCategoryLabels,\n useFeedbackStatusLabels,\n type FeedbackCategoryLabels,\n type FeedbackStatusLabels,\n} from \"./feedback-labels\";\nimport { FEEDBACK_AWAITING_STATUSES, reworkCount, type FeedbackContext, type FeedbackRecord } from \"./feedback-record\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport { feedbackPageHref, feedbackPagePath } from \"./feedback-row-detail\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_PAGE_LABELS } from \"./feedback-table-labels\";\nimport { DEFAULT_FEEDBACK_PUBLIC_LABELS } from \"./feedback-public-labels\";\n\n/**\n * The two feedback pages' TABLE — `/feedback` (the admin inbox) and `/my-feedback` (the\n * user's own) — as the kit's parts: §4.3 of the feedback contract\n * (docs/feedback-harmonization.md), lifted from keksdose\n * `frontend/src/features/feedback/feedback-page.tsx` (columns :711–963, the phone card\n * :1038–1065, the awaiting toggle :689–709 and :1086–1101).\n *\n * Until 0.27 each app wrote this table itself, and the three had drifted exactly where a\n * table drifts: kastlan's showed five statuses and no environment, Kurvenschmiede's one\n * page served both audiences, and keksdose's — the canon, argued over a year of feedback\n * items — had a latent bug of its own: its subject cell carries the environment and\n * rework chips \"so a second attempt is marked on every surface at once\" (:760), but the\n * phone card is a `mobileCard`, and `DataTable` never renders the `mobilePrimary` cell\n * when `mobileCard` is set (data-table-mobile.tsx, `cardInner`). Its phone cards showed neither\n * chip. {@link FeedbackMobileCard} draws both itself, from the same\n * {@link FeedbackSubject} the column uses, so the two surfaces cannot part again.\n *\n * What stays the app's: the rows (its API client), who is an admin, the routes and the\n * `/feedback` → `/my-feedback` redirect, the `?row=` deep link and the row detail. What\n * is here: the nine columns ({@link feedbackColumns} / {@link useFeedbackColumns}), the\n * phone card and its day headers ({@link FeedbackMobileCard},\n * {@link feedbackMobileGroupBy}), the phone's \"Only what is waiting for you\" toggle\n * ({@link FeedbackAwaitingToggle}), the empty state ({@link FeedbackEmptyState}) and the\n * `feedbackPage` words. The swipes are `feedbackSwipePlan` (feedback-swipe.tsx), passed\n * by the app because whether the page may write is the app's call.\n */\n\n/* ── Labels ─────────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackPage` — the words of the two feedback pages (§4.3). The English is keksdose's\n * `en.json` (`feedback.*`, `common.none`); the de-CH canon is noted on each key (keksdose\n * `de-CH.json`, ss never ß).\n */\nexport interface FeedbackPageLabels {\n /** The admin inbox's page title, `/feedback`. de-CH: \"Feedback\" */\n title: string;\n /** The user's own list, `/my-feedback`. de-CH: \"Mein Feedback\" */\n myTitle: string;\n /** Column 1, the id. de-CH: \"#\" */\n columnId: string;\n /** Column 2, when it was filed. de-CH: \"Datum\" */\n columnDate: string;\n /** Column 3. de-CH: \"Kategorie\" */\n columnCategory: string;\n /** Column 4, the title with its chips. de-CH: \"Betreff\" */\n columnSubject: string;\n /** Column 5, who filed it. de-CH: \"Nutzer\" */\n columnUser: string;\n /** Column 6. de-CH: \"E-Mail\" */\n columnEmail: string;\n /** Column 7, the page it was filed from. de-CH: \"URL\" */\n columnUrl: string;\n /** Column 8. de-CH: \"Status\" */\n columnStatus: string;\n /** Column 9, when it was settled. de-CH: \"Erledigt am\" */\n columnResolved: string;\n /** What the URL cell's link does, said before the path to a screen reader.\n * de-CH: \"Seite öffnen\" */\n openPage: string;\n /** The table with nothing to show, on both pages (§7.13) — keksdose's `common.none`.\n * de-CH: \"Keine\" */\n empty: string;\n /** The submitter of a report whose account was erased (`user_id: null`, keksdose live\n * #275). de-CH: \"<gelöschter Nutzer>\" */\n deletedUser: string;\n /** The submitter when neither a name nor an email is known — `id` is `user_id`.\n * de-CH: \"Nutzer #{{id}}\" */\n userFallback: (id: number) => string;\n /** The chip for a report filed from a copy of the app that is not production —\n * `environment` is `context.environment` as filed (\"dev\", \"local\", or the app's own\n * word). Upper-cased like the top bar's environment badge, so the marker the tester saw\n * is the marker triage sees. Guarded: a context is untyped JSON, so a value that is no\n * string (an app calling it with `context.environment` as stored) is printed, never\n * thrown on. de-CH: the same. */\n environment: (environment: string) => string;\n /** The chip for a report sent back for rework — `count` ≥ 1 is how many times\n * (`reworkCount`, keksdose live #331). de-CH: \"Nacharbeit\" / \"Nacharbeit ×{{count}}\" */\n reworkChip: (count: number) => string;\n /** The phone toggle narrowing the inbox to IN_EVALUATION + NEEDS_LIVE_TEST.\n * de-CH: \"Nur was auf Sie wartet\" */\n awaitingFilter: string;\n /** The name of the phone's floating group that holds it. de-CH: \"Feedback-Aktionen\" */\n phoneActions: string;\n}\n\n// Defined in ./feedback-table-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_PAGE_LABELS };\n\n/** `feedbackPage` resolved: English, then `<UiKitProvider labels>`, then `labels`. The\n * page's title comes from here too: `mine ? labels.myTitle : labels.title`. */\nexport function useFeedbackPageLabels(labels?: LabelOverride<FeedbackPageLabels>): FeedbackPageLabels {\n return useKitLabels(\"feedbackPage\", DEFAULT_FEEDBACK_PAGE_LABELS, labels);\n}\n\n/* ── Reading a row ──────────────────────────────────────────────────────────── */\n\n/** What the table reads off a report — {@link FeedbackRecord}'s fields, so an app's own\n * row type with more of them passes as it is. */\nexport type FeedbackTableRow = Pick<\n FeedbackRecord,\n | \"id\"\n | \"user_id\"\n | \"user_email\"\n | \"title\"\n | \"body\"\n | \"category\"\n | \"status\"\n | \"context\"\n | \"resolved_at\"\n | \"created_at\"\n | \"votes\"\n>;\n\n/** A context value as a trimmed string, or `\"\"` — every key is optional on read (§3.2)\n * and an app's own context type may say `unknown`. */\nfunction text(value: unknown): string {\n return typeof value === \"string\" ? value.trim() : \"\";\n}\n\n/**\n * The environment a report was filed from when it is NOT production, as filed — or\n * `null` (keksdose `environmentLabel`, :142). Production is silent, as the top bar's\n * badge is: the marker earns attention by being rare. A missing value is production too —\n * every row filed before a test copy existed, and crash rows filed before the crash\n * payload carried `environment` (§3.2, §3.6). An unknown value is shown rather than swallowed: an environment\n * nobody recognises is exactly when triage needs to see one.\n */\nexport function feedbackEnvironment(context: FeedbackContext | null | undefined): string | null {\n const env = text(context?.environment);\n return !env || env.toLowerCase() === \"prod\" ? null : env;\n}\n\n/**\n * Who filed a report, as one string (keksdose `submitterLabel`, :163): the display name,\n * else the email, else `userFallback(user_id)`. An erased account (`user_id: null`) is\n * `deletedUser` FIRST, ahead of the context: the server scrubs the name with the account,\n * but a row that somehow kept one must still not go on naming somebody who asked to be\n * forgotten. The joined `user_email` (admin list) is preferred to the context snapshot.\n */\nexport function feedbackSubmitter(\n row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">,\n labels: Pick<FeedbackPageLabels, \"deletedUser\" | \"userFallback\">,\n): string {\n if (row.user_id == null) return labels.deletedUser;\n return (\n text(row.context?.user_display_name) ||\n text(row.user_email) ||\n text(row.context?.user_email) ||\n labels.userFallback(row.user_id)\n );\n}\n\n/**\n * The submitter's email (keksdose `submitterEmail`, :175): the joined `user_email` —\n * authoritative, the display name is self-chosen (feedback #108) — else the context\n * snapshot, which is what `/my-feedback` has (`GET /feedback/my` sends no join). `\"\"`\n * for an erased account, for the reason {@link feedbackSubmitter} gives.\n */\nexport function feedbackSubmitterEmail(row: Pick<FeedbackRecord, \"user_id\" | \"user_email\" | \"context\">): string {\n if (row.user_id == null) return \"\";\n return text(row.user_email) || text(row.context?.user_email);\n}\n\n/** Whether a status is one the phone's awaiting toggle keeps — `FEEDBACK_AWAITING_STATUSES`,\n * the two that wait on the person triaging. `rows.filter((r) => isFeedbackAwaiting(r.status))`. */\nexport function isFeedbackAwaiting(status: FeedbackStatus): boolean {\n return FEEDBACK_AWAITING_STATUSES.includes(status);\n}\n\n/* ── Dates ──────────────────────────────────────────────────────────────────── */\n\n/**\n * How the pages write a date: an ISO timestamp in, one string out. keksdose passes its\n * `useDateCell()` (the app's date-format preference, weekday and all — dev#546), which\n * fits as it is.\n *\n * ONE function for the date column, the resolved column, the phone card and the phone's\n * day headers, so the four cannot disagree (keksdose dev#546 round 3: the header is a\n * string and must say what the card says).\n */\nexport type FeedbackRenderDate = (iso: string) => string;\n\n/** The kit's own date, weekday included: \"Sun, 4 Oct 2026\" / \"So., 4. Okt. 2026\". A date\n * in a column carries its weekday (keksdose's rule, date-cell.tsx). */\nconst FEEDBACK_DATE_STYLE: Intl.DateTimeFormatOptions = {\n weekday: \"short\",\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n};\n\n/**\n * `renderDate` when the app gave one, else the kit's: the `<UiKitProvider formatDate>`\n * when the app set one (called with the LOCAL calendar day and `weekday: true`, as\n * `DateMark` calls it), else `Intl` in the provider's locale with the weekday. An\n * unparseable value is passed through rather than hidden.\n */\nexport function useFeedbackRenderDate(renderDate?: FeedbackRenderDate, locale?: string): FeedbackRenderDate {\n const kitLocale = useKitLocale(locale);\n const fromProvider = useKitDateFormatter();\n return useMemo<FeedbackRenderDate>(() => {\n if (renderDate) return renderDate;\n return (iso) => {\n const date = toDate(iso);\n if (!date) return iso || EMPTY_FORMATTED_VALUE;\n const own = fromProvider\n ? fromProvider(toLocalIso(date), { unit: \"day\", source: \"dateMark\", locale: kitLocale, weekday: true })\n : \"\";\n return own || formatDate(date, FEEDBACK_DATE_STYLE, { locale: kitLocale });\n };\n }, [renderDate, fromProvider, kitLocale]);\n}\n\n/** A date in a cell: `<time>`, nowrap, tabular figures; \"—\" when there is none. */\nfunction FeedbackDate({ value, renderDate }: { value: string | null | undefined; renderDate: FeedbackRenderDate }) {\n if (!value) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n return (\n <time dateTime={value} className=\"whitespace-nowrap tabular-nums text-muted\">\n {renderDate(value)}\n </time>\n );\n}\n\n/** An instant for sorting; a value that does not parse sorts with the empty ones. */\nfunction instant(value: string | null | undefined): number | null {\n const ms = value ? Date.parse(value) : NaN;\n return Number.isNaN(ms) ? null : ms;\n}\n\n/* ── The subject: title + environment chip + rework chip ───────────────────── */\n\nexport interface FeedbackSubjectProps {\n row: Pick<FeedbackRecord, \"title\" | \"body\" | \"context\">;\n /**\n * `false` (default): one line — the title truncates and the chips stay whole, as a\n * table cell wants. `true`: the title wraps and the chips flow after its last word, as\n * the phone card wants (a phone shows the whole title or nothing useful).\n */\n wrap?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n className?: string;\n}\n\n/**\n * A report's title with its two chips (§4.3, column 4): the environment when it is not\n * production (keksdose's amber outline, the top bar's environment badge — the marker the\n * tester saw is the marker triage sees) and **Rework** / **Rework ×n** when the author has\n * sent it back (keksdose live #331: *\"have a new category for items in rework\"*, as a fact\n * derived from the body rather than a seventh status).\n *\n * No tooltip on either chip (keksdose dev#523): each already says what it means.\n */\nexport function FeedbackSubject({ row, wrap = false, labels: labelsProp, className }: FeedbackSubjectProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const env = feedbackEnvironment(row.context);\n const rounds = reworkCount(row.body ?? \"\");\n const chipClass = wrap ? \"ms-1.5 align-middle\" : \"shrink-0\";\n const chips = (\n <>\n {env && (\n <Chip size=\"sm\" variant=\"outline\" shape=\"square\" tone=\"warning\" caps className={chipClass} data-feedback-env=\"\">\n {labels.environment(env)}\n </Chip>\n )}\n {rounds > 0 && (\n <Chip size=\"sm\" tone=\"warning\" caps className={chipClass} data-feedback-rework={rounds}>\n {labels.reworkChip(rounds)}\n </Chip>\n )}\n </>\n );\n if (wrap) {\n return (\n <span className={cn(\"min-w-0 font-medium [overflow-wrap:anywhere]\", className)}>\n {row.title}\n {chips}\n </span>\n );\n }\n return (\n <span className={cn(\"inline-flex min-w-0 max-w-full items-center gap-1.5 large:items-start\", className)}>\n {/* One line at Normal; from Large up the title wraps rather than losing its end (text\n size §10.17 — the release sweep's first CI run found it cut on the showcase). */}\n <span className=\"min-w-0 truncate-until-large font-medium\">{row.title}</span>\n {chips}\n </span>\n );\n}\n\n/* ── The URL cell ───────────────────────────────────────────────────────────── */\n\n/**\n * The page a report was filed from, as a link — the cell keksdose's column 7 draws\n * (:850): the path as text, path + query + hash as the `href`, read from `context.url`\n * else `context.route` by the row detail's own readers (`feedbackPagePath` /\n * `feedbackPageHref`, feedback-row-detail.tsx), so the column and the detail link the\n * same page the same way. A real link through the `<UiKitProvider linkComponent>` (the app's router, so it\n * does not reload the app; keksdose's plain `<a>` did), and its click stops at the cell so\n * the row does not open as well.\n *\n * Its name is the path, as on screen, with \"Open page\" said before it — keksdose's\n * `aria-label=\"Open page\"` replaced the path, so a screen reader heard forty identical\n * links down the column.\n */\nfunction FeedbackPageLinkCell({ context, openPage }: { context: FeedbackContext | null; openPage: string }) {\n const kitLink = useKitLink();\n const href = feedbackPageHref(context);\n const path = feedbackPagePath(context);\n if (!href || !path) return <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>;\n const className =\n \"inline-flex min-w-0 max-w-full items-center gap-1 text-secondary hover:text-primary hover:underline\";\n const children = (\n <>\n {/* The space outside the hidden span: a flex container drops it from the layout,\n and the accessible name keeps it (\"Open page /accounts\"). */}\n <span className=\"sr-only\">{openPage}</span>{\" \"}\n <code className=\"min-w-0 truncate text-xs\">{path}</code>\n <ExternalLink className=\"size-3 shrink-0\" aria-hidden />\n </>\n );\n const onClick = (event: MouseEvent<HTMLAnchorElement>) => event.stopPropagation();\n const render = pickLinkRenderer<KitLinkProps>(undefined, kitLink, href);\n return render ? (\n <RenderedLink render={render} href={href} className={className} onClick={onClick}>\n {children}\n </RenderedLink>\n ) : (\n <a href={href} className={className} onClick={onClick}>\n {children}\n </a>\n );\n}\n\n/** The provider's link, drawn by a component declared once (as FloatingAction's). */\nfunction RenderedLink({ render, ...props }: KitLinkProps & { render: (props: KitLinkProps) => ReactElement }) {\n return render(props);\n}\n\n/* ── The columns ────────────────────────────────────────────────────────────── */\n\n/** What {@link feedbackColumns} takes — every word already resolved (see\n * {@link useFeedbackColumns}, which resolves them from the provider). */\nexport interface FeedbackColumnsOptions {\n /** `/my-feedback`. The same nine columns (one page component, §4.3), but the status\n * cell is read-only there whatever `canEdit` says — \"no status or outcome editing\n * there (also for an admin)\". */\n mine?: boolean;\n /** The admin on `/feedback` — the status cell offers its steps. Otherwise it shows them\n * read-only. */\n canEdit: boolean;\n /** The undoable status change, `useFeedbackStatusUndo(update.mutate)` (§4.5) — the\n * same one the row detail and the swipes use. */\n onStatus: FeedbackStatusChange;\n /** See {@link FeedbackRenderDate}. */\n renderDate: FeedbackRenderDate;\n /** The status buttons SAVE when pressed: pass `true` to put them under the page's\n * `WriteLockProvider` (FeedbackStatusTransitions' `commit`). Off by default — a\n * feedback inbox is rarely what an app's lock is about. */\n commit?: CommitScope;\n labels: FeedbackPageLabels;\n statusLabels: FeedbackStatusLabels;\n categoryLabels: FeedbackCategoryLabels;\n /** 0.38 (§9.6): a sortable **Votes** column before Status — `row.votes`, a missing\n * one as 0 — hidden on the phone (the card's chip, {@link FeedbackMobileCardProps.votes},\n * carries it there). Off by default. */\n votes?: boolean;\n /** The Votes header — `feedbackPublic.columnVotes`, so the inbox and the public list\n * say the same ({@link useFeedbackColumns} reads it). Default \"Votes\". */\n votesHeader?: string;\n}\n\n/** The vote count, a quiet chip with the thumb (§9.6) — the Votes cell and the card's. */\nfunction FeedbackVoteCount({ votes, className }: { votes: number | undefined; className?: string }) {\n return (\n <Chip size=\"sm\" className={className} data-feedback-vote-count={votes ?? 0}>\n <ThumbsUp className=\"size-3\" aria-hidden />\n <span className=\"tabular-nums\">{votes ?? 0}</span>\n </Chip>\n );\n}\n\n/** A status's place in the chain, unknown ones last (as `feedbackCategoryRank`). */\nfunction statusRank(status: FeedbackStatus): number {\n const at = FEEDBACK_STATUS_ORDER.indexOf(status);\n return at === -1 ? FEEDBACK_STATUS_ORDER.length : at;\n}\n\n/**\n * The nine columns of §4.3, in the contract's order, for `DataTable` — keksdose's\n * (:711–963) with the contract's changes:\n *\n * | # | key | cell | filter | phone |\n * |---|---|---|---|---|\n * | 1 | `id` | id, mono | number | hidden |\n * | 2 | `date` | `created_at`, weekday ({@link FeedbackRenderDate}) | date | |\n * | 3 | `category` | `FeedbackCategoryBadge`, sorted CRASH first | select, all five | |\n * | 4 | `title` | {@link FeedbackSubject} | text: title + environment | card heading |\n * | 5 | `user` | {@link feedbackSubmitter} | text: name + email, or \"deleted user\" | |\n * | 6 | `email` | {@link feedbackSubmitterEmail} | text | hidden |\n * | 7 | `url` | the page, a link (`noRowLink`) | text: path | hidden |\n * | 8 | `status` | `FeedbackStatusTransitions variant=\"icon\"`, `visibleFeedbackStatuses` | select, chain order | |\n * | 9 | `resolved` | `resolved_at` | date | hidden |\n *\n * - Both select filters list the WHOLE vocabulary in its own order, translated —\n * without `options` the popover lists the bare enum values found in the rows\n * (keksdose feedback #160), and kastlan's first CRASH row would otherwise appear in a\n * filter that never offered it.\n * - The status column owns the status filter, and only it (keksdose live #330's revert:\n * the phone's filter sheet already exposes every column filter).\n * - `/my-feedback` shows the same nine: the Email cell's context fallback exists for it\n * (the admin list's join is absent there, §3.1), and its phone card drops the submitter\n * instead ({@link FeedbackMobileCardProps.showSubmitter}).\n *\n * Pure: hand it resolved words, or use {@link useFeedbackColumns}. Keys are stable, so\n * an app may drop or add a column (`columns.filter((c) => c.key !== \"email\")`).\n */\nexport function feedbackColumns<T extends FeedbackTableRow>({\n mine = false,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n votes = false,\n votesHeader = DEFAULT_FEEDBACK_PUBLIC_LABELS.columnVotes,\n}: FeedbackColumnsOptions): DataTableColumn<T>[] {\n const editable = canEdit && !mine;\n const votesColumn: DataTableColumn<T>[] = votes\n ? [\n {\n key: \"votes\",\n header: votesHeader,\n className: \"whitespace-nowrap\",\n cell: (row) => <FeedbackVoteCount votes={row.votes} />,\n sortBy: (row) => row.votes ?? 0,\n filter: { type: \"number\", getValue: (row) => row.votes ?? 0 },\n mobileHidden: true,\n },\n ]\n : [];\n return [\n {\n key: \"id\",\n header: labels.columnId,\n cell: (row) => <span className=\"font-mono text-xs text-muted\">{row.id}</span>,\n sortBy: (row) => row.id,\n filter: { type: \"number\", getValue: (row) => row.id },\n mobileHidden: true,\n },\n {\n key: \"date\",\n header: labels.columnDate,\n cell: (row) => <FeedbackDate value={row.created_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.created_at),\n filter: { type: \"date\", getValue: (row) => row.created_at },\n },\n {\n key: \"category\",\n header: labels.columnCategory,\n cell: (row) => <FeedbackCategoryBadge category={row.category} label={categoryLabels[row.category]} />,\n sortBy: (row) => feedbackCategoryRank(row.category),\n filter: {\n type: \"select\",\n getValue: (row) => row.category,\n options: FEEDBACK_CATEGORY_ORDER.map((value) => ({ value, label: categoryLabels[value] })),\n },\n },\n {\n key: \"title\",\n header: labels.columnSubject,\n cell: (row) => <FeedbackSubject row={row} labels={labels} />,\n sortBy: (row) => row.title,\n // Searchable by the environment too, so \"dev\" narrows to the test copy's reports —\n // a chip you can see but not filter by makes you read every row (keksdose :804).\n filterBy: (row) => {\n const env = feedbackEnvironment(row.context);\n return env ? `${row.title} ${labels.environment(env)}` : row.title;\n },\n mobilePrimary: true,\n },\n {\n key: \"user\",\n header: labels.columnUser,\n cell: (row) => <span className=\"text-secondary\">{feedbackSubmitter(row, labels)}</span>,\n sortBy: (row) => feedbackSubmitter(row, labels),\n // Name AND email, so either finds the person; the erased ones by the placeholder\n // (their context holds no name any more).\n filterBy: (row) =>\n row.user_id == null\n ? labels.deletedUser\n : `${feedbackSubmitter(row, labels)} ${feedbackSubmitterEmail(row)}`,\n },\n {\n key: \"email\",\n header: labels.columnEmail,\n // One line, like the URL beside it: keksdose's `break-all` let the browser squeeze\n // the column to its header and broke every address in two (\"user@exam / ple.test\"),\n // which made every row taller. Unbroken, a resized (pinned) column ellipsises it.\n className: \"whitespace-nowrap\",\n cell: (row) => {\n const email = feedbackSubmitterEmail(row);\n return email ? (\n <span className=\"text-secondary\">{email}</span>\n ) : (\n <span className=\"text-placeholder\">{EMPTY_FORMATTED_VALUE}</span>\n );\n },\n sortBy: feedbackSubmitterEmail,\n filterBy: feedbackSubmitterEmail,\n mobileHidden: true,\n },\n {\n key: \"url\",\n header: labels.columnUrl,\n // A cell only ellipsises what it is told not to wrap (keksdose live #348: the path\n // clipped mid-character \"behind the next column\").\n className: \"whitespace-nowrap\",\n // The cell IS a link, so the row's own permalink must never wrap it (keksdose\n // feedback #451: <a> in <a>, and \"open the page\" silently did nothing).\n noRowLink: true,\n cell: (row) => <FeedbackPageLinkCell context={row.context} openPage={labels.openPage} />,\n sortBy: (row) => feedbackPagePath(row.context) ?? \"\",\n filterBy: (row) => feedbackPagePath(row.context) ?? \"\",\n mobileHidden: true,\n },\n ...votesColumn,\n {\n key: \"status\",\n header: labels.columnStatus,\n // A KNOWN width: at most six 28px icon buttons (from IN_PROGRESS or IN_EVALUATION:\n // one step either way and the three off the chain) — keksdose live #348 sized it\n // for five and the sixth pushed the column wider.\n className: \"w-[13.5rem] whitespace-nowrap\",\n cell: (row) => (\n <FeedbackStatusTransitions\n status={row.status}\n statuses={visibleFeedbackStatuses(row.status)}\n canEdit={editable}\n commit={commit}\n onPick={(status) => onStatus(row, status)}\n variant=\"icon\"\n label={(status) => statusLabels[status]}\n />\n ),\n sortBy: (row) => statusRank(row.status),\n filter: {\n type: \"select\",\n getValue: (row) => row.status,\n options: FEEDBACK_STATUS_ORDER.map((value) => ({ value, label: statusLabels[value] })),\n },\n },\n {\n key: \"resolved\",\n header: labels.columnResolved,\n cell: (row) => <FeedbackDate value={row.resolved_at} renderDate={renderDate} />,\n sortBy: (row) => instant(row.resolved_at),\n filter: { type: \"date\", getValue: (row) => row.resolved_at },\n mobileHidden: true,\n },\n ];\n}\n\n/** What {@link useFeedbackColumns} takes: {@link FeedbackColumnsOptions} with the words\n * read from the provider, and `renderDate` optional. */\nexport interface UseFeedbackColumnsOptions\n extends Omit<FeedbackColumnsOptions, \"renderDate\" | \"labels\" | \"statusLabels\" | \"categoryLabels\" | \"votesHeader\"> {\n /** Default: the kit's date with the weekday ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** Over the `feedbackPage` namespace. Keep it stable (module scope or memoised): it is\n * a dependency of the memo. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * {@link feedbackColumns} with the `feedbackPage`, `feedbackStatus` and\n * `feedbackCategory` words from the provider, memoised on what it reads — pass\n * `update.mutate` through `useFeedbackStatusUndo` (stable) rather than a fresh function\n * per render, or every row's columns are rebuilt on each render (keksdose :667).\n */\nexport function useFeedbackColumns<T extends FeedbackTableRow>({\n mine,\n canEdit,\n onStatus,\n renderDate: renderDateProp,\n commit,\n votes,\n labels: labelsProp,\n}: UseFeedbackColumnsOptions): DataTableColumn<T>[] {\n const labels = useFeedbackPageLabels(labelsProp);\n const statusLabels = useFeedbackStatusLabels();\n const categoryLabels = useFeedbackCategoryLabels();\n const votesHeader = useKitLabels(\"feedbackPublic\", DEFAULT_FEEDBACK_PUBLIC_LABELS).columnVotes;\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return useMemo(\n () =>\n feedbackColumns<T>({\n mine,\n canEdit,\n onStatus,\n renderDate,\n commit,\n labels,\n statusLabels,\n categoryLabels,\n votes,\n votesHeader,\n }),\n [mine, canEdit, onStatus, renderDate, commit, labels, statusLabels, categoryLabels, votes, votesHeader],\n );\n}\n\n/* ── The phone ──────────────────────────────────────────────────────────────── */\n\n/**\n * The phone list's day headers (keksdose feedback #325: the list \"grouped by date, like\n * the transactions list\"): `DataTable mobileGroupBy={feedbackMobileGroupBy(renderDate)}`.\n *\n * The key IS the header — the same string the card's date says. DataTable groups runs of\n * equal keys, so the rows must come newest first, as `GET /feedback` and\n * `GET /feedback/my` send them (§3.3).\n */\nexport function feedbackMobileGroupBy(\n renderDate: FeedbackRenderDate,\n): (row: Pick<FeedbackRecord, \"created_at\">) => string {\n return (row) => renderDate(row.created_at);\n}\n\nexport interface FeedbackMobileCardProps {\n row: FeedbackTableRow;\n /** Add the submitter after the date — the admin inbox (`canEdit`). On `/my-feedback`\n * every row is the viewer's own and the name would repeat down the list. */\n showSubmitter?: boolean;\n /** See {@link FeedbackRenderDate}; the same function as the columns' and the day\n * headers'. Default: the kit's ({@link useFeedbackRenderDate}). */\n renderDate?: FeedbackRenderDate;\n /** 0.38: the vote count as a chip beside the category — with `useFeedbackColumns`'\n * `votes`, whose column the phone hides. */\n votes?: boolean;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * One report as a phone card (§4.3; keksdose :1042, feedback #325 rework: *\"compact card\n * instead of a wasteful label/value row per field\"*): the title with its environment and\n * rework chips and the status badge on one line, then the compact category badge, the\n * date and (admin) the submitter beneath.\n *\n * `DataTable mobileCard={(row) => <FeedbackMobileCard row={row} … />}`. It draws the\n * chips itself: with a `mobileCard`, DataTable never renders the `mobilePrimary` cell,\n * which is how keksdose's cards lost them.\n */\nexport function FeedbackMobileCard({\n row,\n showSubmitter = false,\n renderDate: renderDateProp,\n votes = false,\n labels: labelsProp,\n}: FeedbackMobileCardProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const renderDate = useFeedbackRenderDate(renderDateProp);\n return (\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex items-start justify-between gap-2\">\n <FeedbackSubject row={row} wrap labels={labels} className=\"flex-1\" />\n {/* The pill the desktop status column draws, so a status is the same colour and\n glyph on both layouts. */}\n <FeedbackStatusBadge status={row.status} className=\"shrink-0\" />\n </div>\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted\">\n <FeedbackCategoryBadge category={row.category} compact />\n {votes && <FeedbackVoteCount votes={row.votes} />}\n <FeedbackDate value={row.created_at} renderDate={renderDate} />\n {showSubmitter && (\n // The short id form: \"#7\" says enough on a card that has room for little.\n <span className=\"min-w-0 truncate\">\n · {feedbackSubmitter(row, { deletedUser: labels.deletedUser, userFallback: (id) => `#${id}` })}\n </span>\n )}\n </div>\n </div>\n );\n}\n\nexport interface FeedbackAwaitingToggleProps {\n /** Narrowed to what waits on the triager. Page state, not the URL (keksdose :699): a\n * thumb gesture on one screen, not a view worth linking to. */\n pressed: boolean;\n onPressedChange: (pressed: boolean) => void;\n /** Further `FloatingAction`s, after the toggle — the group is what makes them free. */\n children?: ReactNode;\n /** Default `bottom-end`, the register's corner. */\n corner?: FloatingCorner;\n /** Over the group's default distance from the bottom. */\n offset?: string;\n /** On the group. It is `md:hidden` already: the desktop has the status column's\n * filter, the same question asked where there is room for it. */\n className?: string;\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The phone inbox's one filter button — **\"Only what is waiting for you\"** (§4.3;\n * keksdose live #330 rework: *\"a button that toggles the evaluation items (in evaluation,\n * test when live) as toggle button similar to the show/hide upcoming/scheduled for the tx\n * page\"*).\n *\n * It narrows TO `FEEDBACK_AWAITING_STATUSES` rather than hiding them: after a loop run\n * those ARE the queue — the rows handed back for a verdict — and everything else is\n * history. A `FloatingActionGroup` with one member anyway, in the register's corner and\n * shape (keksdose feedback #58), so a second action costs nothing; the glyph is\n * IN_EVALUATION's own, so the button reads in the vocabulary of the badges it filters on.\n *\n * Admin inbox only: on `/my-feedback` the author is not waiting on their own verdict.\n * The filtering is the page's — `rows.filter((r) => isFeedbackAwaiting(r.status))` —\n * so the table's own filters, sort and URL stay untouched.\n */\nexport function FeedbackAwaitingToggle({\n pressed,\n onPressedChange,\n children,\n corner,\n offset,\n className,\n labels: labelsProp,\n}: FeedbackAwaitingToggleProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n const Icon = FEEDBACK_STATUS_META.IN_EVALUATION.icon;\n return (\n <FloatingActionGroup\n aria-label={labels.phoneActions}\n corner={corner}\n offset={offset}\n className={cn(\"md:hidden\", className)}\n >\n <FloatingAction\n label={labels.awaitingFilter}\n icon={<Icon aria-hidden />}\n pressed={pressed}\n onClick={() => onPressedChange(!pressed)}\n />\n {children}\n </FloatingActionGroup>\n );\n}\n\n/* ── Empty ──────────────────────────────────────────────────────────────────── */\n\nexport interface FeedbackEmptyStateProps {\n /** Over the `feedbackPage` namespace. */\n labels?: LabelOverride<FeedbackPageLabels>;\n}\n\n/**\n * The table with nothing to show (§7.13): the one word **None** / **Keine**, on both\n * pages — keksdose's `empty={t(\"common.none\")}` (`feedback-page.tsx:982`). No hint\n * beneath it: where reports are sent from is the feedback menu's business, and the inbox\n * needs no sentence to say it is empty.\n *\n * For `DataTable empty`, which sits in a centred, muted cell — so no box of its own.\n * keksdose passes it unconditionally, so a filter (or the awaiting toggle) that leaves\n * nothing says \"None\" too: `empty={<FeedbackEmptyState />}`.\n */\nexport function FeedbackEmptyState({ labels: labelsProp }: FeedbackEmptyStateProps) {\n const labels = useFeedbackPageLabels(labelsProp);\n return <span data-feedback-empty=\"\">{labels.empty}</span>;\n}\n"],"mappings":";AA6PqB,SA4CjB,UA5CiB,KA4CjB,YA5CiB;AA7PrB,SAAS,eAAe;AAExB,SAAS,cAAc,gBAAgB;AACvC,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB,YAAY,cAAc;AAC1D,SAAS,qBAAqB,cAAc,YAAY,oBAAwC;AAEhG,SAAS,YAAY;AACrB,SAAS,gBAAgB,2BAA2B;AAEpD,SAAS,wBAAwB;AAEjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,4BAA4B,mBAA8D;AAEnG,SAAS,kBAAkB,wBAAwB;AAEnD,SAAS,oCAAoC;AAC7C,SAAS,sCAAsC;AA6FxC,SAAS,sBAAsB,QAAgE;AACpG,SAAO,aAAa,gBAAgB,8BAA8B,MAAM;AAC1E;AAuBA,SAAS,KAAK,OAAwB;AACpC,SAAO,OAAO,UAAU,WAAW,MAAM,KAAK,IAAI;AACpD;AAUO,SAAS,oBAAoB,SAA4D;AAC9F,QAAM,MAAM,KAAK,SAAS,WAAW;AACrC,SAAO,CAAC,OAAO,IAAI,YAAY,MAAM,SAAS,OAAO;AACvD;AASO,SAAS,kBACd,KACA,QACQ;AACR,MAAI,IAAI,WAAW,KAAM,QAAO,OAAO;AACvC,SACE,KAAK,IAAI,SAAS,iBAAiB,KACnC,KAAK,IAAI,UAAU,KACnB,KAAK,IAAI,SAAS,UAAU,KAC5B,OAAO,aAAa,IAAI,OAAO;AAEnC;AAQO,SAAS,uBAAuB,KAAyE;AAC9G,MAAI,IAAI,WAAW,KAAM,QAAO;AAChC,SAAO,KAAK,IAAI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back-comment-thread.js";
2
+ import type { FeedbackRepliesLabels } from "./feedback-replies.js";
3
+ import type { FeedbackVoteLabels } from "./feedback-vote-button.js";
4
+ export declare const DEFAULT_FEEDBACK_VOTE_LABELS: FeedbackVoteLabels;
5
+ export declare const DEFAULT_FEEDBACK_REPLIES_LABELS: FeedbackRepliesLabels;
6
+ export declare const DEFAULT_FEEDBACK_COMMENTS_LABELS: FeedbackCommentsLabels;
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ const DEFAULT_FEEDBACK_VOTE_LABELS = {
3
+ vote: "I want this too",
4
+ own: "Your report"
5
+ };
6
+ const DEFAULT_FEEDBACK_REPLIES_LABELS = {
7
+ replies: "Replies",
8
+ empty: "No reply yet",
9
+ admin: "Admin",
10
+ statusChanged: "Status changed to",
11
+ field: "Write a reply",
12
+ placeholder: "Write a reply\u2026",
13
+ reply: "Reply",
14
+ status: "Status with the reply",
15
+ noChange: "No change",
16
+ nudge: "The author has not been told. Add a reply."
17
+ };
18
+ const DEFAULT_FEEDBACK_COMMENTS_LABELS = {
19
+ comments: "Comments",
20
+ empty: "No comments yet",
21
+ hidden: "Hidden by an admin",
22
+ hide: "Hide",
23
+ unhide: "Unhide",
24
+ delete: "Delete",
25
+ deleteTitle: "Delete this comment?",
26
+ deleteBody: "It is removed for everyone. This cannot be undone.",
27
+ field: "Write a comment",
28
+ placeholder: "Write a comment\u2026",
29
+ send: "Comment"
30
+ };
31
+ export {
32
+ DEFAULT_FEEDBACK_COMMENTS_LABELS,
33
+ DEFAULT_FEEDBACK_REPLIES_LABELS,
34
+ DEFAULT_FEEDBACK_VOTE_LABELS
35
+ };
36
+ //# sourceMappingURL=feedback-thread-parts-labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/feedback/feedback-thread-parts-labels.ts"],"sourcesContent":["// The English words of round 0.38's thread parts — ./feedback-vote-button,\n// ./feedback-comment-thread and ./feedback-replies — in a module with no component code:\n// the English catalogue (src/i18n/defaults.ts) imports them without the components, so\n// `en` loads as one chunk like the other languages (0.34, KS U8). Each component module\n// re-exports its own.\n\nimport type { FeedbackCommentsLabels } from \"./feedback-comment-thread\";\nimport type { FeedbackRepliesLabels } from \"./feedback-replies\";\nimport type { FeedbackVoteLabels } from \"./feedback-vote-button\";\n\nexport const DEFAULT_FEEDBACK_VOTE_LABELS: FeedbackVoteLabels = {\n vote: \"I want this too\",\n own: \"Your report\",\n};\n\nexport const DEFAULT_FEEDBACK_REPLIES_LABELS: FeedbackRepliesLabels = {\n replies: \"Replies\",\n empty: \"No reply yet\",\n admin: \"Admin\",\n statusChanged: \"Status changed to\",\n field: \"Write a reply\",\n placeholder: \"Write a reply…\",\n reply: \"Reply\",\n status: \"Status with the reply\",\n noChange: \"No change\",\n nudge: \"The author has not been told. Add a reply.\",\n};\n\nexport const DEFAULT_FEEDBACK_COMMENTS_LABELS: FeedbackCommentsLabels = {\n comments: \"Comments\",\n empty: \"No comments yet\",\n hidden: \"Hidden by an admin\",\n hide: \"Hide\",\n unhide: \"Unhide\",\n delete: \"Delete\",\n deleteTitle: \"Delete this comment?\",\n deleteBody: \"It is removed for everyone. This cannot be undone.\",\n field: \"Write a comment\",\n placeholder: \"Write a comment…\",\n send: \"Comment\",\n};\n"],"mappings":";AAUO,MAAM,+BAAmD;AAAA,EAC9D,MAAM;AAAA,EACN,KAAK;AACP;AAEO,MAAM,kCAAyD;AAAA,EACpE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,eAAe;AAAA,EACf,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AACT;AAEO,MAAM,mCAA2D;AAAA,EACtE,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AACR;","names":[]}
@@ -90,6 +90,14 @@ export interface FeedbackThreadMessage {
90
90
  own?: boolean;
91
91
  /** Written by the team rather than a user: gets the "Staff" badge. */
92
92
  staff?: boolean;
93
+ /** 0.38: beside the author and time — a reply's "→ Done" status chip. Not
94
+ * `data-private`: it is the app's, not somebody's words. */
95
+ badge?: ReactNode;
96
+ /** 0.38: the body struck through and muted — a hidden comment as its admin sees it. */
97
+ struck?: boolean;
98
+ /** 0.38: under the body — a note ("Hidden by an admin") and the message's actions
99
+ * (Hide, Delete). Not `data-private`. */
100
+ footer?: ReactNode;
93
101
  }
94
102
  /**
95
103
  * A line in the thread that nobody wrote — "Closed automatically", "Marked as
@@ -108,6 +108,7 @@ function FeedbackThread({
108
108
  /* @__PURE__ */ jsxs("header", { className: "mb-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-caption text-muted", children: [
109
109
  author != null && /* @__PURE__ */ jsx("span", { "data-private": priv, className: "font-medium text-secondary", children: author }),
110
110
  message.staff && /* @__PURE__ */ jsx("span", { className: "rounded border border-subtle bg-surface px-1 text-micro font-medium uppercase tracking-wide text-secondary", children: labels.staff }),
111
+ message.badge,
111
112
  time
112
113
  ] }),
113
114
  message.body && /* @__PURE__ */ jsx(
@@ -115,11 +116,15 @@ function FeedbackThread({
115
116
  {
116
117
  "data-private": priv,
117
118
  dir: "auto",
118
- className: "whitespace-pre-wrap break-words text-start text-primary",
119
+ className: cn(
120
+ "whitespace-pre-wrap break-words text-start",
121
+ message.struck ? "text-muted line-through" : "text-primary"
122
+ ),
119
123
  children: message.body
120
124
  }
121
125
  ),
122
- attachments.length > 0 && /* @__PURE__ */ jsx("ul", { "aria-label": labels.attachments, "data-private": priv, className: "mt-2 flex flex-wrap gap-2", children: attachments.map((attachment, index2) => /* @__PURE__ */ jsx("li", { className: "min-w-0", children: renderAttachment ? renderAttachment(attachment, message) : /* @__PURE__ */ jsx(DefaultAttachment, { attachment, size: file.size }) }, attachment.id ?? `${index2}-${attachment.name}`)) })
126
+ attachments.length > 0 && /* @__PURE__ */ jsx("ul", { "aria-label": labels.attachments, "data-private": priv, className: "mt-2 flex flex-wrap gap-2", children: attachments.map((attachment, index2) => /* @__PURE__ */ jsx("li", { className: "min-w-0", children: renderAttachment ? renderAttachment(attachment, message) : /* @__PURE__ */ jsx(DefaultAttachment, { attachment, size: file.size }) }, attachment.id ?? `${index2}-${attachment.name}`)) }),
127
+ message.footer != null && /* @__PURE__ */ jsx("div", { className: "mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-caption text-muted", children: message.footer })
123
128
  ]
124
129
  }
125
130
  )