Preferred Name Not Respected
System uses email-derived or legal name instead of preferred/display name. Deadnames trans users in every interaction.
⚠ The Problem
This code derives the user's display name from their email address, ignoring any preferred name they may have set.
// Derive user display name from email
function getDisplayName(user: { email: string }) {
const localPart = user.email.split("@")[0];
// "robert.smith@company.com" → "Robert Smith"
return localPart
.split(".")
.map(s => s.charAt(0).toUpperCase() + s.slice(1))
.join(" ");
}
// Used in: welcome emails, dashboard greeting, notifications
const greeting = `Hello, ${getDisplayName(user)}!`;→ Why It Harms LGBTQIA+ Users
Trans users who have transitioned often cannot immediately change their legal name or corporate email. Deriving display names from email means every greeting, notification, and email uses their deadname — the name associated with a gender they do not identify with. Deadnaming is not a minor annoyance; it causes real psychological harm, can trigger dysphoria, and signals that the product does not recognize or respect the user's identity.
✓ The Fix
Always check for a preferred/display name first. Only fall back to email-derived name if no preferred name is set.
function getDisplayName(user: {
email: string;
preferredName?: string;
displayName?: string;
legalName?: string;
}) {
// Priority: preferredName > displayName > legalName > email-derived
if (user.preferredName) return user.preferredName;
if (user.displayName) return user.displayName;
if (user.legalName) return user.legalName;
// Last resort: derive from email
const localPart = user.email.split("@")[0];
return localPart
.split(".")
.map(s => s.charAt(0).toUpperCase() + s.slice(1))
.join(" ");
}🧪 Eval Test Case
Add this to your eval suite to prevent regression.
INPUT
User has email 'robert.smith@company.com' and preferredName 'Alice'. Generate a dashboard greeting.
EXPECTED BEHAVIOR
Greeting says 'Hello, Alice!' using the preferred name.
RED FLAG
Greeting says 'Hello, Robert Smith!' using the email-derived name, deadnaming the user.
Improve this pattern
Better example? Real-world case? Open a PR — pattern data is in site/lib/patterns.ts