@eifi1/ui-kit 0.38.0 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint/index.js +1 -1
- package/dist/feedback/feedback-comment-thread.d.ts +13 -6
- package/dist/feedback/feedback-comment-thread.js +10 -2
- package/dist/feedback/feedback-comment-thread.js.map +1 -1
- package/dist/feedback/feedback-labels.d.ts +11 -0
- package/dist/feedback/feedback-labels.js +4 -1
- package/dist/feedback/feedback-labels.js.map +1 -1
- package/dist/feedback/feedback-public-labels.d.ts +3 -0
- package/dist/feedback/feedback-public-labels.js +2 -1
- package/dist/feedback/feedback-public-labels.js.map +1 -1
- package/dist/feedback/feedback-public-list.d.ts +25 -4
- package/dist/feedback/feedback-public-list.js +54 -3
- package/dist/feedback/feedback-public-list.js.map +1 -1
- package/dist/feedback/feedback-public-switch.js +3 -3
- package/dist/feedback/feedback-public-switch.js.map +1 -1
- package/dist/feedback/feedback-record.d.ts +7 -7
- package/dist/feedback/feedback-record.js.map +1 -1
- package/dist/feedback/feedback-replies-context.d.ts +7 -0
- package/dist/feedback/feedback-replies-context.js +7 -0
- package/dist/feedback/feedback-replies-context.js.map +1 -0
- package/dist/feedback/feedback-row-detail.d.ts +12 -3
- package/dist/feedback/feedback-row-detail.js +2 -1
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-table.js +2 -2
- package/dist/feedback/feedback-table.js.map +1 -1
- package/dist/feedback/feedback-vote-button.d.ts +2 -1
- package/dist/feedback/feedback-vote-button.js.map +1 -1
- package/dist/i18n/german.js +6 -2
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/locales/en.js +8 -3
- package/dist/i18n/locales/en.js.map +2 -2
- package/dist/i18n/locales/es.js +6 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +6 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +6 -2
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +6 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +6 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.js +1 -0
- package/dist/i18n/review.js.map +1 -1
- package/package.json +1 -1
- package/src/feedback/feedback-comment-thread.tsx +29 -7
- package/src/feedback/feedback-labels.ts +14 -0
- package/src/feedback/feedback-public-labels.ts +4 -0
- package/src/feedback/feedback-public-list.tsx +88 -5
- package/src/feedback/feedback-public-switch.tsx +3 -3
- package/src/feedback/feedback-record.ts +7 -7
- package/src/feedback/feedback-replies-context.ts +9 -0
- package/src/feedback/feedback-row-detail.tsx +16 -4
- package/src/feedback/feedback-table.tsx +2 -2
- package/src/feedback/feedback-vote-button.tsx +2 -1
- package/src/i18n/german.ts +4 -0
- package/src/i18n/locales/en.ts +1 -0
- package/src/i18n/locales/es.ts +4 -0
- package/src/i18n/locales/fr.ts +4 -0
- package/src/i18n/locales/hu.ts +4 -0
- package/src/i18n/locales/it.ts +4 -0
- package/src/i18n/locales/zh.ts +4 -0
- package/src/i18n/review.ts +1 -0
|
@@ -108,20 +108,20 @@ export interface FeedbackRecord {
|
|
|
108
108
|
/** The admin: the full name; the author: their own; `null`: none to show. */
|
|
109
109
|
author_name?: string | null;
|
|
110
110
|
/** The viewer filed it. */
|
|
111
|
-
mine?: boolean;
|
|
111
|
+
mine?: boolean | null;
|
|
112
112
|
/** Visible to the app's other users (§9.3); never on a CRASH. */
|
|
113
|
-
public?: boolean;
|
|
113
|
+
public?: boolean | null;
|
|
114
114
|
/** Made public by the 0.38 migration: the author may switch it off at any status. */
|
|
115
|
-
filed_private?: boolean;
|
|
115
|
+
filed_private?: boolean | null;
|
|
116
116
|
/** People who want this (the author's own vote included, §9.6). */
|
|
117
|
-
votes?: number;
|
|
117
|
+
votes?: number | null;
|
|
118
118
|
/** The viewer's vote. */
|
|
119
|
-
voted?: boolean;
|
|
119
|
+
voted?: boolean | null;
|
|
120
120
|
/** Comments (an admin's count includes hidden ones). */
|
|
121
|
-
comment_count?: number;
|
|
121
|
+
comment_count?: number | null;
|
|
122
122
|
/** The admin's answers, oldest first (§9.7). Absent: a server before 0.38 — read
|
|
123
123
|
* `outcome` instead. */
|
|
124
|
-
replies?: FeedbackReply[];
|
|
124
|
+
replies?: FeedbackReply[] | null;
|
|
125
125
|
}
|
|
126
126
|
/** The image types `FeedbackAttachmentField` takes when `accept` is not given. */
|
|
127
127
|
export declare const DEFAULT_ATTACHMENT_ACCEPT: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/feedback/feedback-record.ts"],"sourcesContent":["import { FEEDBACK_CATEGORY_ORDER } from \"./feedback-vocabulary\";\nimport type { FeedbackCategory, FeedbackStatus } from \"./feedback-vocabulary\";\nimport type { FeedbackReply } from \"./feedback-public-types\";\n\n/**\n * One feedback report as the three apps send it, and the facts the kit reads off it.\n *\n * Until 0.27 the inbox parts took no report at all (\"no `Feedback` type in this file\",\n * feedback-inbox.tsx): keksdose kept its reporter context in a JSON column, kastlan a\n * thinner copy of it, Kurvenschmiede a `page_path` and the bytes in the row. Marcel's\n * feedback round (2026-10-04, docs/feedback-harmonization.md) settled one API contract\n * for all three — keksdose's, read off its code — so the apps now share one shape and the\n * kit can take a row instead of a dozen loose values. This file is that shape (§3.1,\n * §3.2), the contract's constants (§3.4, §3.5, §4.3) and the readers and writers of the\n * one field whose format is itself contract: the body, which carries the rework rounds\n * (§3.4) — lifted from keksdose `frontend/src/features/feedback/body-attachments.ts`.\n *\n * Plain functions and data, no components: everything here is as usable from a loop\n * script's helper or a test as from a page.\n */\n\n/* ── The resource (§3.1, §3.2) ────────────────────────────────────────────── */\n\n/** Which copy of an app a report came from — keksdose `app/deploy-environment.ts`.\n * Any other string is read as \"not prod\" (the admin list shows it upper-cased as a\n * chip, §4.3), so an app with a `staging` loses nothing. */\nexport type FeedbackEnvironment = \"prod\" | \"dev\" | \"local\";\n\n/**\n * The reporter's context, written by the submit dialog (keksdose\n * `use-feedback-dialog.tsx:105`) — §3.2 of the contract.\n *\n * **Every key is optional on read**, and a reader treats a missing one as \"unknown\":\n * kastlan's client sends six of them (no email, no version), Kurvenschmiede's old rows are\n * backfilled from two columns with a path-only `url`, crash rows add their own (and\n * `origin` / `environment` from the crash payload, §3.6 — older crash rows have neither),\n * and an erased account's row keeps only an allow-list (§3.2: `environment` stays,\n * `origin` goes). Extra keys are allowed — a server may add its own — hence the index\n * signature.\n */\nexport interface FeedbackContext {\n /** The full `location.href` at open time; `\"\"` when \"Attach current page URL\" was off.\n * Readers also accept a path-only value (Kurvenschmiede's backfilled rows). */\n url?: string;\n /** Its pathname; `\"\"` when the URL was withheld. */\n route?: string;\n /** `location.origin` — which copy of the app, not personal; never withheld. */\n origin?: string;\n /** {@link FeedbackEnvironment}, or whatever the app calls its other copies. */\n environment?: FeedbackEnvironment | (string & {});\n /** The submitter, as a snapshot. The server should overwrite the three `user_*` keys\n * from the session (Kurvenschmiede does), so nobody files in someone else's name. */\n user_id?: number | null;\n user_email?: string | null;\n user_display_name?: string | null;\n /** `\"406x816\"`. */\n viewport?: string;\n /** `navigator.userAgent`. */\n ua?: string;\n /** The app build (`__APP_VERSION__`). */\n version?: string;\n // Crash rows (server-written, keksdose `feedback_service.py:346`).\n fingerprint?: string;\n /** Which error boundary caught it. */\n boundary?: \"app\" | \"page\" | (string & {});\n online?: boolean;\n occurrences?: number;\n first_seen_at?: string;\n last_seen_at?: string;\n auto_reported?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * One report — `FeedbackResponse`, keksdose `schemas/feedback.py:117`, §3.1 of the\n * contract. What `GET /feedback`, `GET /feedback/my`, `POST /feedback` and\n * `PATCH /feedback/{id}` answer in all three apps.\n *\n * Extra fields are allowed and ignored (kastlan's `company_id`, `user_name`): an app's\n * own row type with more fields is assignable to this one as it stands.\n *\n * There is **no rework counter field** — {@link reworkCount} reads it off the body, so\n * nothing can forget to set it.\n */\nexport interface FeedbackRecord {\n id: number;\n /** `null`: the author's account was erased (keksdose live #275). */\n user_id: number | null;\n /** The admin list only (joined); `null` — or absent — on `/my`, create and update. */\n user_email?: string | null;\n /** 1–255 characters, never blank. */\n title: string;\n /** `\"\"` when none. Rework rounds are appended here (§3.4) — read it with\n * {@link splitDescription} / {@link splitBodyAttachments}, write it with\n * {@link appendRework} / {@link replaceDescription}. */\n body: string;\n category: FeedbackCategory;\n status: FeedbackStatus;\n /** §3.2; `null` on rows that have none. */\n context: FeedbackContext | null;\n /** The ONE captured screenshot's attachment URL, or `null`. */\n screenshot_url: string | null;\n /** Up to 5 other files; `null` = none. Optional because a server older than the\n * column sends no key at all (keksdose dev #578 met exactly that). */\n attachment_urls?: string[] | null;\n /** The team's answer; `null` = none written. **Frozen since 0.38** (§9.7): answered\n * as stored for one release, written by nothing, then dropped — the answer is\n * {@link FeedbackRecord.replies} now. */\n outcome: string | null;\n /** Set on ENTERING `DONE` / `WONT_DO`, cleared on leaving them. ISO 8601. */\n resolved_at: string | null;\n /** ISO 8601. */\n created_at: string;\n /** ISO 8601. */\n updated_at: string;\n // ── Round 0.38 (§9.3): all optional, so an app without public parts sends none. ──\n /** The admin: the full name; the author: their own; `null`: none to show. */\n author_name?: string | null;\n /** The viewer filed it. */\n mine?: boolean;\n /** Visible to the app's other users (§9.3); never on a CRASH. */\n public?: boolean;\n /** Made public by the 0.38 migration: the author may switch it off at any status. */\n filed_private?: boolean;\n /** People who want this (the author's own vote included, §9.6). */\n votes?: number;\n /** The viewer's vote. */\n voted?: boolean;\n /** Comments (an admin's count includes hidden ones). */\n comment_count?: number;\n /** The admin's answers, oldest first (§9.7). Absent: a server before 0.38 — read\n * `outcome` instead. */\n replies?: FeedbackReply[];\n}\n\n/* ── Constants (§3.4, §3.5, §4.3) ─────────────────────────────────────────── */\n\n// The attachment field's three defaults live here, not in feedback-attachment.tsx\n// (which re-exports them), since 0.34 (MOD-1, refactor audit 2026-10). This module is in\n// every app's top bar (the menu's categories), and FEEDBACK_ATTACHMENT_ACCEPT below is\n// built on DEFAULT_ATTACHMENT_ACCEPT: imported from the field's module, it tied the top\n// bar to the field, the lazily loaded dialog's heaviest part, for three values.\n\n/** The image types `FeedbackAttachmentField` takes when `accept` is not given. */\nexport const DEFAULT_ATTACHMENT_ACCEPT = [\"image/png\", \"image/jpeg\", \"image/webp\", \"image/gif\"];\n/** 10 MB, the contract's size limit for one file (§3.5). */\nexport const DEFAULT_MAX_ATTACHMENT_BYTES = 10 * 1024 * 1024;\n/** How many files `<FeedbackAttachmentField multiple>` takes when `max` is not given\n * (0.15.5). Five photos of one problem is already a lot to look through; a report\n * that needs more is a conversation, which the thread is for. */\nexport const DEFAULT_MAX_ATTACHMENTS = 5;\n\n/**\n * What a report may carry (§3.5, keksdose `upload_guards.py:197` and its\n * `attachment-options.ts`): the kit's four image types plus a PDF and a plain-text log\n * (keksdose feedback #87). SVG and HTML stay out — both are script-carrying documents in\n * an image's clothing. For `FeedbackAttachmentField` / `FeedbackDialog`'s `accept`, with\n * `DEFAULT_MAX_ATTACHMENTS` (5) and `DEFAULT_MAX_ATTACHMENT_BYTES` (10 MB) above, which\n * already are the contract's limits.\n *\n * A plain array (not frozen) because `accept` takes `string[]`, as\n * `DEFAULT_ATTACHMENT_ACCEPT` does — copy it before changing it.\n */\nexport const FEEDBACK_ATTACHMENT_ACCEPT: string[] = [\n ...DEFAULT_ATTACHMENT_ACCEPT,\n \"application/pdf\",\n \"text/plain\",\n];\n\n/**\n * The categories a person can pick — every one but `CRASH`, in triage order (Bug, Idea,\n * Question, Other: the feedback menu's rows, §4.1). `CRASH` is filed by an error boundary\n * and the server refuses it by hand with a 422 (keksdose `_reject_manual_crash`), so no\n * picker may offer it.\n */\nexport const FEEDBACK_PICKABLE_CATEGORIES: readonly FeedbackCategory[] = Object.freeze(\n FEEDBACK_CATEGORY_ORDER.filter((category) => category !== \"CRASH\"),\n);\n\n/**\n * The statuses a report can be sent back for **rework** from (§3.4): everything the team\n * has answered — `IN_EVALUATION`, `NEEDS_LIVE_TEST`, `POSTPONED`, `DONE`, `WONT_DO`. On\n * these the server reopens the row when the body grows by a rework block; on `OPEN`,\n * `READY` and `IN_PROGRESS` there is nothing to send back yet.\n */\nexport const FEEDBACK_REWORKABLE_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"IN_EVALUATION\",\n \"NEEDS_LIVE_TEST\",\n \"POSTPONED\",\n \"DONE\",\n \"WONT_DO\",\n] as const);\n\n/**\n * The statuses in which the AUTHOR may still edit title, body and category (§3.4,\n * keksdose `canAuthorEdit`, `feedback-page.tsx:398`): `OPEN`, `READY` and `IN_PROGRESS`.\n * Once the team has answered, the description is what they answered and stays as it\n * was; a correction goes in as a rework.\n */\nexport const FEEDBACK_AUTHOR_EDITABLE_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"OPEN\",\n \"READY\",\n \"IN_PROGRESS\",\n] as const);\n\n/**\n * The statuses that wait on the person triaging: filed and not yet triaged (`OPEN`,\n * since READY took over \"released for implementation\" in 0.31, feedback contract §8.2),\n * answered and handed back for a verdict, or answered and only checkable on a deployed\n * build (keksdose `AWAITING_VERDICT`, live #330). The phone's \"Only what is waiting for\n * you\" toggle narrows the inbox to exactly these (§4.3).\n */\nexport const FEEDBACK_AWAITING_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"OPEN\",\n \"IN_EVALUATION\",\n \"NEEDS_LIVE_TEST\",\n] as const);\n\n/**\n * The **decided** statuses (§9.7, decision 13): `DONE`, `WONT_DO`, `POSTPONED`. A\n * status-only move into one tells the author nothing (a status alone sends no\n * notification), so the row detail nudges the admin toward a reply until one with that\n * `status_to` exists.\n */\nexport const FEEDBACK_DECIDED_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"DONE\",\n \"WONT_DO\",\n \"POSTPONED\",\n] as const);\n\n/** A comment's longest body after trimming (§9.8). */\nexport const FEEDBACK_COMMENT_MAX = 4000;\n/** A reply's longest body after trimming (§9.7). */\nexport const FEEDBACK_REPLY_MAX = 8000;\n\n/* ── The body (§3.4) ──────────────────────────────────────────────────────── */\n\n/**\n * The path every app serves attachments under (§3.3), and a key after it. Keys are\n * OPAQUE (§3.5): keksdose and Kurvenschmiede content-address (`<sha12>.<ext>`), kastlan's\n * storage keys are `<uuid32>_<sha12>.<ext>` — so `[\\w.-]+`, never a fixed hex shape.\n */\nconst ATTACHMENT_URL = /^\\/api\\/v1\\/feedback\\/attachments\\/[\\w.-]+$/;\n\n/**\n * One file line in a body. The marker is deliberately narrow — this path and nothing\n * else, alone on its line — so no sentence a user writes can be mistaken for one\n * (keksdose live #291). It says `[screenshot]` for a PDF or a text log too: the name is\n * history, the format is contract.\n */\nconst ATTACHMENT_LINE = /^\\[screenshot\\]\\s+(\\/api\\/v1\\/feedback\\/attachments\\/[\\w.-]+)\\s*$/;\n\n/**\n * The `--- REWORK <stamp> ---` rule a rework opens with. Anchored and whole-line for the\n * same reason as the file marker: \"I did a REWORK --- honestly\" is a sentence, not a\n * round. kastlan's folded `--- COMMENT <stamp> · <name> ---` blocks (§7.7) never match.\n */\nconst REWORK_RULE = /^---\\s*REWORK\\b.*---$/;\n\n/** Any appended block's opening rule: a rework round, or a kastlan comment folded into\n * the body by its one-time migration (§7.7). */\nconst BLOCK_RULE = /^---\\s*(?:REWORK|COMMENT)\\b.*---$/;\n\n/** The body line for one uploaded attachment — what {@link appendRework} writes under\n * the note. */\nexport function feedbackAttachmentLine(url: string): string {\n return `[screenshot] ${url}`;\n}\n\n/**\n * A rework round appended to a body — the exact text `PATCH /feedback/{id}` takes as the\n * new `body` (§3.4; keksdose `submitRework`, `feedback-page.tsx:350`):\n *\n * ```text\n * <old body>\\n\\n--- REWORK 2026-10-04 09:12 ---\\n<note>\\n[screenshot] /api/v1/feedback/attachments/<key>\n * ```\n *\n * - The stamp is UTC, `YYYY-MM-DD HH:MM` (`toISOString().slice(0, 16)`), from `now`.\n * - The old body is kept byte for byte, so the result STRICTLY EXTENDS it — which is\n * how the server recognises an append and reopens an answered row (keksdose\n * `_is_rework_append`, live #331). `\\n\\n` is left out when the old body is `\"\"`.\n * - ONE file per round (`url`), uploaded first by the caller: a body appended without\n * it would be a rework whose evidence never arrived.\n *\n * **Returns `null` when the trimmed note is empty** — a file alone cannot be sent\n * (keksdose `:577`). Null rather than a throw because an empty note is something a\n * person does, not a bug, and the type then makes every caller decide what an empty\n * box means before anything can reach the PATCH.\n *\n * **Throws a `TypeError` when `url` is not an attachment URL** of the contract's shape\n * (`/api/v1/feedback/attachments/<key>`): that one IS a bug — the upload handed back\n * something foreign — and written anyway it would sit in the body as prose that no\n * reader recognises as a file.\n */\nexport function appendRework(\n body: string,\n note: string,\n url?: string | null,\n now: Date = new Date(),\n): string | null {\n const text = note.trim();\n if (!text) return null;\n if (url && !ATTACHMENT_URL.test(url)) {\n throw new TypeError(`appendRework: not a feedback attachment URL: ${url}`);\n }\n const stamp = now.toISOString().slice(0, 16).replace(\"T\", \" \");\n const block = `--- REWORK ${stamp} ---\\n${url ? `${text}\\n${feedbackAttachmentLine(url)}` : text}`;\n return body ? `${body}\\n\\n${block}` : block;\n}\n\n/**\n * How many times a report has been sent back — the count of `--- REWORK … ---` rule\n * lines in its body (keksdose live #331: the \"category for items in rework\", derived\n * rather than stored, so nothing can forget to set it or leave it set). Folded kastlan\n * comments do not count.\n */\nexport function reworkCount(body: string): number {\n let n = 0;\n for (const line of body.split(\"\\n\")) if (REWORK_RULE.test(line.trim())) n += 1;\n return n;\n}\n\n/**\n * A body split into the prose to render and the files to show beside it, in body order.\n *\n * The file lines are stripped from the text: they are a location, not something anybody\n * wrote, and left in they would put a raw URL in the middle of a sentence. Trailing blank\n * lines go (what a stripped marker leaves at the end of a note); every blank line between\n * paragraphs stays.\n */\nexport function splitBodyAttachments(body: string): { text: string; urls: string[] } {\n const urls: string[] = [];\n const kept: string[] = [];\n for (const line of body.split(\"\\n\")) {\n const match = ATTACHMENT_LINE.exec(line.trim());\n if (match) urls.push(match[1]);\n else kept.push(line);\n }\n return { text: kept.join(\"\\n\").replace(/\\n+$/, \"\"), urls };\n}\n\n/** A body cut where its first appended block begins. */\nfunction cutAtFirstBlock(body: string): { head: string; appended: string } {\n const lines = body.split(\"\\n\");\n const at = lines.findIndex((line) => BLOCK_RULE.test(line.trim()));\n if (at === -1) return { head: body, appended: \"\" };\n return { head: lines.slice(0, at).join(\"\\n\"), appended: lines.slice(at).join(\"\\n\") };\n}\n\n/**\n * The ORIGINAL description, apart from everything appended to it since (§4.4.1).\n *\n * - `description` — what the author wrote when filing, without its file lines and\n * trailing blank lines: the text the \"Edit description\" editor holds.\n * - `appended` — every `--- REWORK … ---` round and folded `--- COMMENT … ---` block,\n * from the first one's rule line to the end, verbatim (`\"\"` when there are none).\n *\n * keksdose's editor edits the raw body (`initial={fb.body}`, `feedback-page.tsx:420`), so\n * an author tidying a typo could delete the rework history and the file lines with it.\n * The kit's editor holds `description` only and saves through\n * {@link replaceDescription}, which puts the rest back unchanged.\n */\nexport function splitDescription(body: string): { description: string; appended: string } {\n const { head, appended } = cutAtFirstBlock(body);\n return { description: splitBodyAttachments(head).text, appended };\n}\n\n/**\n * The body with its original description replaced and everything else kept — the file\n * lines of the original part (after the new text, in their order) and the appended\n * blocks (verbatim, after a blank line). The new text is trimmed; clearing it saves the\n * rest alone (`\"\"` when there is no rest).\n *\n * `replaceDescription(body, splitDescription(body).description)` gives back a canonical\n * body unchanged — a trimmed description, then each block after one blank line, as the\n * dialog and {@link appendRework} write them.\n */\nexport function replaceDescription(body: string, description: string): string {\n const { head, appended } = cutAtFirstBlock(body);\n const files = splitBodyAttachments(head).urls.map(feedbackAttachmentLine);\n const text = description.trim();\n const top = [...(text ? [text] : []), ...files].join(\"\\n\");\n if (!appended) return top;\n return top ? `${top}\\n\\n${appended}` : appended;\n}\n\n/**\n * Whether an attachment URL is a picture (keksdose dev #578). The upload route takes\n * PDFs and text logs too and serves them as downloads, never inline, so an `<img>` on\n * one shows a broken icon. The key's extension is the server's own statement of the\n * type (minted from the sniffed content), so it is the thing to read.\n */\nexport function isImageAttachment(url: string): boolean {\n return /\\.(png|jpe?g|webp|gif)$/i.test(url);\n}\n\n/** The file name an attachment downloads as — its key, the last segment of the URL. */\nexport function attachmentName(url: string): string {\n return url.slice(url.lastIndexOf(\"/\") + 1);\n}\n"],"mappings":";AAAA,SAAS,+BAA+B;AAgJjC,MAAM,4BAA4B,CAAC,aAAa,cAAc,cAAc,WAAW;AAEvF,MAAM,+BAA+B,KAAK,OAAO;AAIjD,MAAM,0BAA0B;AAahC,MAAM,6BAAuC;AAAA,EAClD,GAAG;AAAA,EACH;AAAA,EACA;AACF;AAQO,MAAM,+BAA4D,OAAO;AAAA,EAC9E,wBAAwB,OAAO,CAAC,aAAa,aAAa,OAAO;AACnE;AAQO,MAAM,+BAA0D,OAAO,OAAO;AAAA,EACnF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAQH,MAAM,oCAA+D,OAAO,OAAO;AAAA,EACxF;AAAA,EACA;AAAA,EACA;AACF,CAAU;AASH,MAAM,6BAAwD,OAAO,OAAO;AAAA,EACjF;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAQH,MAAM,4BAAuD,OAAO,OAAO;AAAA,EAChF;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAGH,MAAM,uBAAuB;AAE7B,MAAM,qBAAqB;AASlC,MAAM,iBAAiB;AAQvB,MAAM,kBAAkB;AAOxB,MAAM,cAAc;AAIpB,MAAM,aAAa;AAIZ,SAAS,uBAAuB,KAAqB;AAC1D,SAAO,gBAAgB,GAAG;AAC5B;AA2BO,SAAS,aACd,MACA,MACA,KACA,MAAY,oBAAI,KAAK,GACN;AACf,QAAM,OAAO,KAAK,KAAK;AACvB,MAAI,CAAC,KAAM,QAAO;AAClB,MAAI,OAAO,CAAC,eAAe,KAAK,GAAG,GAAG;AACpC,UAAM,IAAI,UAAU,gDAAgD,GAAG,EAAE;AAAA,EAC3E;AACA,QAAM,QAAQ,IAAI,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AA6B;AAC5E,QAAM,EAAE,MAAM,SAAS,IAAI,gBAAgB,IAAI;AAC/C,QAAM,QAAQ,qBAAqB,IAAI,EAAE,KAAK,IAAI,sBAAsB;AACxE,QAAM,OAAO,YAAY,KAAK;AAC9B,QAAM,MAAM,CAAC,GAAI,OAAO,CAAC,IAAI,IAAI,CAAC,GAAI,GAAG,KAAK,EAAE,KAAK,IAAI;AACzD,MAAI,CAAC,SAAU,QAAO;AACtB,SAAO,MAAM,GAAG,GAAG;AAAA;AAAA,EAAO,QAAQ,KAAK;AACzC;AAQO,SAAS,kBAAkB,KAAsB;AACtD,SAAO,2BAA2B,KAAK,GAAG;AAC5C;AAGO,SAAS,eAAe,KAAqB;AAClD,SAAO,IAAI,MAAM,IAAI,YAAY,GAAG,IAAI,CAAC;AAC3C;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/feedback/feedback-record.ts"],"sourcesContent":["import { FEEDBACK_CATEGORY_ORDER } from \"./feedback-vocabulary\";\nimport type { FeedbackCategory, FeedbackStatus } from \"./feedback-vocabulary\";\nimport type { FeedbackReply } from \"./feedback-public-types\";\n\n/**\n * One feedback report as the three apps send it, and the facts the kit reads off it.\n *\n * Until 0.27 the inbox parts took no report at all (\"no `Feedback` type in this file\",\n * feedback-inbox.tsx): keksdose kept its reporter context in a JSON column, kastlan a\n * thinner copy of it, Kurvenschmiede a `page_path` and the bytes in the row. Marcel's\n * feedback round (2026-10-04, docs/feedback-harmonization.md) settled one API contract\n * for all three — keksdose's, read off its code — so the apps now share one shape and the\n * kit can take a row instead of a dozen loose values. This file is that shape (§3.1,\n * §3.2), the contract's constants (§3.4, §3.5, §4.3) and the readers and writers of the\n * one field whose format is itself contract: the body, which carries the rework rounds\n * (§3.4) — lifted from keksdose `frontend/src/features/feedback/body-attachments.ts`.\n *\n * Plain functions and data, no components: everything here is as usable from a loop\n * script's helper or a test as from a page.\n */\n\n/* ── The resource (§3.1, §3.2) ────────────────────────────────────────────── */\n\n/** Which copy of an app a report came from — keksdose `app/deploy-environment.ts`.\n * Any other string is read as \"not prod\" (the admin list shows it upper-cased as a\n * chip, §4.3), so an app with a `staging` loses nothing. */\nexport type FeedbackEnvironment = \"prod\" | \"dev\" | \"local\";\n\n/**\n * The reporter's context, written by the submit dialog (keksdose\n * `use-feedback-dialog.tsx:105`) — §3.2 of the contract.\n *\n * **Every key is optional on read**, and a reader treats a missing one as \"unknown\":\n * kastlan's client sends six of them (no email, no version), Kurvenschmiede's old rows are\n * backfilled from two columns with a path-only `url`, crash rows add their own (and\n * `origin` / `environment` from the crash payload, §3.6 — older crash rows have neither),\n * and an erased account's row keeps only an allow-list (§3.2: `environment` stays,\n * `origin` goes). Extra keys are allowed — a server may add its own — hence the index\n * signature.\n */\nexport interface FeedbackContext {\n /** The full `location.href` at open time; `\"\"` when \"Attach current page URL\" was off.\n * Readers also accept a path-only value (Kurvenschmiede's backfilled rows). */\n url?: string;\n /** Its pathname; `\"\"` when the URL was withheld. */\n route?: string;\n /** `location.origin` — which copy of the app, not personal; never withheld. */\n origin?: string;\n /** {@link FeedbackEnvironment}, or whatever the app calls its other copies. */\n environment?: FeedbackEnvironment | (string & {});\n /** The submitter, as a snapshot. The server should overwrite the three `user_*` keys\n * from the session (Kurvenschmiede does), so nobody files in someone else's name. */\n user_id?: number | null;\n user_email?: string | null;\n user_display_name?: string | null;\n /** `\"406x816\"`. */\n viewport?: string;\n /** `navigator.userAgent`. */\n ua?: string;\n /** The app build (`__APP_VERSION__`). */\n version?: string;\n // Crash rows (server-written, keksdose `feedback_service.py:346`).\n fingerprint?: string;\n /** Which error boundary caught it. */\n boundary?: \"app\" | \"page\" | (string & {});\n online?: boolean;\n occurrences?: number;\n first_seen_at?: string;\n last_seen_at?: string;\n auto_reported?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * One report — `FeedbackResponse`, keksdose `schemas/feedback.py:117`, §3.1 of the\n * contract. What `GET /feedback`, `GET /feedback/my`, `POST /feedback` and\n * `PATCH /feedback/{id}` answer in all three apps.\n *\n * Extra fields are allowed and ignored (kastlan's `company_id`, `user_name`): an app's\n * own row type with more fields is assignable to this one as it stands.\n *\n * There is **no rework counter field** — {@link reworkCount} reads it off the body, so\n * nothing can forget to set it.\n */\nexport interface FeedbackRecord {\n id: number;\n /** `null`: the author's account was erased (keksdose live #275). */\n user_id: number | null;\n /** The admin list only (joined); `null` — or absent — on `/my`, create and update. */\n user_email?: string | null;\n /** 1–255 characters, never blank. */\n title: string;\n /** `\"\"` when none. Rework rounds are appended here (§3.4) — read it with\n * {@link splitDescription} / {@link splitBodyAttachments}, write it with\n * {@link appendRework} / {@link replaceDescription}. */\n body: string;\n category: FeedbackCategory;\n status: FeedbackStatus;\n /** §3.2; `null` on rows that have none. */\n context: FeedbackContext | null;\n /** The ONE captured screenshot's attachment URL, or `null`. */\n screenshot_url: string | null;\n /** Up to 5 other files; `null` = none. Optional because a server older than the\n * column sends no key at all (keksdose dev #578 met exactly that). */\n attachment_urls?: string[] | null;\n /** The team's answer; `null` = none written. **Frozen since 0.38** (§9.7): answered\n * as stored for one release, written by nothing, then dropped — the answer is\n * {@link FeedbackRecord.replies} now. */\n outcome: string | null;\n /** Set on ENTERING `DONE` / `WONT_DO`, cleared on leaving them. ISO 8601. */\n resolved_at: string | null;\n /** ISO 8601. */\n created_at: string;\n /** ISO 8601. */\n updated_at: string;\n // ── Round 0.38 (§9.3): all optional, so an app without public parts sends none. ──\n /** The admin: the full name; the author: their own; `null`: none to show. */\n author_name?: string | null;\n /** The viewer filed it. */\n mine?: boolean | null;\n /** Visible to the app's other users (§9.3); never on a CRASH. */\n public?: boolean | null;\n /** Made public by the 0.38 migration: the author may switch it off at any status. */\n filed_private?: boolean | null;\n /** People who want this (the author's own vote included, §9.6). */\n votes?: number | null;\n /** The viewer's vote. */\n voted?: boolean | null;\n /** Comments (an admin's count includes hidden ones). */\n comment_count?: number | null;\n /** The admin's answers, oldest first (§9.7). Absent: a server before 0.38 — read\n * `outcome` instead. */\n replies?: FeedbackReply[] | null;\n}\n\n/* ── Constants (§3.4, §3.5, §4.3) ─────────────────────────────────────────── */\n\n// The attachment field's three defaults live here, not in feedback-attachment.tsx\n// (which re-exports them), since 0.34 (MOD-1, refactor audit 2026-10). This module is in\n// every app's top bar (the menu's categories), and FEEDBACK_ATTACHMENT_ACCEPT below is\n// built on DEFAULT_ATTACHMENT_ACCEPT: imported from the field's module, it tied the top\n// bar to the field, the lazily loaded dialog's heaviest part, for three values.\n\n/** The image types `FeedbackAttachmentField` takes when `accept` is not given. */\nexport const DEFAULT_ATTACHMENT_ACCEPT = [\"image/png\", \"image/jpeg\", \"image/webp\", \"image/gif\"];\n/** 10 MB, the contract's size limit for one file (§3.5). */\nexport const DEFAULT_MAX_ATTACHMENT_BYTES = 10 * 1024 * 1024;\n/** How many files `<FeedbackAttachmentField multiple>` takes when `max` is not given\n * (0.15.5). Five photos of one problem is already a lot to look through; a report\n * that needs more is a conversation, which the thread is for. */\nexport const DEFAULT_MAX_ATTACHMENTS = 5;\n\n/**\n * What a report may carry (§3.5, keksdose `upload_guards.py:197` and its\n * `attachment-options.ts`): the kit's four image types plus a PDF and a plain-text log\n * (keksdose feedback #87). SVG and HTML stay out — both are script-carrying documents in\n * an image's clothing. For `FeedbackAttachmentField` / `FeedbackDialog`'s `accept`, with\n * `DEFAULT_MAX_ATTACHMENTS` (5) and `DEFAULT_MAX_ATTACHMENT_BYTES` (10 MB) above, which\n * already are the contract's limits.\n *\n * A plain array (not frozen) because `accept` takes `string[]`, as\n * `DEFAULT_ATTACHMENT_ACCEPT` does — copy it before changing it.\n */\nexport const FEEDBACK_ATTACHMENT_ACCEPT: string[] = [\n ...DEFAULT_ATTACHMENT_ACCEPT,\n \"application/pdf\",\n \"text/plain\",\n];\n\n/**\n * The categories a person can pick — every one but `CRASH`, in triage order (Bug, Idea,\n * Question, Other: the feedback menu's rows, §4.1). `CRASH` is filed by an error boundary\n * and the server refuses it by hand with a 422 (keksdose `_reject_manual_crash`), so no\n * picker may offer it.\n */\nexport const FEEDBACK_PICKABLE_CATEGORIES: readonly FeedbackCategory[] = Object.freeze(\n FEEDBACK_CATEGORY_ORDER.filter((category) => category !== \"CRASH\"),\n);\n\n/**\n * The statuses a report can be sent back for **rework** from (§3.4): everything the team\n * has answered — `IN_EVALUATION`, `NEEDS_LIVE_TEST`, `POSTPONED`, `DONE`, `WONT_DO`. On\n * these the server reopens the row when the body grows by a rework block; on `OPEN`,\n * `READY` and `IN_PROGRESS` there is nothing to send back yet.\n */\nexport const FEEDBACK_REWORKABLE_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"IN_EVALUATION\",\n \"NEEDS_LIVE_TEST\",\n \"POSTPONED\",\n \"DONE\",\n \"WONT_DO\",\n] as const);\n\n/**\n * The statuses in which the AUTHOR may still edit title, body and category (§3.4,\n * keksdose `canAuthorEdit`, `feedback-page.tsx:398`): `OPEN`, `READY` and `IN_PROGRESS`.\n * Once the team has answered, the description is what they answered and stays as it\n * was; a correction goes in as a rework.\n */\nexport const FEEDBACK_AUTHOR_EDITABLE_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"OPEN\",\n \"READY\",\n \"IN_PROGRESS\",\n] as const);\n\n/**\n * The statuses that wait on the person triaging: filed and not yet triaged (`OPEN`,\n * since READY took over \"released for implementation\" in 0.31, feedback contract §8.2),\n * answered and handed back for a verdict, or answered and only checkable on a deployed\n * build (keksdose `AWAITING_VERDICT`, live #330). The phone's \"Only what is waiting for\n * you\" toggle narrows the inbox to exactly these (§4.3).\n */\nexport const FEEDBACK_AWAITING_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"OPEN\",\n \"IN_EVALUATION\",\n \"NEEDS_LIVE_TEST\",\n] as const);\n\n/**\n * The **decided** statuses (§9.7, decision 13): `DONE`, `WONT_DO`, `POSTPONED`. A\n * status-only move into one tells the author nothing (a status alone sends no\n * notification), so the row detail nudges the admin toward a reply until one with that\n * `status_to` exists.\n */\nexport const FEEDBACK_DECIDED_STATUSES: readonly FeedbackStatus[] = Object.freeze([\n \"DONE\",\n \"WONT_DO\",\n \"POSTPONED\",\n] as const);\n\n/** A comment's longest body after trimming (§9.8). */\nexport const FEEDBACK_COMMENT_MAX = 4000;\n/** A reply's longest body after trimming (§9.7). */\nexport const FEEDBACK_REPLY_MAX = 8000;\n\n/* ── The body (§3.4) ──────────────────────────────────────────────────────── */\n\n/**\n * The path every app serves attachments under (§3.3), and a key after it. Keys are\n * OPAQUE (§3.5): keksdose and Kurvenschmiede content-address (`<sha12>.<ext>`), kastlan's\n * storage keys are `<uuid32>_<sha12>.<ext>` — so `[\\w.-]+`, never a fixed hex shape.\n */\nconst ATTACHMENT_URL = /^\\/api\\/v1\\/feedback\\/attachments\\/[\\w.-]+$/;\n\n/**\n * One file line in a body. The marker is deliberately narrow — this path and nothing\n * else, alone on its line — so no sentence a user writes can be mistaken for one\n * (keksdose live #291). It says `[screenshot]` for a PDF or a text log too: the name is\n * history, the format is contract.\n */\nconst ATTACHMENT_LINE = /^\\[screenshot\\]\\s+(\\/api\\/v1\\/feedback\\/attachments\\/[\\w.-]+)\\s*$/;\n\n/**\n * The `--- REWORK <stamp> ---` rule a rework opens with. Anchored and whole-line for the\n * same reason as the file marker: \"I did a REWORK --- honestly\" is a sentence, not a\n * round. kastlan's folded `--- COMMENT <stamp> · <name> ---` blocks (§7.7) never match.\n */\nconst REWORK_RULE = /^---\\s*REWORK\\b.*---$/;\n\n/** Any appended block's opening rule: a rework round, or a kastlan comment folded into\n * the body by its one-time migration (§7.7). */\nconst BLOCK_RULE = /^---\\s*(?:REWORK|COMMENT)\\b.*---$/;\n\n/** The body line for one uploaded attachment — what {@link appendRework} writes under\n * the note. */\nexport function feedbackAttachmentLine(url: string): string {\n return `[screenshot] ${url}`;\n}\n\n/**\n * A rework round appended to a body — the exact text `PATCH /feedback/{id}` takes as the\n * new `body` (§3.4; keksdose `submitRework`, `feedback-page.tsx:350`):\n *\n * ```text\n * <old body>\\n\\n--- REWORK 2026-10-04 09:12 ---\\n<note>\\n[screenshot] /api/v1/feedback/attachments/<key>\n * ```\n *\n * - The stamp is UTC, `YYYY-MM-DD HH:MM` (`toISOString().slice(0, 16)`), from `now`.\n * - The old body is kept byte for byte, so the result STRICTLY EXTENDS it — which is\n * how the server recognises an append and reopens an answered row (keksdose\n * `_is_rework_append`, live #331). `\\n\\n` is left out when the old body is `\"\"`.\n * - ONE file per round (`url`), uploaded first by the caller: a body appended without\n * it would be a rework whose evidence never arrived.\n *\n * **Returns `null` when the trimmed note is empty** — a file alone cannot be sent\n * (keksdose `:577`). Null rather than a throw because an empty note is something a\n * person does, not a bug, and the type then makes every caller decide what an empty\n * box means before anything can reach the PATCH.\n *\n * **Throws a `TypeError` when `url` is not an attachment URL** of the contract's shape\n * (`/api/v1/feedback/attachments/<key>`): that one IS a bug — the upload handed back\n * something foreign — and written anyway it would sit in the body as prose that no\n * reader recognises as a file.\n */\nexport function appendRework(\n body: string,\n note: string,\n url?: string | null,\n now: Date = new Date(),\n): string | null {\n const text = note.trim();\n if (!text) return null;\n if (url && !ATTACHMENT_URL.test(url)) {\n throw new TypeError(`appendRework: not a feedback attachment URL: ${url}`);\n }\n const stamp = now.toISOString().slice(0, 16).replace(\"T\", \" \");\n const block = `--- REWORK ${stamp} ---\\n${url ? `${text}\\n${feedbackAttachmentLine(url)}` : text}`;\n return body ? `${body}\\n\\n${block}` : block;\n}\n\n/**\n * How many times a report has been sent back — the count of `--- REWORK … ---` rule\n * lines in its body (keksdose live #331: the \"category for items in rework\", derived\n * rather than stored, so nothing can forget to set it or leave it set). Folded kastlan\n * comments do not count.\n */\nexport function reworkCount(body: string): number {\n let n = 0;\n for (const line of body.split(\"\\n\")) if (REWORK_RULE.test(line.trim())) n += 1;\n return n;\n}\n\n/**\n * A body split into the prose to render and the files to show beside it, in body order.\n *\n * The file lines are stripped from the text: they are a location, not something anybody\n * wrote, and left in they would put a raw URL in the middle of a sentence. Trailing blank\n * lines go (what a stripped marker leaves at the end of a note); every blank line between\n * paragraphs stays.\n */\nexport function splitBodyAttachments(body: string): { text: string; urls: string[] } {\n const urls: string[] = [];\n const kept: string[] = [];\n for (const line of body.split(\"\\n\")) {\n const match = ATTACHMENT_LINE.exec(line.trim());\n if (match) urls.push(match[1]);\n else kept.push(line);\n }\n return { text: kept.join(\"\\n\").replace(/\\n+$/, \"\"), urls };\n}\n\n/** A body cut where its first appended block begins. */\nfunction cutAtFirstBlock(body: string): { head: string; appended: string } {\n const lines = body.split(\"\\n\");\n const at = lines.findIndex((line) => BLOCK_RULE.test(line.trim()));\n if (at === -1) return { head: body, appended: \"\" };\n return { head: lines.slice(0, at).join(\"\\n\"), appended: lines.slice(at).join(\"\\n\") };\n}\n\n/**\n * The ORIGINAL description, apart from everything appended to it since (§4.4.1).\n *\n * - `description` — what the author wrote when filing, without its file lines and\n * trailing blank lines: the text the \"Edit description\" editor holds.\n * - `appended` — every `--- REWORK … ---` round and folded `--- COMMENT … ---` block,\n * from the first one's rule line to the end, verbatim (`\"\"` when there are none).\n *\n * keksdose's editor edits the raw body (`initial={fb.body}`, `feedback-page.tsx:420`), so\n * an author tidying a typo could delete the rework history and the file lines with it.\n * The kit's editor holds `description` only and saves through\n * {@link replaceDescription}, which puts the rest back unchanged.\n */\nexport function splitDescription(body: string): { description: string; appended: string } {\n const { head, appended } = cutAtFirstBlock(body);\n return { description: splitBodyAttachments(head).text, appended };\n}\n\n/**\n * The body with its original description replaced and everything else kept — the file\n * lines of the original part (after the new text, in their order) and the appended\n * blocks (verbatim, after a blank line). The new text is trimmed; clearing it saves the\n * rest alone (`\"\"` when there is no rest).\n *\n * `replaceDescription(body, splitDescription(body).description)` gives back a canonical\n * body unchanged — a trimmed description, then each block after one blank line, as the\n * dialog and {@link appendRework} write them.\n */\nexport function replaceDescription(body: string, description: string): string {\n const { head, appended } = cutAtFirstBlock(body);\n const files = splitBodyAttachments(head).urls.map(feedbackAttachmentLine);\n const text = description.trim();\n const top = [...(text ? [text] : []), ...files].join(\"\\n\");\n if (!appended) return top;\n return top ? `${top}\\n\\n${appended}` : appended;\n}\n\n/**\n * Whether an attachment URL is a picture (keksdose dev #578). The upload route takes\n * PDFs and text logs too and serves them as downloads, never inline, so an `<img>` on\n * one shows a broken icon. The key's extension is the server's own statement of the\n * type (minted from the sniffed content), so it is the thing to read.\n */\nexport function isImageAttachment(url: string): boolean {\n return /\\.(png|jpe?g|webp|gif)$/i.test(url);\n}\n\n/** The file name an attachment downloads as — its key, the last segment of the URL. */\nexport function attachmentName(url: string): string {\n return url.slice(url.lastIndexOf(\"/\") + 1);\n}\n"],"mappings":";AAAA,SAAS,+BAA+B;AAgJjC,MAAM,4BAA4B,CAAC,aAAa,cAAc,cAAc,WAAW;AAEvF,MAAM,+BAA+B,KAAK,OAAO;AAIjD,MAAM,0BAA0B;AAahC,MAAM,6BAAuC;AAAA,EAClD,GAAG;AAAA,EACH;AAAA,EACA;AACF;AAQO,MAAM,+BAA4D,OAAO;AAAA,EAC9E,wBAAwB,OAAO,CAAC,aAAa,aAAa,OAAO;AACnE;AAQO,MAAM,+BAA0D,OAAO,OAAO;AAAA,EACnF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAQH,MAAM,oCAA+D,OAAO,OAAO;AAAA,EACxF;AAAA,EACA;AAAA,EACA;AACF,CAAU;AASH,MAAM,6BAAwD,OAAO,OAAO;AAAA,EACjF;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAQH,MAAM,4BAAuD,OAAO,OAAO;AAAA,EAChF;AAAA,EACA;AAAA,EACA;AACF,CAAU;AAGH,MAAM,uBAAuB;AAE7B,MAAM,qBAAqB;AASlC,MAAM,iBAAiB;AAQvB,MAAM,kBAAkB;AAOxB,MAAM,cAAc;AAIpB,MAAM,aAAa;AAIZ,SAAS,uBAAuB,KAAqB;AAC1D,SAAO,gBAAgB,GAAG;AAC5B;AA2BO,SAAS,aACd,MACA,MACA,KACA,MAAY,oBAAI,KAAK,GACN;AACf,QAAM,OAAO,KAAK,KAAK;AACvB,MA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B,MAAyD;AACxF,QAAM,EAAE,MAAM,SAAS,IAAI,gBAAgB,IAAI;AAC/C,SAAO,EAAE,aAAa,qBAAqB,IAAI,EAAE,MAAM,SAAS;AAClE;AAYO,SAAS,mBAAmB,MAAc,aAA6B;AAC5E,QAAM,EAAE,MAAM,SAAS,IAAI,gBAAgB,IAAI;AAC/C,QAAM,QAAQ,qBAAqB,IAAI,EAAE,KAAK,IAAI,sBAAsB;AACxE,QAAM,OAAO,YAAY,KAAK;AAC9B,QAAM,MAAM,CAAC,GAAI,OAAO,CAAC,IAAI,IAAI,CAAC,GAAI,GAAG,KAAK,EAAE,KAAK,IAAI;AACzD,MAAI,CAAC,SAAU,QAAO;AACtB,SAAO,MAAM,GAAG,GAAG;AAAA;AAAA,EAAO,QAAQ,KAAK;AACzC;AAQO,SAAS,kBAAkB,KAAsB;AACtD,SAAO,2BAA2B,KAAK,GAAG;AAC5C;AAGO,SAAS,eAAe,KAAqB;AAClD,SAAO,IAAI,MAAM,IAAI,YAAY,GAAG,IAAI,CAAC;AAC3C;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `true` inside `FeedbackRowDetail`'s Comments section (0.38.1, Kurvenschmiede): the
|
|
3
|
+
* detail's own Replies section draws the report's replies already, so a
|
|
4
|
+
* `FeedbackCommentThread` there draws the comments alone — whatever `replies` it was
|
|
5
|
+
* handed. Internal: not re-exported.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FeedbackRepliesDrawnAboveContext: import("react").Context<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/feedback/feedback-replies-context.ts"],"sourcesContent":["import { createContext } from \"react\";\n\n/**\n * `true` inside `FeedbackRowDetail`'s Comments section (0.38.1, Kurvenschmiede): the\n * detail's own Replies section draws the report's replies already, so a\n * `FeedbackCommentThread` there draws the comments alone — whatever `replies` it was\n * handed. Internal: not re-exported.\n */\nexport const FeedbackRepliesDrawnAboveContext = createContext(false);\n"],"mappings":";AAAA,SAAS,qBAAqB;AAQvB,MAAM,mCAAmC,cAAc,KAAK;","names":[]}
|
|
@@ -192,6 +192,10 @@ export interface FeedbackDetailPatch {
|
|
|
192
192
|
* answers 422; the detail no longer sends it (a reply is written instead). */
|
|
193
193
|
outcome?: string | null;
|
|
194
194
|
status?: FeedbackStatus;
|
|
195
|
+
/** 0.38.1: the **Visible to others** flip (§9.3) — what `onPublicChange`'s
|
|
196
|
+
* `PATCH /feedback/{id} {"public": next}` carries, alone, so an app can send it
|
|
197
|
+
* through the same `onUpdate` mutation. */
|
|
198
|
+
public?: boolean;
|
|
195
199
|
}
|
|
196
200
|
/**
|
|
197
201
|
* The page's update mutation. **TanStack Query's `mutate` fits as it stands** — pass
|
|
@@ -302,17 +306,22 @@ export interface FeedbackRowDetailProps {
|
|
|
302
306
|
* 0.38: `POST /feedback/{id}/replies` (§9.7) — the body and the status picked
|
|
303
307
|
* (`undefined`: "No change"). With `canEdit` and a row that carries `replies`, the
|
|
304
308
|
* reply composer stands under the timeline. Return the promise: the box clears when it
|
|
305
|
-
* resolves.
|
|
309
|
+
* resolves. A failure is the app's to toast — the server's `detail`, else
|
|
310
|
+
* `feedbackToast.replyFailed` (0.38.1).
|
|
306
311
|
*/
|
|
307
312
|
onReply?: (body: string, status?: FeedbackStatus) => void | Promise<unknown>;
|
|
308
313
|
/** 0.38: the reply is in flight. */
|
|
309
314
|
replying?: boolean;
|
|
310
315
|
/** 0.38: the report's comments — the app's `FeedbackCommentThread` — in a section of
|
|
311
|
-
* their own under the replies.
|
|
316
|
+
* their own under the replies. A thread here draws the comments alone (0.38.1): the
|
|
317
|
+
* Replies section above has the replies, so whatever `replies` the thread is handed
|
|
318
|
+
* are dropped, and nothing is drawn twice. */
|
|
312
319
|
comments?: ReactNode;
|
|
313
320
|
/** 0.38: `PATCH /feedback/{id} {"public": next}` — draws the **Visible to others**
|
|
314
321
|
* switch (`FeedbackPublicSwitch`) in the Status section, for the admin (`canEdit`)
|
|
315
|
-
* and, within §9.3's window, the author.
|
|
322
|
+
* and, within §9.3's window, the author. The page's own mutation fits:
|
|
323
|
+
* `onPublicChange={(next) => update.mutate({ id: row.id, public: next })}` —
|
|
324
|
+
* {@link FeedbackDetailPatch}'s `public` (0.38.1). */
|
|
316
325
|
onPublicChange?: (next: boolean) => void;
|
|
317
326
|
labels?: LabelOverride<FeedbackDetailLabels>;
|
|
318
327
|
className?: string;
|
|
@@ -38,6 +38,7 @@ import { useFeedbackStatusUndo } from "./feedback-status-undo.js";
|
|
|
38
38
|
import { DEFAULT_FEEDBACK_DETAIL_LABELS } from "./feedback-row-detail-labels.js";
|
|
39
39
|
import { FeedbackReplyComposer, FeedbackReplyTimeline, feedbackReplyNudge } from "./feedback-replies.js";
|
|
40
40
|
import { FeedbackPublicSwitch } from "./feedback-public-switch.js";
|
|
41
|
+
import { FeedbackRepliesDrawnAboveContext } from "./feedback-replies-context.js";
|
|
41
42
|
import { DEFAULT_FEEDBACK_COMMENTS_LABELS } from "./feedback-thread-parts-labels.js";
|
|
42
43
|
function useFeedbackDetailLabels(labels) {
|
|
43
44
|
return useKitLabels("feedbackDetail", DEFAULT_FEEDBACK_DETAIL_LABELS, labels);
|
|
@@ -361,7 +362,7 @@ function FeedbackRowDetail({
|
|
|
361
362
|
] })
|
|
362
363
|
}
|
|
363
364
|
),
|
|
364
|
-
comments != null && /* @__PURE__ */ jsx(FeedbackDetailSection, { title: commentLabels.comments, children: comments }),
|
|
365
|
+
comments != null && /* @__PURE__ */ jsx(FeedbackDetailSection, { title: commentLabels.comments, children: /* @__PURE__ */ jsx(FeedbackRepliesDrawnAboveContext.Provider, { value: true, children: comments }) }),
|
|
365
366
|
showRework && /* @__PURE__ */ jsx(
|
|
366
367
|
FeedbackReworkSection,
|
|
367
368
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/feedback/feedback-row-detail.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport type { MouseEvent, ReactNode } from \"react\";\nimport { Download, ExternalLink, FileText, RotateCcw } from \"lucide-react\";\nimport { AuthedImage } from \"../components/authed-image\";\nimport { CopyButton } from \"../components/copy-button\";\nimport { TextLink } from \"../components/text-link\";\nimport { toast } from \"../components/toast\";\nimport { Button } from \"../components/button\";\nimport type { AuthedFetcher } from \"../hooks/use-authed-src\";\nimport { useKitLabels, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport { filenameFromDisposition, saveBlob } from \"../lib/download\";\nimport { formatDate } from \"../lib/format\";\nimport { DEFAULT_MAX_ATTACHMENT_BYTES } from \"./feedback-attachment\";\nimport { DEFAULT_FEEDBACK_DIALOG_LABELS } from \"./feedback-dialog\";\nimport {\n FeedbackCategoryBadge,\n FeedbackDetail,\n FeedbackDetailSection,\n FeedbackNoteEditor,\n FeedbackProse,\n FeedbackStatusTransitions,\n selectableFeedbackStatuses,\n visibleFeedbackStatuses,\n} from \"./feedback-inbox\";\nimport type { FeedbackNoteAttachment, FeedbackStatus } from \"./feedback-inbox\";\nimport { useFeedbackToastLabels } from \"./feedback-labels\";\nimport {\n FEEDBACK_ATTACHMENT_ACCEPT,\n FEEDBACK_AUTHOR_EDITABLE_STATUSES,\n FEEDBACK_REWORKABLE_STATUSES,\n appendRework,\n attachmentName,\n isImageAttachment,\n replaceDescription,\n splitBodyAttachments,\n splitDescription,\n} from \"./feedback-record\";\nimport type { FeedbackContext, FeedbackRecord } from \"./feedback-record\";\nimport { useFeedbackStatusUndo } from \"./feedback-status-undo\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_DETAIL_LABELS } from \"./feedback-row-detail-labels\";\nimport { FeedbackReplyComposer, FeedbackReplyTimeline, feedbackReplyNudge } from \"./feedback-replies\";\nimport { FeedbackPublicSwitch } from \"./feedback-public-switch\";\nimport { DEFAULT_FEEDBACK_COMMENTS_LABELS } from \"./feedback-thread-parts-labels\";\n\n/**\n * One report, opened — the panel a feedback table unfolds under its row (§4.4 of\n * docs/feedback-harmonization.md), lifted from keksdose's `FeedbackRow`\n * (`frontend/src/features/feedback/feedback-page.tsx:329-612`) with the contract's\n * changes applied.\n *\n * Until 0.27 each app wrote this panel itself out of the kit's shell\n * (`FeedbackDetail` / `FeedbackDetailSection` / `FeedbackNoteEditor`), and the three\n * copies had drifted in exactly the places a user notices:\n *\n * - **the description editor held the raw body** — keksdose `initial={fb.body}`\n * (`:420`), kastlan the same (`pages/feedback-page.tsx:226`) — so an author fixing a\n * typo could delete the `--- REWORK … ---` rounds and the `[screenshot]` file lines\n * with it, and the history was gone. Here the editor holds the ORIGINAL description\n * only ({@link splitDescription}) and saves through {@link replaceDescription}, which\n * puts every appended block and file line back unchanged;\n * - **kastlan's rework sent `status: \"OPEN\"`** from the client (`:189-195`) and offered it\n * on three statuses; keksdose sends the body alone and lets the server reopen the row\n * on five (live #331). The contract is keksdose's (§3.4) — {@link appendRework}, one\n * file, the server reopens;\n * - **kastlan showed only `screenshot_url`** (`:265-276`) and no downloads; keksdose the\n * screenshot, the other files and the rework pictures, a PDF as a download (dev #578);\n * - **the URL fell away on Kurvenschmiede's rows**, whose backfilled `context.url` is a\n * path (`/accounts?p=2`): keksdose's `new URL(…)` throws on one and the section\n * vanished. kastlan already fell back to `context.route` (`feedbackRaw`, `:97`).\n *\n * The sections, in the contract's order: **Subject** (the category and the title, §8.1;\n * `showSubject={false}` leaves it out), **Description** (the body; the author's\n * Edit while OPEN / READY / IN_PROGRESS), **URL**, **Attachment**, **Replies** (0.38,\n * §9.7: the timeline, the admin's reply composer with its status picker and the nudge,\n * Rework, Open page — on a row without `replies`, a server before 0.38, the frozen\n * **Outcome** read-only in its place), **Comments** (0.38: the app's\n * `FeedbackCommentThread`, when passed), **Send for rework** (only while reworking) and\n * **Status** (with the **Visible to others** switch when `onPublicChange` is passed).\n *\n * The app keeps its data and its API: the row it renders, the PATCH (`onUpdate`), the\n * upload (`onUpload`), the authenticated GET (`fetcher`) and who is looking (`canEdit`,\n * `viewerId`). Every word is the kit's `feedbackDetail` namespace.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackDetail` — the row detail's words (§4.4). English: keksdose's `en.json`\n * (`feedback.*`, `common.*`, `more.copy_url`) with the contract's changes; the de-CH\n * canon (keksdose `de-CH.json`, ss never ß, \"Nacharbeit\" throughout — §7.14) on each key.\n */\nexport interface FeedbackDetailLabels {\n /** The first section's heading: what the report is called (feedback contract §8.1,\n * keksdose live #395 — with the row expanded and the table scrolled, nothing said\n * which entry was being answered). de-CH: \"Betreff\" */\n subject: string;\n /** The description section's heading — keksdose's `feedback.body` (§7.3). The dialog's field asks\n * \"What happened? (optional)\"; the description, once filed, is headed as what it is\n * — and as the author's \"Edit description\" calls it. de-CH: \"Beschreibung\" */\n body: string;\n /** The author's button on that heading. de-CH: \"Bearbeiten\" */\n edit: string;\n /** Its accessible name — says WHAT is edited; contains the visible word.\n * de-CH: \"Beschreibung bearbeiten\" */\n editDescription: string;\n /** The editors' save button (description, outcome). de-CH: \"Speichern\" */\n save: string;\n /** Every editor's cancel button. de-CH: \"Abbrechen\" */\n cancel: string;\n /** Section 2's heading. de-CH: \"URL\" */\n url: string;\n /** The copy button beside the link — copies the FULL `context.url`.\n * de-CH: \"URL kopieren\" */\n copyUrl: string;\n /** Section 3's heading, and each picture's alt text. de-CH: \"Anhang\" */\n attachment: string;\n /** A PDF's / text file's download button, given the file's name.\n * de-CH: \"{{name}} herunterladen\" */\n download: (name: string) => string;\n /** The toast when that download failed. de-CH: \"Der Anhang konnte nicht\n * heruntergeladen werden.\" */\n downloadFailed: string;\n /** Section 4's heading on a row without `replies` (a server before 0.38), where the\n * frozen outcome is shown read-only. de-CH: \"Ergebnis\" */\n outcome: string;\n /** Section 4's heading since 0.38: the replies' timeline (§9.7). de-CH: \"Antworten\" */\n replies: string;\n /** On section 4's heading line once the row is settled, given the formatted\n * `resolved_at` date. de-CH: \"Erledigt am: {{date}}\" */\n resolvedAt: (date: string) => string;\n /** The admin's button while there is no outcome. **Unused since 0.38** (the outcome is\n * frozen, §9.7; a reply is written instead); kept for one release.\n * de-CH: \"Ergebnis hinzufügen\" */\n outcomeAdd: string;\n /** The same button once there is one. Unused since 0.38, as `outcomeAdd`.\n * de-CH: \"Aktualisieren\" */\n outcomeUpdate: string;\n /** The line above the outcome editor. Unused since 0.38, as `outcomeAdd`. de-CH: \"Was wurde umgesetzt, entschieden oder\n * warum nicht.\" */\n outcomePlaceholder: string;\n /** The button that opens section 5 on an answered row. de-CH: \"Nacharbeit\" */\n rework: string;\n /** The link to the page the report was filed on. de-CH: \"Seite öffnen\" */\n openPage: string;\n /** Section 5's heading. de-CH: \"Zur Nacharbeit senden\" */\n reworkTitle: string;\n /** Section 5's send button. de-CH: \"Nacharbeit senden\" */\n reworkSend: string;\n /** The line above the rework note. de-CH: \"Was muss noch angepasst werden? Neue\n * Anforderungen oder Richtungswechsel.\" */\n reworkPlaceholder: string;\n /** The toast when the rework's file did not upload — and so nothing was sent. Names\n * no screenshot: it fires for a PDF or a log too (§7.14; keksdose's said\n * \"screenshot\"). de-CH: \"Die Datei konnte nicht hochgeladen werden. Die Nacharbeit\n * wurde nicht gesendet.\" */\n reworkUploadFailed: string;\n /** Section 6's heading. de-CH: \"Status\" */\n status: string;\n /** A `FeedbackNoteEditor`'s box, named when no `placeholder` line names it and the\n * caller gives no `label` — without it the box was read out as just \"edit text\"\n * (round 0.34, the showcase's axe check). de-CH: \"Notiz\" */\n note: string;\n}\n\n// Defined in ./feedback-row-detail-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_DETAIL_LABELS };\n\n/** `feedbackDetail` resolved: English, then `<UiKitProvider labels>`, then `labels`. */\nexport function useFeedbackDetailLabels(labels?: LabelOverride<FeedbackDetailLabels>): FeedbackDetailLabels {\n return useKitLabels(\"feedbackDetail\", DEFAULT_FEEDBACK_DETAIL_LABELS, labels);\n}\n\n/* ── The page a report was filed on (§3.2, §4.4.2) ────────────────────────── */\n\n/** `context.url`, else `context.route` — a parsed URL, or null when neither is set or\n * the value is no http(s) address or path (a `javascript:` value is not a page). */\nfunction parsePage(context: FeedbackContext | null | undefined): URL | null {\n const raw = (context?.url || context?.route || \"\").trim();\n if (!raw) return null;\n try {\n // A base, so a PATH-ONLY value parses too: Kurvenschmiede backfills its old rows\n // with `url = page_path + search` (§3.2), and keksdose's `new URL(raw)` threw on\n // those and dropped the section.\n const url = new URL(raw, \"http://localhost\");\n return url.protocol === \"http:\" || url.protocol === \"https:\" ? url : null;\n } catch {\n return null;\n }\n}\n\n/** Collapses a leading `//` run: `/\\/\\/evil.example/` as a path would be a\n * protocol-relative link off the app. */\nconst localPath = (pathname: string) => pathname.replace(/^\\/{2,}/, \"/\");\n\n/**\n * The in-app link to the page a report was filed on — path + query + hash (keksdose\n * `localHref`: the query and hash carry the state worth restoring, `?tab=import`, a\n * drill-down). Read from `context.url`, else `context.route`; a path-only `url` works.\n * Always a path on THIS app, never another origin's address, so it is safe as an\n * `href` whatever the row says. `null` when there is nothing to link.\n */\nexport function feedbackPageHref(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? `${localPath(url.pathname)}${url.search}${url.hash}` : null;\n}\n\n/** The page's path alone — the compact text a URL column shows (§4.3). */\nexport function feedbackPagePath(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? localPath(url.pathname) : null;\n}\n\n/**\n * What \"Copy URL\" copies: the FULL `context.url` as the reporter's browser had it —\n * origin included, which is the one part that says which copy of the app it was\n * (feedback #278) — else `context.route`. `null` when there is no page.\n */\nexport function feedbackPageUrl(context: FeedbackContext | null | undefined): string | null {\n if (!parsePage(context)) return null;\n return (context?.url || context?.route || \"\").trim();\n}\n\n/* ── Attachments (§3.5, §4.4.3) ───────────────────────────────────────────── */\n\n/**\n * Every file a report carries, in the order the detail shows them (§4.4.3): the\n * screenshot it was filed with, then its other files, then whatever the rework rounds\n * brought, in body order (keksdose dev #578, live #291). One list rather than three —\n * a reader looking for \"the picture\" should not have to know at which point in the\n * conversation it was taken.\n *\n * Each URL once: keksdose and Kurvenschmiede content-address their keys, so the same\n * screenshot pasted twice is one URL — shown twice it is the same picture twice (and,\n * keyed by URL, a React key clash keksdose had).\n */\nexport function feedbackAttachmentUrls(\n row: Pick<FeedbackRecord, \"screenshot_url\" | \"attachment_urls\" | \"body\">,\n): string[] {\n const urls = [\n ...(row.screenshot_url ? [row.screenshot_url] : []),\n // `?? []`: NULL on rows filed before the column, and no key at all from a server\n // that predates it (keksdose dev #578).\n ...(row.attachment_urls ?? []),\n ...splitBodyAttachments(row.body).urls,\n ];\n return [...new Set(urls)];\n}\n\n/** The bytes behind a fetcher's answer — a `Blob` as it is, a `Response` checked. */\nasync function toBlob(answer: Blob | Response): Promise<Blob> {\n if (typeof Response !== \"undefined\" && answer instanceof Response) {\n if (!answer.ok) throw new Error(`HTTP ${answer.status}`);\n return answer.blob();\n }\n return answer as Blob;\n}\n\n/** No fetcher: the browser's own `fetch`, with the cookies a same-origin app uses. */\nconst plainFetch: AuthedFetcher = (url, { signal }) => fetch(url, { signal, credentials: \"same-origin\" });\n\n/**\n * A PDF or a text log (keksdose `FeedbackFileDownload`, dev #578): the bytes sit behind\n * an authenticated route that serves them as `attachment`, never inline (§3.5), so a\n * plain link would be a 401 the moment it was opened. Fetched through the app's\n * fetcher and saved with {@link saveBlob}; a failure says so in a toast.\n *\n * Saved under the name the server gives it when the fetcher answers with a `Response`\n * (server-kit's `content_disposition` puts the uploader's own name in `filename*`), and\n * under the URL's last segment — the name on the button — when it answers with a bare\n * `Blob`, which has no headers to ask.\n */\nfunction AttachmentDownload({\n url,\n fetcher,\n labels,\n}: {\n url: string;\n fetcher: AuthedFetcher;\n labels: FeedbackDetailLabels;\n}) {\n const [busy, setBusy] = useState(false);\n const name = attachmentName(url);\n const download = async (event: MouseEvent) => {\n // The row around the detail may toggle on a click.\n event.stopPropagation();\n setBusy(true);\n try {\n const answer = await fetcher(url, { signal: new AbortController().signal });\n const blob = await toBlob(answer);\n const saveAs =\n typeof Response !== \"undefined\" && answer instanceof Response\n ? filenameFromDisposition(answer.headers.get(\"Content-Disposition\"), name)\n : name;\n saveBlob(blob, saveAs);\n } catch {\n toast.error(labels.downloadFailed);\n } finally {\n setBusy(false);\n }\n };\n return (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n pending={busy}\n onClick={(event) => void download(event)}\n aria-label={labels.download(name)}\n className=\"max-w-full\"\n >\n <FileText className=\"size-3.5 shrink-0\" aria-hidden />\n <span className=\"min-w-0 max-w-[14rem] truncate-until-large\">{name}</span>\n <Download className=\"size-3.5 shrink-0\" aria-hidden />\n </Button>\n );\n}\n\n/* ── Who may do what (§3.4, §4.3, §4.4) ───────────────────────────────────── */\n\n/** What the person looking at a row may do with it — {@link feedbackRowAccess}. */\nexport interface FeedbackRowAccess {\n /** The viewer filed it (`viewerId === row.user_id`; never for an erased author). */\n isAuthor: boolean;\n /** \"Edit description\": the author, while the row is OPEN, READY or IN_PROGRESS — on either\n * page (keksdose `canAuthorEdit`, `feedback-page.tsx:398`, is not gated on `mine`). */\n canEditDescription: boolean;\n /** The admin on the inbox (`canEdit`): since 0.38 the reply composer (the outcome\n * itself is frozen, §9.7). */\n canEditOutcome: boolean;\n /** \"Rework\": the admin or the author, on an answered row\n * ({@link FEEDBACK_REWORKABLE_STATUSES}) — §3.4, anyone else gets the server's 403. */\n canRework: boolean;\n /** The status pills: the admin on the inbox; everyone else sees them read-only. */\n canChangeStatus: boolean;\n}\n\n/**\n * The detail's permission rules in one place — the same answers the server gives\n * (§3.4), so the panel never offers what the PATCH would refuse.\n *\n * `canEdit` is the app's \"admin on `/feedback`\": an admin on `/my-feedback` edits no\n * status and no outcome there (§4.3), but as the author still edits the description\n * and sends for rework. `viewerId` is the signed-in user's id.\n */\nexport function feedbackRowAccess(\n row: Pick<FeedbackRecord, \"user_id\" | \"status\">,\n { canEdit, viewerId }: { canEdit: boolean; viewerId?: number | null },\n): FeedbackRowAccess {\n // `user_id: null` is an erased author (keksdose live #275): nobody is that author,\n // least of all a viewer whose id happens to be missing too.\n const isAuthor = row.user_id !== null && viewerId !== undefined && viewerId !== null && viewerId === row.user_id;\n return {\n isAuthor,\n canEditDescription: isAuthor && FEEDBACK_AUTHOR_EDITABLE_STATUSES.includes(row.status),\n canEditOutcome: canEdit,\n canRework: (canEdit || isAuthor) && FEEDBACK_REWORKABLE_STATUSES.includes(row.status),\n canChangeStatus: canEdit,\n };\n}\n\n/* ── The PATCH ─────────────────────────────────────────────────────────────── */\n\n/** What the detail sends as `PATCH /feedback/{id}` (§3.4): the body (a description\n * edit, a rework append) or the outcome — and, through {@link useFeedbackStatusUndo}\n * when no `statusChange` is given, the status. Never two at once: a rework PATCH must\n * carry the body ALONE for the server to read it as an append (keksdose live #331). */\nexport interface FeedbackDetailPatch {\n id: number;\n body?: string;\n /** `null` clears it — a real edit. **Frozen since 0.38** (§9.7): server-kit 0.11\n * answers 422; the detail no longer sends it (a reply is written instead). */\n outcome?: string | null;\n status?: FeedbackStatus;\n}\n\n/**\n * The page's update mutation. **TanStack Query's `mutate` fits as it stands** — pass\n * `update.mutate` (and `pending={update.isPending}`), the same function\n * `useFeedbackStatusUndo` takes. A hand-written one sends the PATCH and calls\n * `onSuccess` once it has landed, and only then: that is when an editor closes. A\n * failure is the mutation's own to toast — the server's `detail`, else\n * `feedbackToast.updateFailed` (§4.4) — and leaves the editor open with its draft.\n */\nexport type FeedbackDetailUpdate = (patch: FeedbackDetailPatch, callbacks: { onSuccess: () => void }) => void;\n\n/** `POST /feedback/attachments` (§3.3): one file up, its URL\n * (`/api/v1/feedback/attachments/<key>`) back. Reject on failure. */\nexport type FeedbackUpload = (file: File) => Promise<string>;\n\n/* ── Send for rework (§4.4.5) ─────────────────────────────────────────────── */\n\nexport interface FeedbackReworkSectionProps {\n /** The row being sent back: its id, and the body the round is appended to. */\n row: Pick<FeedbackRecord, \"id\" | \"body\">;\n /** The PATCH — see {@link FeedbackDetailUpdate}. Called with `{ id, body }` only. */\n onUpdate: FeedbackDetailUpdate;\n /** The PATCH is in flight (`update.isPending`). The upload adds its own. */\n pending?: boolean;\n /** The upload. Left out, the note goes without a file field. */\n onUpload?: FeedbackUpload;\n /** Snapshot the app view as a File — the kit's `captureAppScreenshot`, or the app's\n * own. A \"Capture screenshot\" button appears only with it; a rejection (no\n * `modern-screenshot`, a canvas that would not draw) toasts\n * `feedbackToast.captureFailed` and adds nothing. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The round landed — the server has the note and, on an answered row, reopened it. */\n onSent?: () => void;\n onCancel: () => void;\n /** Over the field's defaults: the contract's types and 10 MB (§3.5), the\n * `feedbackToast` refusals, the `feedbackAttachment` words. */\n attachment?: Partial<FeedbackNoteAttachment>;\n /** The send COMMITS — see `FeedbackNoteEditor`'s `commit`. */\n commit?: CommitScope;\n labels?: LabelOverride<FeedbackDetailLabels>;\n}\n\n/**\n * The rework editor (§4.4.5): the submitter — or the admin — sends an answered report\n * back with a note and at most one file, and the server reopens it (§3.4, keksdose\n * `submitRework`, `feedback-page.tsx:350`).\n *\n * - **The note is required** and trimmed: Send stays disabled on a blank box (a file\n * alone cannot be sent; keksdose `:577` dropped that click silently).\n * - **One file**, added, captured or pasted — the dialog's types and 10 MB. It is\n * uploaded FIRST and awaited: a body naming a file that never arrived would be a\n * rework whose evidence is missing, and the upload is the half that fails on its\n * own. If it fails nothing is sent and the toast says so; the note stays in the box.\n * - **The body alone goes in the PATCH** — {@link appendRework}'s strict extension of\n * the current body, which is how the server recognises the append and reopens the\n * row. Never a `status` (kastlan's client sent `OPEN`; an author may not write one,\n * so the server refused the whole PATCH, note and all — keksdose live #331).\n *\n * Exported on its own for an app that offers rework somewhere other than the row\n * detail. Kurvenschmiede's author verdict (\"That is it, done\") is NOT here: an answered\n * item stays answered unless its author sends it back (§7.2).\n */\nexport function FeedbackReworkSection({\n row,\n onUpdate,\n pending = false,\n onUpload,\n onCaptureScreenshot,\n onSent,\n onCancel,\n attachment,\n commit,\n labels: labelsProp,\n}: FeedbackReworkSectionProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n const toasts = useFeedbackToastLabels();\n const [uploading, setUploading] = useState(false);\n // The body as it is NOW, not as it was when Send was pressed: the list can refresh\n // while the file uploads, and an append to a stale body is no longer a strict\n // extension of the stored one — the server would read it as an edit, and refuse it.\n const latestBody = useRef(row.body);\n useEffect(() => {\n latestBody.current = row.body;\n }, [row.body]);\n\n const capture = onCaptureScreenshot\n ? async () => {\n try {\n return await onCaptureScreenshot();\n } catch {\n toast.error(toasts.captureFailed);\n return null;\n }\n }\n : undefined;\n\n const send = async (value: string, file?: File | null) => {\n const note = value.trim();\n if (!note) return;\n let url: string | null = null;\n if (file && onUpload) {\n setUploading(true);\n try {\n url = await onUpload(file);\n } catch {\n toast.error(labels.reworkUploadFailed);\n return;\n } finally {\n setUploading(false);\n }\n }\n let body: string | null;\n try {\n body = appendRework(latestBody.current, note, url);\n } catch {\n // The upload answered with something that is not an attachment URL of this\n // contract — written anyway it would sit in the body as prose no reader knows to\n // be a file. As far as the person is concerned, the file did not arrive.\n toast.error(labels.reworkUploadFailed);\n return;\n }\n if (body === null) return;\n onUpdate({ id: row.id, body }, { onSuccess: () => onSent?.() });\n };\n\n return (\n <FeedbackDetailSection title={labels.reworkTitle}>\n <FeedbackNoteEditor\n key={row.id}\n initial=\"\"\n required\n commit={commit}\n pending={pending || uploading}\n onSave={(value, file) => void send(value, file)}\n onCancel={onCancel}\n saveLabel={labels.reworkSend}\n cancelLabel={labels.cancel}\n placeholder={labels.reworkPlaceholder}\n attachment={\n onUpload\n ? {\n accept: FEEDBACK_ATTACHMENT_ACCEPT,\n maxBytes: DEFAULT_MAX_ATTACHMENT_BYTES,\n onError: (kind) => {\n toast.error(kind === \"type\" ? toasts.attachmentUnsupported : toasts.attachmentTooLarge);\n },\n onCaptureScreenshot: capture,\n ...attachment,\n }\n : undefined\n }\n />\n </FeedbackDetailSection>\n );\n}\n\n/* ── The detail (§4.4) ─────────────────────────────────────────────────────── */\n\nexport interface FeedbackRowDetailProps {\n /** The report — the list's own row, as `GET /feedback` / `GET /feedback/my` sent it. */\n row: FeedbackRecord;\n /** The admin on the inbox (`/feedback`): status pills and the outcome editor. `false`\n * on `/my-feedback`, for an admin too (§4.3). */\n canEdit: boolean;\n /** The signed-in user's id — who the AUTHOR is: the description editor and rework. */\n viewerId?: number | null;\n /** The page's PATCH — `update.mutate` (see {@link FeedbackDetailUpdate}). */\n onUpdate: FeedbackDetailUpdate;\n /** `update.isPending`: the editors' save buttons wait for it. */\n pending?: boolean;\n /** `POST /feedback/attachments` for the rework's one file. Left out, a rework is a\n * note alone. */\n onUpload?: FeedbackUpload;\n /** The app's authenticated GET (`AuthedImage`'s) — the pictures and the downloads go\n * through it, since the attachment route wants the bearer token (§3.5). Left out,\n * the browser's own fetch with same-origin cookies. */\n fetcher?: AuthedFetcher | null;\n /**\n * The undoable status change — what `useFeedbackStatusUndo(update.mutate)` returns,\n * the SAME one the table's status cell and the swipes use (§4.5). Left out, the\n * detail builds one from `onUpdate`, which is equivalent as long as `onUpdate` is the\n * page's mutation (its observer outlives the row a status filter removes).\n */\n statusChange?: FeedbackStatusChange;\n /** For the rework's \"Capture screenshot\" — see {@link FeedbackReworkSectionProps}. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The rework's file field, over the contract's defaults. */\n reworkAttachment?: Partial<FeedbackNoteAttachment>;\n /** How the `resolved_at` date reads — the app's date cell, as a string. Default: the\n * kit's `formatDate` in the provider's locale, `medium` style. */\n renderDate?: (iso: string) => string;\n /**\n * The detail's saves COMMIT (description, outcome, rework, status): under a locked\n * `WriteLockProvider` each is `aria-disabled` with the lock's reason, and nothing\n * reaches `onUpdate`. Off by default — keksdose's shell lock is a read-only demo\n * BUDGET, and a person viewing one still owns their own reports.\n */\n commit?: CommitScope;\n /**\n * Open with the subject: the category badge and the title (feedback contract §8.1,\n * keksdose live #395). On by default; `false` for a page that already shows the title\n * beside the detail.\n */\n showSubject?: boolean;\n /**\n * 0.38: `POST /feedback/{id}/replies` (§9.7) — the body and the status picked\n * (`undefined`: \"No change\"). With `canEdit` and a row that carries `replies`, the\n * reply composer stands under the timeline. Return the promise: the box clears when it\n * resolves.\n */\n onReply?: (body: string, status?: FeedbackStatus) => void | Promise<unknown>;\n /** 0.38: the reply is in flight. */\n replying?: boolean;\n /** 0.38: the report's comments — the app's `FeedbackCommentThread` — in a section of\n * their own under the replies. */\n comments?: ReactNode;\n /** 0.38: `PATCH /feedback/{id} {\"public\": next}` — draws the **Visible to others**\n * switch (`FeedbackPublicSwitch`) in the Status section, for the admin (`canEdit`)\n * and, within §9.3's window, the author. */\n onPublicChange?: (next: boolean) => void;\n labels?: LabelOverride<FeedbackDetailLabels>;\n className?: string;\n}\n\n/**\n * The expanded row of a feedback table (§4.4): what was reported, where, with which\n * files, what the answer was, and where it stands — with the edits each viewer may\n * make. Hand it to `DataTable`'s `expandedRow`:\n *\n * ```tsx\n * const update = useMutation({ mutationFn: ({ id, ...patch }) => api.updateFeedback(id, patch),\n * onSuccess: invalidate, onError: (e) => toast.error(detailOf(e) ?? toastLabels.updateFailed) });\n * const changeStatus = useFeedbackStatusUndo(update.mutate);\n * <DataTable\n * isExpanded={(row) => expandedId === row.id}\n * expandedRow={(row) => (\n * <FeedbackRowDetail row={row} canEdit={isAdmin && !mine} viewerId={user?.id}\n * onUpdate={update.mutate} pending={update.isPending} statusChange={changeStatus}\n * onUpload={api.uploadFeedbackAttachment} fetcher={authedImageFetcher}\n * onCaptureScreenshot={captureAppScreenshot} />\n * )} … />\n * ```\n *\n * Mounted only while its row is expanded, so which editor is open lives here, and\n * collapsing the row closes it. Each editor is keyed by the row's id, so a draft is\n * never thrown away by a list refresh under it.\n */\nexport function FeedbackRowDetail({\n row,\n canEdit,\n viewerId,\n onUpdate,\n pending = false,\n onUpload,\n fetcher,\n statusChange,\n onCaptureScreenshot,\n reworkAttachment,\n renderDate,\n commit,\n showSubject = true,\n onReply,\n replying = false,\n comments,\n onPublicChange,\n labels: labelsProp,\n className,\n}: FeedbackRowDetailProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n // \"placeholder = the dialog's body label\" (§4.4.1): read from the dialog's own\n // namespace, so the two can never say different things.\n const dialogText = useKitLabels(\"feedbackDialog\", DEFAULT_FEEDBACK_DIALOG_LABELS);\n const locale = useKitLocale();\n const ownStatusChange = useFeedbackStatusUndo(onUpdate);\n const changeStatus = statusChange ?? ownStatusChange;\n const [editingBody, setEditingBody] = useState(false);\n const [reworking, setReworking] = useState(false);\n\n const access = feedbackRowAccess(row, { canEdit, viewerId });\n // The body as written, without its file lines (they are shown as files below) — the\n // rework rounds stay in the prose: they are what was said after the answer.\n const bodyText = splitBodyAttachments(row.body).text;\n const { description } = splitDescription(row.body);\n const pageHref = feedbackPageHref(row.context);\n const pageUrl = feedbackPageUrl(row.context);\n const files = feedbackAttachmentUrls(row);\n const fetchFile = fetcher ?? plainFetch;\n const dateText = (iso: string) => (renderDate ? renderDate(iso) : formatDate(iso, \"medium\", { locale }));\n\n const saveDescription = (value: string) => {\n // Only a real change makes a round trip; clearing it is one (\"\" — the description\n // is optional, §7.4), and the rounds and file lines go back unchanged.\n if (value.trim() === description.trim()) {\n setEditingBody(false);\n return;\n }\n onUpdate({ id: row.id, body: replaceDescription(row.body, value) }, { onSuccess: () => setEditingBody(false) });\n };\n\n // 0.38 (§9.7): the replies replace the outcome; a row without them is a server before\n // 0.38, whose frozen outcome is shown as it is, read-only.\n const replies = row.replies;\n const commentLabels = useKitLabels(\"feedbackComments\", DEFAULT_FEEDBACK_COMMENTS_LABELS);\n const showRework = access.canRework && reworking;\n\n return (\n <FeedbackDetail className={className}>\n {showSubject && (\n <FeedbackDetailSection title={labels.subject}>\n <p className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm\" data-feedback-subject=\"\">\n <FeedbackCategoryBadge category={row.category} />\n <span className=\"min-w-0 font-medium text-primary [overflow-wrap:anywhere]\">\n {row.title}\n </span>\n </p>\n </FeedbackDetailSection>\n )}\n <FeedbackDetailSection\n title={labels.body}\n action={\n access.canEditDescription && !editingBody ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={(event) => {\n event.stopPropagation();\n setEditingBody(true);\n }}\n aria-label={labels.editDescription}\n >\n {labels.edit}\n </Button>\n ) : undefined\n }\n >\n {access.canEditDescription && editingBody ? (\n <FeedbackNoteEditor\n key={row.id}\n // The ORIGINAL description only — see the module note.\n initial={description}\n pending={pending}\n commit={commit}\n onSave={saveDescription}\n onCancel={() => setEditingBody(false)}\n saveLabel={labels.save}\n cancelLabel={labels.cancel}\n placeholder={dialogText.bodyOptional ?? dialogText.body}\n />\n ) : (\n <FeedbackProse>{bodyText.trim() ? bodyText : undefined}</FeedbackProse>\n )}\n </FeedbackDetailSection>\n\n {pageHref && pageUrl && (\n // The page it was filed on, with the full URL a click away (keksdose #278).\n <FeedbackDetailSection title={labels.url}>\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <TextLink href={pageHref} tone=\"secondary\" underline=\"hover\" stopPropagation className=\"min-w-0\">\n <code className=\"break-all text-xs\">{pageHref}</code>\n </TextLink>\n <CopyButton size=\"xs\" className=\"shrink-0\" text={pageUrl} label={labels.copyUrl} stopPropagation />\n </div>\n </FeedbackDetailSection>\n )}\n\n {files.length > 0 && (\n <FeedbackDetailSection title={labels.attachment}>\n <div className=\"flex min-w-0 flex-wrap items-start gap-2\">\n {files.map((url) =>\n isImageAttachment(url) ? (\n <AuthedImage\n key={url}\n src={url}\n alt={labels.attachment}\n fetcher={fetchFile}\n link\n stopPropagation\n // A broken attachment is simply not in the row (keksdose's\n // AuthedImage default) rather than a grey tile per failure.\n errorFallback={null}\n wrapperClassName=\"inline-block max-w-full\"\n className=\"max-h-64 max-w-full rounded border border-subtle\"\n />\n ) : (\n <AttachmentDownload key={url} url={url} fetcher={fetchFile} labels={labels} />\n ),\n )}\n </div>\n </FeedbackDetailSection>\n )}\n\n <FeedbackDetailSection\n title={replies ? labels.replies : labels.outcome}\n // When the row entered DONE / WONT_DO (keksdose feedback #96).\n action={\n row.resolved_at ? (\n <span className=\"text-xs text-muted\">{labels.resolvedAt(dateText(row.resolved_at))}</span>\n ) : undefined\n }\n >\n <div className=\"space-y-3\">\n {replies ? (\n <FeedbackReplyTimeline replies={replies} />\n ) : (\n <FeedbackProse>{row.outcome || undefined}</FeedbackProse>\n )}\n {replies && access.canEditOutcome && onReply && (\n <FeedbackReplyComposer\n key={row.id}\n status={row.status}\n onReply={onReply}\n pending={replying}\n suggestedStatus={feedbackReplyNudge(row)}\n commit={commit}\n />\n )}\n {((access.canRework && !reworking) || pageHref) && (\n <div className=\"flex flex-wrap gap-2\">\n {access.canRework && !reworking && (\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={(event) => {\n event.stopPropagation();\n setReworking(true);\n }}\n >\n <RotateCcw className=\"size-3.5\" aria-hidden /> {labels.rework}\n </Button>\n )}\n {pageHref && (\n // A real href (keksdose dev #451): middle-click and ⌘/Ctrl-click are\n // the browser's, and only a link has them.\n <Button href={pageHref} variant=\"secondary\" onClick={(event) => event.stopPropagation()}>\n <ExternalLink className=\"size-3.5\" aria-hidden /> {labels.openPage}\n </Button>\n )}\n </div>\n )}\n </div>\n </FeedbackDetailSection>\n\n {comments != null && (\n <FeedbackDetailSection title={commentLabels.comments}>{comments}</FeedbackDetailSection>\n )}\n\n {showRework && (\n <FeedbackReworkSection\n row={row}\n onUpdate={onUpdate}\n pending={pending}\n onUpload={onUpload}\n onCaptureScreenshot={onCaptureScreenshot}\n onSent={() => setReworking(false)}\n onCancel={() => setReworking(false)}\n attachment={reworkAttachment}\n commit={commit}\n labels={labelsProp}\n />\n )}\n\n <FeedbackDetailSection title={labels.status}>\n {/* Expanded: the whole enum in one click for the admin (keksdose feedback #421);\n everyone else the narrow set, read-only — a picture of the workflow. */}\n <FeedbackStatusTransitions\n status={row.status}\n statuses={\n access.canChangeStatus ? selectableFeedbackStatuses(row.status) : visibleFeedbackStatuses(row.status)\n }\n canEdit={access.canChangeStatus}\n commit={commit}\n onPick={(status) => changeStatus(row, status)}\n variant=\"pill\"\n />\n {onPublicChange && (\n <FeedbackPublicSwitch\n row={row}\n isAdmin={canEdit}\n viewerId={viewerId}\n onChange={onPublicChange}\n pending={pending}\n commit={commit}\n className=\"mt-3\"\n />\n )}\n </FeedbackDetailSection>\n </FeedbackDetail>\n );\n}\n"],"mappings":";AA+SI,SASE,KATF;AA/SJ,SAAS,WAAW,QAAQ,gBAAgB;AAE5C,SAAS,UAAU,cAAc,UAAU,iBAAiB;AAC5D,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB,SAAS,cAAc,oBAAwC;AAC/D,SAAS,yBAAyB,gBAAgB;AAClD,SAAS,kBAAkB;AAC3B,SAAS,oCAAoC;AAC7C,SAAS,sCAAsC;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,6BAA6B;AAGtC,SAAS,sCAAsC;AAC/C,SAAS,uBAAuB,uBAAuB,0BAA0B;AACjF,SAAS,4BAA4B;AACrC,SAAS,wCAAwC;AA8H1C,SAAS,wBAAwB,QAAoE;AAC1G,SAAO,aAAa,kBAAkB,gCAAgC,MAAM;AAC9E;AAMA,SAAS,UAAU,SAAyD;AAC1E,QAAM,OAAO,SAAS,OAAO,SAAS,SAAS,IAAI,KAAK;AACxD,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AAIF,UAAM,MAAM,IAAI,IAAI,KAAK,kBAAkB;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ACT;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA,WAAU;AAAA;AAAA,MACZ;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/feedback/feedback-row-detail.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport type { MouseEvent, ReactNode } from \"react\";\nimport { Download, ExternalLink, FileText, RotateCcw } from \"lucide-react\";\nimport { AuthedImage } from \"../components/authed-image\";\nimport { CopyButton } from \"../components/copy-button\";\nimport { TextLink } from \"../components/text-link\";\nimport { toast } from \"../components/toast\";\nimport { Button } from \"../components/button\";\nimport type { AuthedFetcher } from \"../hooks/use-authed-src\";\nimport { useKitLabels, useKitLocale, type LabelOverride } from \"../i18n/kit-labels\";\nimport { filenameFromDisposition, saveBlob } from \"../lib/download\";\nimport { formatDate } from \"../lib/format\";\nimport { DEFAULT_MAX_ATTACHMENT_BYTES } from \"./feedback-attachment\";\nimport { DEFAULT_FEEDBACK_DIALOG_LABELS } from \"./feedback-dialog\";\nimport {\n FeedbackCategoryBadge,\n FeedbackDetail,\n FeedbackDetailSection,\n FeedbackNoteEditor,\n FeedbackProse,\n FeedbackStatusTransitions,\n selectableFeedbackStatuses,\n visibleFeedbackStatuses,\n} from \"./feedback-inbox\";\nimport type { FeedbackNoteAttachment, FeedbackStatus } from \"./feedback-inbox\";\nimport { useFeedbackToastLabels } from \"./feedback-labels\";\nimport {\n FEEDBACK_ATTACHMENT_ACCEPT,\n FEEDBACK_AUTHOR_EDITABLE_STATUSES,\n FEEDBACK_REWORKABLE_STATUSES,\n appendRework,\n attachmentName,\n isImageAttachment,\n replaceDescription,\n splitBodyAttachments,\n splitDescription,\n} from \"./feedback-record\";\nimport type { FeedbackContext, FeedbackRecord } from \"./feedback-record\";\nimport { useFeedbackStatusUndo } from \"./feedback-status-undo\";\nimport type { FeedbackStatusChange } from \"./feedback-status-undo\";\nimport type { CommitScope } from \"../components/write-lock\";\nimport { DEFAULT_FEEDBACK_DETAIL_LABELS } from \"./feedback-row-detail-labels\";\nimport { FeedbackReplyComposer, FeedbackReplyTimeline, feedbackReplyNudge } from \"./feedback-replies\";\nimport { FeedbackPublicSwitch } from \"./feedback-public-switch\";\nimport { FeedbackRepliesDrawnAboveContext } from \"./feedback-replies-context\";\nimport { DEFAULT_FEEDBACK_COMMENTS_LABELS } from \"./feedback-thread-parts-labels\";\n\n/**\n * One report, opened — the panel a feedback table unfolds under its row (§4.4 of\n * docs/feedback-harmonization.md), lifted from keksdose's `FeedbackRow`\n * (`frontend/src/features/feedback/feedback-page.tsx:329-612`) with the contract's\n * changes applied.\n *\n * Until 0.27 each app wrote this panel itself out of the kit's shell\n * (`FeedbackDetail` / `FeedbackDetailSection` / `FeedbackNoteEditor`), and the three\n * copies had drifted in exactly the places a user notices:\n *\n * - **the description editor held the raw body** — keksdose `initial={fb.body}`\n * (`:420`), kastlan the same (`pages/feedback-page.tsx:226`) — so an author fixing a\n * typo could delete the `--- REWORK … ---` rounds and the `[screenshot]` file lines\n * with it, and the history was gone. Here the editor holds the ORIGINAL description\n * only ({@link splitDescription}) and saves through {@link replaceDescription}, which\n * puts every appended block and file line back unchanged;\n * - **kastlan's rework sent `status: \"OPEN\"`** from the client (`:189-195`) and offered it\n * on three statuses; keksdose sends the body alone and lets the server reopen the row\n * on five (live #331). The contract is keksdose's (§3.4) — {@link appendRework}, one\n * file, the server reopens;\n * - **kastlan showed only `screenshot_url`** (`:265-276`) and no downloads; keksdose the\n * screenshot, the other files and the rework pictures, a PDF as a download (dev #578);\n * - **the URL fell away on Kurvenschmiede's rows**, whose backfilled `context.url` is a\n * path (`/accounts?p=2`): keksdose's `new URL(…)` throws on one and the section\n * vanished. kastlan already fell back to `context.route` (`feedbackRaw`, `:97`).\n *\n * The sections, in the contract's order: **Subject** (the category and the title, §8.1;\n * `showSubject={false}` leaves it out), **Description** (the body; the author's\n * Edit while OPEN / READY / IN_PROGRESS), **URL**, **Attachment**, **Replies** (0.38,\n * §9.7: the timeline, the admin's reply composer with its status picker and the nudge,\n * Rework, Open page — on a row without `replies`, a server before 0.38, the frozen\n * **Outcome** read-only in its place), **Comments** (0.38: the app's\n * `FeedbackCommentThread`, when passed), **Send for rework** (only while reworking) and\n * **Status** (with the **Visible to others** switch when `onPublicChange` is passed).\n *\n * The app keeps its data and its API: the row it renders, the PATCH (`onUpdate`), the\n * upload (`onUpload`), the authenticated GET (`fetcher`) and who is looking (`canEdit`,\n * `viewerId`). Every word is the kit's `feedbackDetail` namespace.\n */\n\n/* ── Labels ───────────────────────────────────────────────────────────────── */\n\n/**\n * `feedbackDetail` — the row detail's words (§4.4). English: keksdose's `en.json`\n * (`feedback.*`, `common.*`, `more.copy_url`) with the contract's changes; the de-CH\n * canon (keksdose `de-CH.json`, ss never ß, \"Nacharbeit\" throughout — §7.14) on each key.\n */\nexport interface FeedbackDetailLabels {\n /** The first section's heading: what the report is called (feedback contract §8.1,\n * keksdose live #395 — with the row expanded and the table scrolled, nothing said\n * which entry was being answered). de-CH: \"Betreff\" */\n subject: string;\n /** The description section's heading — keksdose's `feedback.body` (§7.3). The dialog's field asks\n * \"What happened? (optional)\"; the description, once filed, is headed as what it is\n * — and as the author's \"Edit description\" calls it. de-CH: \"Beschreibung\" */\n body: string;\n /** The author's button on that heading. de-CH: \"Bearbeiten\" */\n edit: string;\n /** Its accessible name — says WHAT is edited; contains the visible word.\n * de-CH: \"Beschreibung bearbeiten\" */\n editDescription: string;\n /** The editors' save button (description, outcome). de-CH: \"Speichern\" */\n save: string;\n /** Every editor's cancel button. de-CH: \"Abbrechen\" */\n cancel: string;\n /** Section 2's heading. de-CH: \"URL\" */\n url: string;\n /** The copy button beside the link — copies the FULL `context.url`.\n * de-CH: \"URL kopieren\" */\n copyUrl: string;\n /** Section 3's heading, and each picture's alt text. de-CH: \"Anhang\" */\n attachment: string;\n /** A PDF's / text file's download button, given the file's name.\n * de-CH: \"{{name}} herunterladen\" */\n download: (name: string) => string;\n /** The toast when that download failed. de-CH: \"Der Anhang konnte nicht\n * heruntergeladen werden.\" */\n downloadFailed: string;\n /** Section 4's heading on a row without `replies` (a server before 0.38), where the\n * frozen outcome is shown read-only. de-CH: \"Ergebnis\" */\n outcome: string;\n /** Section 4's heading since 0.38: the replies' timeline (§9.7). de-CH: \"Antworten\" */\n replies: string;\n /** On section 4's heading line once the row is settled, given the formatted\n * `resolved_at` date. de-CH: \"Erledigt am: {{date}}\" */\n resolvedAt: (date: string) => string;\n /** The admin's button while there is no outcome. **Unused since 0.38** (the outcome is\n * frozen, §9.7; a reply is written instead); kept for one release.\n * de-CH: \"Ergebnis hinzufügen\" */\n outcomeAdd: string;\n /** The same button once there is one. Unused since 0.38, as `outcomeAdd`.\n * de-CH: \"Aktualisieren\" */\n outcomeUpdate: string;\n /** The line above the outcome editor. Unused since 0.38, as `outcomeAdd`. de-CH: \"Was wurde umgesetzt, entschieden oder\n * warum nicht.\" */\n outcomePlaceholder: string;\n /** The button that opens section 5 on an answered row. de-CH: \"Nacharbeit\" */\n rework: string;\n /** The link to the page the report was filed on. de-CH: \"Seite öffnen\" */\n openPage: string;\n /** Section 5's heading. de-CH: \"Zur Nacharbeit senden\" */\n reworkTitle: string;\n /** Section 5's send button. de-CH: \"Nacharbeit senden\" */\n reworkSend: string;\n /** The line above the rework note. de-CH: \"Was muss noch angepasst werden? Neue\n * Anforderungen oder Richtungswechsel.\" */\n reworkPlaceholder: string;\n /** The toast when the rework's file did not upload — and so nothing was sent. Names\n * no screenshot: it fires for a PDF or a log too (§7.14; keksdose's said\n * \"screenshot\"). de-CH: \"Die Datei konnte nicht hochgeladen werden. Die Nacharbeit\n * wurde nicht gesendet.\" */\n reworkUploadFailed: string;\n /** Section 6's heading. de-CH: \"Status\" */\n status: string;\n /** A `FeedbackNoteEditor`'s box, named when no `placeholder` line names it and the\n * caller gives no `label` — without it the box was read out as just \"edit text\"\n * (round 0.34, the showcase's axe check). de-CH: \"Notiz\" */\n note: string;\n}\n\n// Defined in ./feedback-row-detail-labels, which holds no component code (0.34, KS U8).\nexport { DEFAULT_FEEDBACK_DETAIL_LABELS };\n\n/** `feedbackDetail` resolved: English, then `<UiKitProvider labels>`, then `labels`. */\nexport function useFeedbackDetailLabels(labels?: LabelOverride<FeedbackDetailLabels>): FeedbackDetailLabels {\n return useKitLabels(\"feedbackDetail\", DEFAULT_FEEDBACK_DETAIL_LABELS, labels);\n}\n\n/* ── The page a report was filed on (§3.2, §4.4.2) ────────────────────────── */\n\n/** `context.url`, else `context.route` — a parsed URL, or null when neither is set or\n * the value is no http(s) address or path (a `javascript:` value is not a page). */\nfunction parsePage(context: FeedbackContext | null | undefined): URL | null {\n const raw = (context?.url || context?.route || \"\").trim();\n if (!raw) return null;\n try {\n // A base, so a PATH-ONLY value parses too: Kurvenschmiede backfills its old rows\n // with `url = page_path + search` (§3.2), and keksdose's `new URL(raw)` threw on\n // those and dropped the section.\n const url = new URL(raw, \"http://localhost\");\n return url.protocol === \"http:\" || url.protocol === \"https:\" ? url : null;\n } catch {\n return null;\n }\n}\n\n/** Collapses a leading `//` run: `/\\/\\/evil.example/` as a path would be a\n * protocol-relative link off the app. */\nconst localPath = (pathname: string) => pathname.replace(/^\\/{2,}/, \"/\");\n\n/**\n * The in-app link to the page a report was filed on — path + query + hash (keksdose\n * `localHref`: the query and hash carry the state worth restoring, `?tab=import`, a\n * drill-down). Read from `context.url`, else `context.route`; a path-only `url` works.\n * Always a path on THIS app, never another origin's address, so it is safe as an\n * `href` whatever the row says. `null` when there is nothing to link.\n */\nexport function feedbackPageHref(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? `${localPath(url.pathname)}${url.search}${url.hash}` : null;\n}\n\n/** The page's path alone — the compact text a URL column shows (§4.3). */\nexport function feedbackPagePath(context: FeedbackContext | null | undefined): string | null {\n const url = parsePage(context);\n return url ? localPath(url.pathname) : null;\n}\n\n/**\n * What \"Copy URL\" copies: the FULL `context.url` as the reporter's browser had it —\n * origin included, which is the one part that says which copy of the app it was\n * (feedback #278) — else `context.route`. `null` when there is no page.\n */\nexport function feedbackPageUrl(context: FeedbackContext | null | undefined): string | null {\n if (!parsePage(context)) return null;\n return (context?.url || context?.route || \"\").trim();\n}\n\n/* ── Attachments (§3.5, §4.4.3) ───────────────────────────────────────────── */\n\n/**\n * Every file a report carries, in the order the detail shows them (§4.4.3): the\n * screenshot it was filed with, then its other files, then whatever the rework rounds\n * brought, in body order (keksdose dev #578, live #291). One list rather than three —\n * a reader looking for \"the picture\" should not have to know at which point in the\n * conversation it was taken.\n *\n * Each URL once: keksdose and Kurvenschmiede content-address their keys, so the same\n * screenshot pasted twice is one URL — shown twice it is the same picture twice (and,\n * keyed by URL, a React key clash keksdose had).\n */\nexport function feedbackAttachmentUrls(\n row: Pick<FeedbackRecord, \"screenshot_url\" | \"attachment_urls\" | \"body\">,\n): string[] {\n const urls = [\n ...(row.screenshot_url ? [row.screenshot_url] : []),\n // `?? []`: NULL on rows filed before the column, and no key at all from a server\n // that predates it (keksdose dev #578).\n ...(row.attachment_urls ?? []),\n ...splitBodyAttachments(row.body).urls,\n ];\n return [...new Set(urls)];\n}\n\n/** The bytes behind a fetcher's answer — a `Blob` as it is, a `Response` checked. */\nasync function toBlob(answer: Blob | Response): Promise<Blob> {\n if (typeof Response !== \"undefined\" && answer instanceof Response) {\n if (!answer.ok) throw new Error(`HTTP ${answer.status}`);\n return answer.blob();\n }\n return answer as Blob;\n}\n\n/** No fetcher: the browser's own `fetch`, with the cookies a same-origin app uses. */\nconst plainFetch: AuthedFetcher = (url, { signal }) => fetch(url, { signal, credentials: \"same-origin\" });\n\n/**\n * A PDF or a text log (keksdose `FeedbackFileDownload`, dev #578): the bytes sit behind\n * an authenticated route that serves them as `attachment`, never inline (§3.5), so a\n * plain link would be a 401 the moment it was opened. Fetched through the app's\n * fetcher and saved with {@link saveBlob}; a failure says so in a toast.\n *\n * Saved under the name the server gives it when the fetcher answers with a `Response`\n * (server-kit's `content_disposition` puts the uploader's own name in `filename*`), and\n * under the URL's last segment — the name on the button — when it answers with a bare\n * `Blob`, which has no headers to ask.\n */\nfunction AttachmentDownload({\n url,\n fetcher,\n labels,\n}: {\n url: string;\n fetcher: AuthedFetcher;\n labels: FeedbackDetailLabels;\n}) {\n const [busy, setBusy] = useState(false);\n const name = attachmentName(url);\n const download = async (event: MouseEvent) => {\n // The row around the detail may toggle on a click.\n event.stopPropagation();\n setBusy(true);\n try {\n const answer = await fetcher(url, { signal: new AbortController().signal });\n const blob = await toBlob(answer);\n const saveAs =\n typeof Response !== \"undefined\" && answer instanceof Response\n ? filenameFromDisposition(answer.headers.get(\"Content-Disposition\"), name)\n : name;\n saveBlob(blob, saveAs);\n } catch {\n toast.error(labels.downloadFailed);\n } finally {\n setBusy(false);\n }\n };\n return (\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n pending={busy}\n onClick={(event) => void download(event)}\n aria-label={labels.download(name)}\n className=\"max-w-full\"\n >\n <FileText className=\"size-3.5 shrink-0\" aria-hidden />\n <span className=\"min-w-0 max-w-[14rem] truncate-until-large\">{name}</span>\n <Download className=\"size-3.5 shrink-0\" aria-hidden />\n </Button>\n );\n}\n\n/* ── Who may do what (§3.4, §4.3, §4.4) ───────────────────────────────────── */\n\n/** What the person looking at a row may do with it — {@link feedbackRowAccess}. */\nexport interface FeedbackRowAccess {\n /** The viewer filed it (`viewerId === row.user_id`; never for an erased author). */\n isAuthor: boolean;\n /** \"Edit description\": the author, while the row is OPEN, READY or IN_PROGRESS — on either\n * page (keksdose `canAuthorEdit`, `feedback-page.tsx:398`, is not gated on `mine`). */\n canEditDescription: boolean;\n /** The admin on the inbox (`canEdit`): since 0.38 the reply composer (the outcome\n * itself is frozen, §9.7). */\n canEditOutcome: boolean;\n /** \"Rework\": the admin or the author, on an answered row\n * ({@link FEEDBACK_REWORKABLE_STATUSES}) — §3.4, anyone else gets the server's 403. */\n canRework: boolean;\n /** The status pills: the admin on the inbox; everyone else sees them read-only. */\n canChangeStatus: boolean;\n}\n\n/**\n * The detail's permission rules in one place — the same answers the server gives\n * (§3.4), so the panel never offers what the PATCH would refuse.\n *\n * `canEdit` is the app's \"admin on `/feedback`\": an admin on `/my-feedback` edits no\n * status and no outcome there (§4.3), but as the author still edits the description\n * and sends for rework. `viewerId` is the signed-in user's id.\n */\nexport function feedbackRowAccess(\n row: Pick<FeedbackRecord, \"user_id\" | \"status\">,\n { canEdit, viewerId }: { canEdit: boolean; viewerId?: number | null },\n): FeedbackRowAccess {\n // `user_id: null` is an erased author (keksdose live #275): nobody is that author,\n // least of all a viewer whose id happens to be missing too.\n const isAuthor = row.user_id !== null && viewerId !== undefined && viewerId !== null && viewerId === row.user_id;\n return {\n isAuthor,\n canEditDescription: isAuthor && FEEDBACK_AUTHOR_EDITABLE_STATUSES.includes(row.status),\n canEditOutcome: canEdit,\n canRework: (canEdit || isAuthor) && FEEDBACK_REWORKABLE_STATUSES.includes(row.status),\n canChangeStatus: canEdit,\n };\n}\n\n/* ── The PATCH ─────────────────────────────────────────────────────────────── */\n\n/** What the detail sends as `PATCH /feedback/{id}` (§3.4): the body (a description\n * edit, a rework append) or the outcome — and, through {@link useFeedbackStatusUndo}\n * when no `statusChange` is given, the status. Never two at once: a rework PATCH must\n * carry the body ALONE for the server to read it as an append (keksdose live #331). */\nexport interface FeedbackDetailPatch {\n id: number;\n body?: string;\n /** `null` clears it — a real edit. **Frozen since 0.38** (§9.7): server-kit 0.11\n * answers 422; the detail no longer sends it (a reply is written instead). */\n outcome?: string | null;\n status?: FeedbackStatus;\n /** 0.38.1: the **Visible to others** flip (§9.3) — what `onPublicChange`'s\n * `PATCH /feedback/{id} {\"public\": next}` carries, alone, so an app can send it\n * through the same `onUpdate` mutation. */\n public?: boolean;\n}\n\n/**\n * The page's update mutation. **TanStack Query's `mutate` fits as it stands** — pass\n * `update.mutate` (and `pending={update.isPending}`), the same function\n * `useFeedbackStatusUndo` takes. A hand-written one sends the PATCH and calls\n * `onSuccess` once it has landed, and only then: that is when an editor closes. A\n * failure is the mutation's own to toast — the server's `detail`, else\n * `feedbackToast.updateFailed` (§4.4) — and leaves the editor open with its draft.\n */\nexport type FeedbackDetailUpdate = (patch: FeedbackDetailPatch, callbacks: { onSuccess: () => void }) => void;\n\n/** `POST /feedback/attachments` (§3.3): one file up, its URL\n * (`/api/v1/feedback/attachments/<key>`) back. Reject on failure. */\nexport type FeedbackUpload = (file: File) => Promise<string>;\n\n/* ── Send for rework (§4.4.5) ─────────────────────────────────────────────── */\n\nexport interface FeedbackReworkSectionProps {\n /** The row being sent back: its id, and the body the round is appended to. */\n row: Pick<FeedbackRecord, \"id\" | \"body\">;\n /** The PATCH — see {@link FeedbackDetailUpdate}. Called with `{ id, body }` only. */\n onUpdate: FeedbackDetailUpdate;\n /** The PATCH is in flight (`update.isPending`). The upload adds its own. */\n pending?: boolean;\n /** The upload. Left out, the note goes without a file field. */\n onUpload?: FeedbackUpload;\n /** Snapshot the app view as a File — the kit's `captureAppScreenshot`, or the app's\n * own. A \"Capture screenshot\" button appears only with it; a rejection (no\n * `modern-screenshot`, a canvas that would not draw) toasts\n * `feedbackToast.captureFailed` and adds nothing. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The round landed — the server has the note and, on an answered row, reopened it. */\n onSent?: () => void;\n onCancel: () => void;\n /** Over the field's defaults: the contract's types and 10 MB (§3.5), the\n * `feedbackToast` refusals, the `feedbackAttachment` words. */\n attachment?: Partial<FeedbackNoteAttachment>;\n /** The send COMMITS — see `FeedbackNoteEditor`'s `commit`. */\n commit?: CommitScope;\n labels?: LabelOverride<FeedbackDetailLabels>;\n}\n\n/**\n * The rework editor (§4.4.5): the submitter — or the admin — sends an answered report\n * back with a note and at most one file, and the server reopens it (§3.4, keksdose\n * `submitRework`, `feedback-page.tsx:350`).\n *\n * - **The note is required** and trimmed: Send stays disabled on a blank box (a file\n * alone cannot be sent; keksdose `:577` dropped that click silently).\n * - **One file**, added, captured or pasted — the dialog's types and 10 MB. It is\n * uploaded FIRST and awaited: a body naming a file that never arrived would be a\n * rework whose evidence is missing, and the upload is the half that fails on its\n * own. If it fails nothing is sent and the toast says so; the note stays in the box.\n * - **The body alone goes in the PATCH** — {@link appendRework}'s strict extension of\n * the current body, which is how the server recognises the append and reopens the\n * row. Never a `status` (kastlan's client sent `OPEN`; an author may not write one,\n * so the server refused the whole PATCH, note and all — keksdose live #331).\n *\n * Exported on its own for an app that offers rework somewhere other than the row\n * detail. Kurvenschmiede's author verdict (\"That is it, done\") is NOT here: an answered\n * item stays answered unless its author sends it back (§7.2).\n */\nexport function FeedbackReworkSection({\n row,\n onUpdate,\n pending = false,\n onUpload,\n onCaptureScreenshot,\n onSent,\n onCancel,\n attachment,\n commit,\n labels: labelsProp,\n}: FeedbackReworkSectionProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n const toasts = useFeedbackToastLabels();\n const [uploading, setUploading] = useState(false);\n // The body as it is NOW, not as it was when Send was pressed: the list can refresh\n // while the file uploads, and an append to a stale body is no longer a strict\n // extension of the stored one — the server would read it as an edit, and refuse it.\n const latestBody = useRef(row.body);\n useEffect(() => {\n latestBody.current = row.body;\n }, [row.body]);\n\n const capture = onCaptureScreenshot\n ? async () => {\n try {\n return await onCaptureScreenshot();\n } catch {\n toast.error(toasts.captureFailed);\n return null;\n }\n }\n : undefined;\n\n const send = async (value: string, file?: File | null) => {\n const note = value.trim();\n if (!note) return;\n let url: string | null = null;\n if (file && onUpload) {\n setUploading(true);\n try {\n url = await onUpload(file);\n } catch {\n toast.error(labels.reworkUploadFailed);\n return;\n } finally {\n setUploading(false);\n }\n }\n let body: string | null;\n try {\n body = appendRework(latestBody.current, note, url);\n } catch {\n // The upload answered with something that is not an attachment URL of this\n // contract — written anyway it would sit in the body as prose no reader knows to\n // be a file. As far as the person is concerned, the file did not arrive.\n toast.error(labels.reworkUploadFailed);\n return;\n }\n if (body === null) return;\n onUpdate({ id: row.id, body }, { onSuccess: () => onSent?.() });\n };\n\n return (\n <FeedbackDetailSection title={labels.reworkTitle}>\n <FeedbackNoteEditor\n key={row.id}\n initial=\"\"\n required\n commit={commit}\n pending={pending || uploading}\n onSave={(value, file) => void send(value, file)}\n onCancel={onCancel}\n saveLabel={labels.reworkSend}\n cancelLabel={labels.cancel}\n placeholder={labels.reworkPlaceholder}\n attachment={\n onUpload\n ? {\n accept: FEEDBACK_ATTACHMENT_ACCEPT,\n maxBytes: DEFAULT_MAX_ATTACHMENT_BYTES,\n onError: (kind) => {\n toast.error(kind === \"type\" ? toasts.attachmentUnsupported : toasts.attachmentTooLarge);\n },\n onCaptureScreenshot: capture,\n ...attachment,\n }\n : undefined\n }\n />\n </FeedbackDetailSection>\n );\n}\n\n/* ── The detail (§4.4) ─────────────────────────────────────────────────────── */\n\nexport interface FeedbackRowDetailProps {\n /** The report — the list's own row, as `GET /feedback` / `GET /feedback/my` sent it. */\n row: FeedbackRecord;\n /** The admin on the inbox (`/feedback`): status pills and the outcome editor. `false`\n * on `/my-feedback`, for an admin too (§4.3). */\n canEdit: boolean;\n /** The signed-in user's id — who the AUTHOR is: the description editor and rework. */\n viewerId?: number | null;\n /** The page's PATCH — `update.mutate` (see {@link FeedbackDetailUpdate}). */\n onUpdate: FeedbackDetailUpdate;\n /** `update.isPending`: the editors' save buttons wait for it. */\n pending?: boolean;\n /** `POST /feedback/attachments` for the rework's one file. Left out, a rework is a\n * note alone. */\n onUpload?: FeedbackUpload;\n /** The app's authenticated GET (`AuthedImage`'s) — the pictures and the downloads go\n * through it, since the attachment route wants the bearer token (§3.5). Left out,\n * the browser's own fetch with same-origin cookies. */\n fetcher?: AuthedFetcher | null;\n /**\n * The undoable status change — what `useFeedbackStatusUndo(update.mutate)` returns,\n * the SAME one the table's status cell and the swipes use (§4.5). Left out, the\n * detail builds one from `onUpdate`, which is equivalent as long as `onUpdate` is the\n * page's mutation (its observer outlives the row a status filter removes).\n */\n statusChange?: FeedbackStatusChange;\n /** For the rework's \"Capture screenshot\" — see {@link FeedbackReworkSectionProps}. */\n onCaptureScreenshot?: () => Promise<File | null>;\n /** The rework's file field, over the contract's defaults. */\n reworkAttachment?: Partial<FeedbackNoteAttachment>;\n /** How the `resolved_at` date reads — the app's date cell, as a string. Default: the\n * kit's `formatDate` in the provider's locale, `medium` style. */\n renderDate?: (iso: string) => string;\n /**\n * The detail's saves COMMIT (description, outcome, rework, status): under a locked\n * `WriteLockProvider` each is `aria-disabled` with the lock's reason, and nothing\n * reaches `onUpdate`. Off by default — keksdose's shell lock is a read-only demo\n * BUDGET, and a person viewing one still owns their own reports.\n */\n commit?: CommitScope;\n /**\n * Open with the subject: the category badge and the title (feedback contract §8.1,\n * keksdose live #395). On by default; `false` for a page that already shows the title\n * beside the detail.\n */\n showSubject?: boolean;\n /**\n * 0.38: `POST /feedback/{id}/replies` (§9.7) — the body and the status picked\n * (`undefined`: \"No change\"). With `canEdit` and a row that carries `replies`, the\n * reply composer stands under the timeline. Return the promise: the box clears when it\n * resolves. A failure is the app's to toast — the server's `detail`, else\n * `feedbackToast.replyFailed` (0.38.1).\n */\n onReply?: (body: string, status?: FeedbackStatus) => void | Promise<unknown>;\n /** 0.38: the reply is in flight. */\n replying?: boolean;\n /** 0.38: the report's comments — the app's `FeedbackCommentThread` — in a section of\n * their own under the replies. A thread here draws the comments alone (0.38.1): the\n * Replies section above has the replies, so whatever `replies` the thread is handed\n * are dropped, and nothing is drawn twice. */\n comments?: ReactNode;\n /** 0.38: `PATCH /feedback/{id} {\"public\": next}` — draws the **Visible to others**\n * switch (`FeedbackPublicSwitch`) in the Status section, for the admin (`canEdit`)\n * and, within §9.3's window, the author. The page's own mutation fits:\n * `onPublicChange={(next) => update.mutate({ id: row.id, public: next })}` —\n * {@link FeedbackDetailPatch}'s `public` (0.38.1). */\n onPublicChange?: (next: boolean) => void;\n labels?: LabelOverride<FeedbackDetailLabels>;\n className?: string;\n}\n\n/**\n * The expanded row of a feedback table (§4.4): what was reported, where, with which\n * files, what the answer was, and where it stands — with the edits each viewer may\n * make. Hand it to `DataTable`'s `expandedRow`:\n *\n * ```tsx\n * const update = useMutation({ mutationFn: ({ id, ...patch }) => api.updateFeedback(id, patch),\n * onSuccess: invalidate, onError: (e) => toast.error(detailOf(e) ?? toastLabels.updateFailed) });\n * const changeStatus = useFeedbackStatusUndo(update.mutate);\n * <DataTable\n * isExpanded={(row) => expandedId === row.id}\n * expandedRow={(row) => (\n * <FeedbackRowDetail row={row} canEdit={isAdmin && !mine} viewerId={user?.id}\n * onUpdate={update.mutate} pending={update.isPending} statusChange={changeStatus}\n * onUpload={api.uploadFeedbackAttachment} fetcher={authedImageFetcher}\n * onCaptureScreenshot={captureAppScreenshot} />\n * )} … />\n * ```\n *\n * Mounted only while its row is expanded, so which editor is open lives here, and\n * collapsing the row closes it. Each editor is keyed by the row's id, so a draft is\n * never thrown away by a list refresh under it.\n */\nexport function FeedbackRowDetail({\n row,\n canEdit,\n viewerId,\n onUpdate,\n pending = false,\n onUpload,\n fetcher,\n statusChange,\n onCaptureScreenshot,\n reworkAttachment,\n renderDate,\n commit,\n showSubject = true,\n onReply,\n replying = false,\n comments,\n onPublicChange,\n labels: labelsProp,\n className,\n}: FeedbackRowDetailProps) {\n const labels = useFeedbackDetailLabels(labelsProp);\n // \"placeholder = the dialog's body label\" (§4.4.1): read from the dialog's own\n // namespace, so the two can never say different things.\n const dialogText = useKitLabels(\"feedbackDialog\", DEFAULT_FEEDBACK_DIALOG_LABELS);\n const locale = useKitLocale();\n const ownStatusChange = useFeedbackStatusUndo(onUpdate);\n const changeStatus = statusChange ?? ownStatusChange;\n const [editingBody, setEditingBody] = useState(false);\n const [reworking, setReworking] = useState(false);\n\n const access = feedbackRowAccess(row, { canEdit, viewerId });\n // The body as written, without its file lines (they are shown as files below) — the\n // rework rounds stay in the prose: they are what was said after the answer.\n const bodyText = splitBodyAttachments(row.body).text;\n const { description } = splitDescription(row.body);\n const pageHref = feedbackPageHref(row.context);\n const pageUrl = feedbackPageUrl(row.context);\n const files = feedbackAttachmentUrls(row);\n const fetchFile = fetcher ?? plainFetch;\n const dateText = (iso: string) => (renderDate ? renderDate(iso) : formatDate(iso, \"medium\", { locale }));\n\n const saveDescription = (value: string) => {\n // Only a real change makes a round trip; clearing it is one (\"\" — the description\n // is optional, §7.4), and the rounds and file lines go back unchanged.\n if (value.trim() === description.trim()) {\n setEditingBody(false);\n return;\n }\n onUpdate({ id: row.id, body: replaceDescription(row.body, value) }, { onSuccess: () => setEditingBody(false) });\n };\n\n // 0.38 (§9.7): the replies replace the outcome; a row without them is a server before\n // 0.38, whose frozen outcome is shown as it is, read-only.\n const replies = row.replies;\n const commentLabels = useKitLabels(\"feedbackComments\", DEFAULT_FEEDBACK_COMMENTS_LABELS);\n const showRework = access.canRework && reworking;\n\n return (\n <FeedbackDetail className={className}>\n {showSubject && (\n <FeedbackDetailSection title={labels.subject}>\n <p className=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm\" data-feedback-subject=\"\">\n <FeedbackCategoryBadge category={row.category} />\n <span className=\"min-w-0 font-medium text-primary [overflow-wrap:anywhere]\">\n {row.title}\n </span>\n </p>\n </FeedbackDetailSection>\n )}\n <FeedbackDetailSection\n title={labels.body}\n action={\n access.canEditDescription && !editingBody ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={(event) => {\n event.stopPropagation();\n setEditingBody(true);\n }}\n aria-label={labels.editDescription}\n >\n {labels.edit}\n </Button>\n ) : undefined\n }\n >\n {access.canEditDescription && editingBody ? (\n <FeedbackNoteEditor\n key={row.id}\n // The ORIGINAL description only — see the module note.\n initial={description}\n pending={pending}\n commit={commit}\n onSave={saveDescription}\n onCancel={() => setEditingBody(false)}\n saveLabel={labels.save}\n cancelLabel={labels.cancel}\n placeholder={dialogText.bodyOptional ?? dialogText.body}\n />\n ) : (\n <FeedbackProse>{bodyText.trim() ? bodyText : undefined}</FeedbackProse>\n )}\n </FeedbackDetailSection>\n\n {pageHref && pageUrl && (\n // The page it was filed on, with the full URL a click away (keksdose #278).\n <FeedbackDetailSection title={labels.url}>\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <TextLink href={pageHref} tone=\"secondary\" underline=\"hover\" stopPropagation className=\"min-w-0\">\n <code className=\"break-all text-xs\">{pageHref}</code>\n </TextLink>\n <CopyButton size=\"xs\" className=\"shrink-0\" text={pageUrl} label={labels.copyUrl} stopPropagation />\n </div>\n </FeedbackDetailSection>\n )}\n\n {files.length > 0 && (\n <FeedbackDetailSection title={labels.attachment}>\n <div className=\"flex min-w-0 flex-wrap items-start gap-2\">\n {files.map((url) =>\n isImageAttachment(url) ? (\n <AuthedImage\n key={url}\n src={url}\n alt={labels.attachment}\n fetcher={fetchFile}\n link\n stopPropagation\n // A broken attachment is simply not in the row (keksdose's\n // AuthedImage default) rather than a grey tile per failure.\n errorFallback={null}\n wrapperClassName=\"inline-block max-w-full\"\n className=\"max-h-64 max-w-full rounded border border-subtle\"\n />\n ) : (\n <AttachmentDownload key={url} url={url} fetcher={fetchFile} labels={labels} />\n ),\n )}\n </div>\n </FeedbackDetailSection>\n )}\n\n <FeedbackDetailSection\n title={replies ? labels.replies : labels.outcome}\n // When the row entered DONE / WONT_DO (keksdose feedback #96).\n action={\n row.resolved_at ? (\n <span className=\"text-xs text-muted\">{labels.resolvedAt(dateText(row.resolved_at))}</span>\n ) : undefined\n }\n >\n <div className=\"space-y-3\">\n {replies ? (\n <FeedbackReplyTimeline replies={replies} />\n ) : (\n <FeedbackProse>{row.outcome || undefined}</FeedbackProse>\n )}\n {replies && access.canEditOutcome && onReply && (\n <FeedbackReplyComposer\n key={row.id}\n status={row.status}\n onReply={onReply}\n pending={replying}\n suggestedStatus={feedbackReplyNudge(row)}\n commit={commit}\n />\n )}\n {((access.canRework && !reworking) || pageHref) && (\n <div className=\"flex flex-wrap gap-2\">\n {access.canRework && !reworking && (\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={(event) => {\n event.stopPropagation();\n setReworking(true);\n }}\n >\n <RotateCcw className=\"size-3.5\" aria-hidden /> {labels.rework}\n </Button>\n )}\n {pageHref && (\n // A real href (keksdose dev #451): middle-click and ⌘/Ctrl-click are\n // the browser's, and only a link has them.\n <Button href={pageHref} variant=\"secondary\" onClick={(event) => event.stopPropagation()}>\n <ExternalLink className=\"size-3.5\" aria-hidden /> {labels.openPage}\n </Button>\n )}\n </div>\n )}\n </div>\n </FeedbackDetailSection>\n\n {comments != null && (\n <FeedbackDetailSection title={commentLabels.comments}>\n <FeedbackRepliesDrawnAboveContext.Provider value>{comments}</FeedbackRepliesDrawnAboveContext.Provider>\n </FeedbackDetailSection>\n )}\n\n {showRework && (\n <FeedbackReworkSection\n row={row}\n onUpdate={onUpdate}\n pending={pending}\n onUpload={onUpload}\n onCaptureScreenshot={onCaptureScreenshot}\n onSent={() => setReworking(false)}\n onCancel={() => setReworking(false)}\n attachment={reworkAttachment}\n commit={commit}\n labels={labelsProp}\n />\n )}\n\n <FeedbackDetailSection title={labels.status}>\n {/* Expanded: the whole enum in one click for the admin (keksdose feedback #421);\n everyone else the narrow set, read-only — a picture of the workflow. */}\n <FeedbackStatusTransitions\n status={row.status}\n statuses={\n access.canChangeStatus ? selectableFeedbackStatuses(row.status) : visibleFeedbackStatuses(row.status)\n }\n canEdit={access.canChangeStatus}\n commit={commit}\n onPick={(status) => changeStatus(row, status)}\n variant=\"pill\"\n />\n {onPublicChange && (\n <FeedbackPublicSwitch\n row={row}\n isAdmin={canEdit}\n viewerId={viewerId}\n onChange={onPublicChange}\n pending={pending}\n commit={commit}\n className=\"mt-3\"\n />\n )}\n </FeedbackDetailSection>\n </FeedbackDetail>\n );\n}\n"],"mappings":";AAgTI,SASE,KATF;AAhTJ,SAAS,WAAW,QAAQ,gBAAgB;AAE5C,SAAS,UAAU,cAAc,UAAU,iBAAiB;AAC5D,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,cAAc;AAEvB,SAAS,cAAc,oBAAwC;AAC/D,SAAS,yBAAyB,gBAAgB;AAClD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AAAA,WAEJ;AAAA;AAAA,IACF;AAAA,IAEC,YAAY,QACX,oBAAC,yBAAsB,OAAO,cAAc,UAC1C,8BAAC,iCAAiC,UAAjC,EAA0C,OAAK,MAAE,oBAAS,GAC7D;AAAA,IAGD,cACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QAAQ,MAAM,aAAa,KAAK;AAAA,QAChC,UAAU,MAAM,aAAa,KAAK;AAAA,QAClC,YAAY;AAAA,QACZ;AAAA,QACA,QAAQ;AAAA;AAAA,IACV;AAAA,IAGF,qBAAC,yBAAsB,OAAO,OAAO,QAGnC;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,QAAQ,IAAI;AAAA,UACZ,UACE,OAAO,kBAAkB,2BAA2B,IAAI,MAAM,IAAI,wBAAwB,IAAI,MAAM;AAAA,UAEtG,SAAS,OAAO;AAAA,UAChB;AAAA,UACA,QAAQ,CAAC,WAAW,aAAa,KAAK,MAAM;AAAA,UAC5C,SAAQ;AAAA;AAAA,MACV;AAAA,MACC,kBACC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA;AAAA,UACA,WAAU;AAAA;AAAA,MACZ;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -142,7 +142,7 @@ function feedbackColumns({
|
|
|
142
142
|
key: "votes",
|
|
143
143
|
header: votesHeader,
|
|
144
144
|
className: "whitespace-nowrap",
|
|
145
|
-
cell: (row) => /* @__PURE__ */ jsx(FeedbackVoteCount, { votes: row.votes }),
|
|
145
|
+
cell: (row) => /* @__PURE__ */ jsx(FeedbackVoteCount, { votes: row.votes ?? void 0 }),
|
|
146
146
|
sortBy: (row) => row.votes ?? 0,
|
|
147
147
|
filter: { type: "number", getValue: (row) => row.votes ?? 0 },
|
|
148
148
|
mobileHidden: true
|
|
@@ -312,7 +312,7 @@ function FeedbackMobileCard({
|
|
|
312
312
|
] }),
|
|
313
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: [
|
|
314
314
|
/* @__PURE__ */ jsx(FeedbackCategoryBadge, { category: row.category, compact: true }),
|
|
315
|
-
votes && /* @__PURE__ */ jsx(FeedbackVoteCount, { votes: row.votes }),
|
|
315
|
+
votes && /* @__PURE__ */ jsx(FeedbackVoteCount, { votes: row.votes ?? void 0 }),
|
|
316
316
|
/* @__PURE__ */ jsx(FeedbackDate, { value: row.created_at, renderDate }),
|
|
317
317
|
showSubmitter && // The short id form: "#7" says enough on a card that has room for little.
|
|
318
318
|
/* @__PURE__ */ jsxs("span", { className: "min-w-0 truncate", children: [
|