From 58a18b4151fc28d8c6ab49531f1e6351e89f185a Mon Sep 17 00:00:00 2001 From: abassibrahim591 Date: Tue, 23 Jun 2026 20:24:52 +0100 Subject: [PATCH] fix(web): derive greeting name from email, not the userId hash When no custom call-me/display name is set (e.g. a fresh device with no local settings), the empty-state greeting fell back to principal.userId, which is an opaque hash and rendered as "Good evening, 6b72871a". Prefer principal.email so it derives a human name available on every device. Note: the custom call-me name is still device-local (localStorage). True cross-device consistency is the Track A /profile (account_profiles. display_name) slice; wire apps/web to it once that backend lands. Co-Authored-By: Claude Opus 4.8 --- frontend/apps/web/app/chat/components/EmptyState.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/apps/web/app/chat/components/EmptyState.tsx b/frontend/apps/web/app/chat/components/EmptyState.tsx index 8b5f1d4..c0f9604 100644 --- a/frontend/apps/web/app/chat/components/EmptyState.tsx +++ b/frontend/apps/web/app/chat/components/EmptyState.tsx @@ -84,7 +84,11 @@ export function EmptyState({ onPrompt }: { onPrompt?: PromptHandler }) { const name = useMemo(() => { const preferred = (callMeName || displayNameSetting).trim(); if (preferred) return preferred; - return principal ? displayName(principal.userId) : 'there'; + if (!principal) return 'there'; + // Fall back to the account identity. Prefer the email (every device has + // it) over the raw userId, which is an opaque hash and renders as e.g. + // "6b72871a" - never use it for a human-facing greeting. + return displayName(principal.email || principal.userId); }, [callMeName, displayNameSetting, principal]); const part = timeOfDay();