Diff viewer
Before → after at field level (conflict compare, bulk-hub preview) and line level (email template versions, with Revert). Side by side or inline; inline only on phone.
Covers: M05. Exports: DiffViewer.
Anatomy
The component as it sits in the product: English, compact, real data shapes.
States
5 states, left to right, top to bottom. A mock poll never finishes, so each state is drawn on purpose.
Order shipped · v7 → v8
No differences
v7 and v8 are identical.
Density
The phone shell is always comfortable (POWERUPS #15): 44px tap targets, 16px inputs. Compact exists on desktop only; see the desktop page.
English · 中文
Staff pick en or cn (T001 Q25). Labels arrive localised; CJK falls back to PingFang SC / Noto Sans SC.
Long string · permission denied
The long-string case (PL-063) and what a role without the permission sees (the server decides; T003).
Not available to your role
Your role is missing manage email templates. Nothing here is hidden by mistake: the server sends only what you can do.
Contract
The @rj/admin-kit API for this family. Mirrored in CONTRACT.md.
- Export
DiffViewer·@rj/admin-kit- Props
modefields|lines ·before·after·labels·layoutside|inline- States
- diff · identical · loading · denied
- shadcn / Radix
- Tabs (layout)
- Package underneath
- react-diff-viewer-continued (lines) · diff (fields)
- Accessibility
- removed / added are announced (“removed 104, added 106”), not colour only
- API operations
- admin.email-templates.versions.show / .revert · admin.designs.bulk-hub.preview · admin.pt-colors.import.preview · admin.accounts.bulk-permissions (dry_run)
- Phone variant
- inline only