fix(admin-ui): em-dash fallback в UserCell + sidebar.collapse i18n

This commit is contained in:
Александр Зимин
2026-05-15 09:02:39 +00:00
parent 9ab0e7526a
commit 5c4b9c9f21
2 changed files with 14 additions and 4 deletions
+4
View File
@@ -22,6 +22,8 @@ i18n
'nav.graph': 'Граф связей', 'nav.graph': 'Граф связей',
'nav.section.workflow': 'Workflow', 'nav.section.workflow': 'Workflow',
'nav.section.admin': 'Администрирование', 'nav.section.admin': 'Администрирование',
'sidebar.collapse': 'Свернуть',
'sidebar.expand': 'Развернуть',
'topbar.search.label': 'Поиск', 'topbar.search.label': 'Поиск',
'topbar.search.placeholder': 'Поиск по справочникам, ⌘K', 'topbar.search.placeholder': 'Поиск по справочникам, ⌘K',
'topbar.notifications': 'Уведомления', 'topbar.notifications': 'Уведомления',
@@ -812,6 +814,8 @@ i18n
'nav.graph': 'Relations graph', 'nav.graph': 'Relations graph',
'nav.section.workflow': 'Workflow', 'nav.section.workflow': 'Workflow',
'nav.section.admin': 'Admin', 'nav.section.admin': 'Admin',
'sidebar.collapse': 'Collapse',
'sidebar.expand': 'Expand',
'topbar.search.label': 'Search', 'topbar.search.label': 'Search',
'topbar.search.placeholder': 'Search dictionaries, ⌘K', 'topbar.search.placeholder': 'Search dictionaries, ⌘K',
'topbar.notifications': 'Notifications', 'topbar.notifications': 'Notifications',
+10 -4
View File
@@ -54,8 +54,12 @@ const useResolveUserDisplay = (uuid: string | null | undefined) =>
* (или just {@code "Я"} если profile неполный).</li> * (или just {@code "Я"} если profile неполный).</li>
* <li><b>different user, cached на backend</b> → preferred_username из кэша. * <li><b>different user, cached на backend</b> → preferred_username из кэша.
* Full ID + email + name доступны через extended fields.</li> * Full ID + email + name доступны через extended fields.</li>
* <li><b>different user, не cached</b> → first 8 chars of UUID. Full ID в * <li><b>different user, не cached</b> → {@code "—"} (em dash placeholder).
* {@code fullId} чтобы consumer мог положить в {@code title=...}.</li> * Full ID в {@code fullId} чтобы consumer мог положить в
* {@code title=...}. Раньше был short UUID prefix (8 chars), но это
* выглядело как "uuid в черновиках" baseline UI noise — теперь dash
* честно говорит "не знаем кто", а consumer открывает tooltip за
* full UUID если нужно.</li>
* <li><b>null/undefined uuid</b> → {@code "anonymous"}.</li> * <li><b>null/undefined uuid</b> → {@code "anonymous"}.</li>
* </ul> * </ul>
* *
@@ -94,7 +98,7 @@ export function useUserDisplay(uuid: string | null | undefined): {
const info = resolved.data const info = resolved.data
if (info?.preferredUsername || info?.name) { if (info?.preferredUsername || info?.name) {
return { return {
display: info.preferredUsername || info.name || fullId.substring(0, 8), display: info.preferredUsername || info.name || '—',
isMe, isMe,
fullId, fullId,
preferredUsername: info.preferredUsername, preferredUsername: info.preferredUsername,
@@ -103,7 +107,9 @@ export function useUserDisplay(uuid: string | null | undefined): {
} }
} }
// Fallback — кэш empty или user ещё не появлялся на этом backend'е. // 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 }
} }
/** /**