From 5c4b9c9f2104635560810fff33144c05035d127b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B8=D0=BC=D0=B8=D0=BD?= Date: Fri, 15 May 2026 09:02:39 +0000 Subject: [PATCH] =?UTF-8?q?fix(admin-ui):=20em-dash=20fallback=20=D0=B2=20?= =?UTF-8?q?UserCell=20+=20sidebar.collapse=20i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ordinis-admin-ui/src/i18n.ts | 4 ++++ ordinis-admin-ui/src/lib/useUserDisplay.tsx | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ordinis-admin-ui/src/i18n.ts b/ordinis-admin-ui/src/i18n.ts index 21c712c..948cb40 100644 --- a/ordinis-admin-ui/src/i18n.ts +++ b/ordinis-admin-ui/src/i18n.ts @@ -22,6 +22,8 @@ i18n 'nav.graph': 'Граф связей', 'nav.section.workflow': 'Workflow', 'nav.section.admin': 'Администрирование', + 'sidebar.collapse': 'Свернуть', + 'sidebar.expand': 'Развернуть', 'topbar.search.label': 'Поиск', 'topbar.search.placeholder': 'Поиск по справочникам, ⌘K', 'topbar.notifications': 'Уведомления', @@ -812,6 +814,8 @@ i18n 'nav.graph': 'Relations graph', 'nav.section.workflow': 'Workflow', 'nav.section.admin': 'Admin', + 'sidebar.collapse': 'Collapse', + 'sidebar.expand': 'Expand', 'topbar.search.label': 'Search', 'topbar.search.placeholder': 'Search dictionaries, ⌘K', 'topbar.notifications': 'Notifications', diff --git a/ordinis-admin-ui/src/lib/useUserDisplay.tsx b/ordinis-admin-ui/src/lib/useUserDisplay.tsx index a631a86..4e3b81f 100644 --- a/ordinis-admin-ui/src/lib/useUserDisplay.tsx +++ b/ordinis-admin-ui/src/lib/useUserDisplay.tsx @@ -54,8 +54,12 @@ const useResolveUserDisplay = (uuid: string | null | undefined) => * (или just {@code "Я"} если profile неполный). *
  • different user, cached на backend → preferred_username из кэша. * Full ID + email + name доступны через extended fields.
  • - *
  • different user, не cached → first 8 chars of UUID. Full ID в - * {@code fullId} чтобы consumer мог положить в {@code title=...}.
  • + *
  • different user, не cached → {@code "—"} (em dash placeholder). + * Full ID в {@code fullId} чтобы consumer мог положить в + * {@code title=...}. Раньше был short UUID prefix (8 chars), но это + * выглядело как "uuid в черновиках" baseline UI noise — теперь dash + * честно говорит "не знаем кто", а consumer открывает tooltip за + * full UUID если нужно.
  • *
  • null/undefined uuid → {@code "anonymous"}.
  • * * @@ -94,7 +98,7 @@ export function useUserDisplay(uuid: string | null | undefined): { const info = resolved.data if (info?.preferredUsername || info?.name) { return { - display: info.preferredUsername || info.name || fullId.substring(0, 8), + display: info.preferredUsername || info.name || '—', isMe, fullId, preferredUsername: info.preferredUsername, @@ -103,7 +107,9 @@ export function useUserDisplay(uuid: string | null | undefined): { } } // Fallback — кэш empty или user ещё не появлялся на этом backend'е. - return { display: fullId.substring(0, 8), isMe, fullId } + // Показываем em dash вместо raw UUID prefix; full ID доступен в tooltip + // через fullId (см. UserCell title=...). + return { display: '—', isMe, fullId } } /**