Audit detail
canonExpanded content of an Item list row that records what changed: field grid before → after, batch items, sent e-mail, note. Fills the row block slot; actions come from the caller.
Owner decision 19 Oct 2026: sub-component of the Item list family (candidate README had asked detail-block vs own family). Source acrm !5275 (K3-2, merged), approved prototype proto/asistent-audit@60ff4f48f (18 Oct 2026). The arrow is not drawn for e-mail recipient and subject (the prototype drew a stray "— →"); the narrow-row title wrapping rule lives in the audit page stylesheet, not here. Not yet AD-approved: no approvedAt, shown as beta/candidate until stamped. AD review 21 Oct 2026: returned for 3 fixes before canon. (1) ds/audit-detail.css still carries page-only rules (.acrm-audit-page .il-row .il-t, .il-col .acrm-audit-actor); move them to the audit page stylesheet. (2) .acrm-audit-empty duplicates the DS EmptyState (RULES §27) and is reused as the load-more wrapper; use EmptyState and drop the class. (3) AuditItems draws before→after as a text glyph while AuditChanges uses Icon arrow-right; unify on the Icon. Minor: the 2px mail rule should use a line token. All four fixed in acrm !5378 (merged 21 Oct 2026; page rules in pages/asistent-audit.css, DS EmptyState, load-more in .tlx-more, batch arrow = Icon arrow-right, var(--line-thick)); checked on dev 21 Oct at 1440/390 (rows expand, actor column, 0 JS errors; no batch row or empty filter in dev data, so those two were checked by tests only). AD-approved as canon 21 Oct 2026.
Used in 1 file · 1 area · 1× — pages/AsistentAuditPage
apps/web <AuditDetail> <AuditChanges> <AuditItems> <AuditMail>.acrm-audit .acrm-audit-note .acrm-audit-ch .acrm-audit-items +3SourceStoryThe expanded content of an Item list row that records what changed — the screen "What the assistant did" (/asistent/historie, bundle K3, approved prototype proto/asistent-audit@60ff4f48f, 18 Oct 2026). It fills the row's block slot; it never replaces the row frame. React apps/web/src/components/assistant/audit/AuditDetail.tsx (AuditDetail, AuditChanges, AuditItems, AuditMail), CSS apps/web/src/ds/audit-detail.css (.acrm-audit*, tokens only). Sub-component of the Item list family (owner decision, 19 Oct 2026).
When to use
- A row of an Item list that can be expanded to show the fields a write changed (before → after), the items of a batch action, or the e-mail that was sent.
- A history of edits of a record, or a preview of a batch action before it is confirmed — any place where "field · before → after" repeats.
When not to use
- The fields of one record at rest — that is Record rail.
- Events on a time axis with no field diff — that is Timeline.
- A full side-by-side text diff — this is a one-line-per-field summary, not a diff viewer.
- Anything that has to stay visible all the time: the detail is collapsed by default and opened by the row's chevron.
Anatomy
- Container
div.acrm-audit(grid,--sp-3gap),aria-busywhile the batch items are being fetched. - Note
p.acrm-audit-note(--fg-secondary): the extra sentence — "Waiting for your confirmation…", "Reverted…". On a phone it also carriesactor · time, which the narrow row has no column for. - Changes
dl.acrm-audit-ch: two columnsmax-content 1fr;dtis the field name (--fg-muted),ddis.was(struck through,--fg-muted) · arrow icon ·.now(--fg). An empty value is an em dash. - Batch
ul.acrm-audit-items: one line per item —.n(name,--fg, max 45 %, ellipsis) and.c(field: before → after,--fg-muted, ellipsis); the last line.moresays "and N more" when the list is truncated. - E-mail
div.acrm-audit-mail: adl.acrm-audit-chwith To / Cc / Subject without the arrow (nothing "changed"), then the label.acrm-audit-mail-hand the body inp(white-space: pre-wrap);border-left: 2px solid var(--border). - Actions
div.acrm-audit-act: supplied by the caller — undo, "Open record". The detail never renders actions itself. On a phone they stretch (flex: 1) and are--tap-minhigh.
Props
AuditDetail takes: changes (array of { key, field, before, after }, required), note? (string), mail? ({ to, cc, subject, body, bodyHidden }), items? + itemsTotal? (batch lines and the full count), loading? (boolean, sets aria-busy), actions? (ReactNode). The parts AuditChanges, AuditItems and AuditMail are exported for reuse. Which block shows is decided by the data: items win over changes, an e-mail replaces the changes grid.
Best practices
- Show only fields that changed. The grid is a summary; the full record lives behind "Open record".
- Field names and values are already localised and formatted by the server — the component does no domain logic.
- Put the undo action in
actionsonly while the change is reversible; the row decides, not the detail. - The e-mail body is shown to the mailbox owner only (
bodyHidden→ a sentence instead of the text). - A title-wrapping rule for narrow rows belongs to the screen, not to this component (
.acrm-audit-page .il-row .il-tin the audit page stylesheet).
Content
- Sentence case, no capitals; the note is one sentence.
- Before → after is read left to right; never reverse it.
- A missing value is "—", never an empty cell and never the word "null".
Related
- Item list (
item-list) — the host; the detail sits in itsblockslot. - Timeline (
timeline) — events without a field diff. - Count badge — the batch size next to the verb in the row title.
Source: docs/item-list/audit-detail.usage.md · GitLab