fix(ui): UserCell в changelog/events/history — ещё 6 мест

После !178 (record drawer + RecordHistoryDrawer + webhook detail) ещё
осталось 6 точек где раньше рендерился UUID. Все они в "истории
словаря" и tab "События":

1. ChangelogDiffModal:57 — header "автор: <name>" в diff modal.
   Было: `{data.publishedBy.name}` (тип ChangelogPublisher.name —
   docstring буквально говорит "Backend пока эхает sub").
   Стало: <UserCell uuid={data.publishedBy.sub} />.

2. TimeTravelModal:686 — список изменений, имя автора рядом с датой.
3. TimeTravelModal:898 — RIGHT panel "История этой версии", dt/dd
   pair с автором.
4. TimeTravelModal ComparePanel:414 — "· {author}" suffix,
   author там DictionaryDetail.updatedBy (тоже UUID).

5. dictionaries.$name.tsx:2263 (events tab, EventsTabContent row) —
   `{r.userId ?? 'anonymous'}` raw. Сменил на UserCell для не-null
   userId, anonymous-fallback оставил без UserCell (нечего lookup'ать).

6. dictionaries.$name.tsx:2399 (history tab, HistoryTabContent entry)
   — `{entry.publishedBy.name}` raw.

Всё через тот же useUserDisplay hook что и в !177 — backend
endpoint /admin/users/{sub}/display + JwtUserCaptureFilter cache.
Если sub нет в cache, UserCell fallback'ит на shortened UUID
(текущее поведение из !177).

ChangelogPublisher type comment в src/api/client.ts уже намекал что
.name это placeholder — useUserDisplay теперь реально резолвит.
This commit is contained in:
Andrei Zimin
2026-05-14 14:33:20 +03:00
parent 93b2676994
commit 455ca2ff26
3 changed files with 13 additions and 8 deletions
@@ -56,6 +56,7 @@ import { TimeTravelModal } from '@/components/timetravel/TimeTravelModal'
import { ChangelogDiffModal } from '@/components/changelog/ChangelogDiffModal'
import { kindBadgeVariant, kindIcon, kindLabel, isVersioningKind } from '@/components/changelog/kind-meta'
import { CreateSchemaDraftModal } from '@/components/workflow/CreateSchemaDraftModal'
import { UserCell } from '@/lib/useUserDisplay'
import { nowIsoLocal } from '@/lib/dates'
import { recordDisplayName } from '@/lib/locales'
import { SCOPE_BORDER_TOP } from '@/lib/scope-style'
@@ -2258,8 +2259,8 @@ function EventsTabContent({ dictName }: { dictName: string }) {
{status}
</span>
</td>
<td className="px-3 py-2 text-mono text-cell text-ink-2">
{r.userId ?? 'anonymous'}
<td className="px-3 py-2 text-cell text-ink-2">
{r.userId ? <UserCell uuid={r.userId} /> : <span className="text-mono text-mute">anonymous</span>}
</td>
<td className="px-3 py-2 text-cell text-ink-2 max-w-md truncate">
{r.businessKey ? (
@@ -2396,7 +2397,7 @@ function ChangelogTimelineItem({
)}
<div className="flex items-center gap-3 mt-1 text-cell text-mute">
<span className="tabular-nums">{occurredAt.toLocaleString()}</span>
<span className="font-mono">{entry.publishedBy.name}</span>
<UserCell uuid={entry.publishedBy.sub} />
{entry.recordsAffected > 0 && (
<span>
{t('changelog.recordsAffected', {