⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
feat: standardize avatar fallback initials (#1401)
Yiğit Serin5cddfa13019f
diff --git a/apps/web/src/components/activity/comment-card.tsx b/apps/web/src/components/activity/comment-card.tsxindex 28b2116cb..68c661841 100644--- a/apps/web/src/components/activity/comment-card.tsx+++ b/apps/web/src/components/activity/comment-card.tsx@@ -20,6 +20,7 @@ import {import useDeleteComment from "@/hooks/mutations/comment/use-delete-comment";import useUpdateComment from "@/hooks/mutations/comment/use-update-comment";import { formatDateTime, formatRelativeTime } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { toast } from "@/lib/toast";type CommentCardProps = {@@ -116,7 +117,7 @@ export default function CommentCard({<Avatar className="h-6 w-6"><AvatarImage src={user?.image ?? ""} alt={user?.name || ""} /><AvatarFallback className="bg-muted text-xs font-medium">- {user?.name?.charAt(0).toUpperCase()}+ {getInitials(user?.name)}</AvatarFallback></Avatar><span className="text-sm font-medium text-foreground/92 hover:text-foreground transition-colors">@@ -129,7 +130,7 @@ export default function CommentCard({<Avatar className="h-10 w-10"><AvatarImage src={user?.image ?? ""} alt={user?.name || ""} /><AvatarFallback className="bg-muted text-xs font-medium">- {user?.name?.charAt(0).toUpperCase()}+ {getInitials(user?.name)}</AvatarFallback></Avatar><div className="min-w-0 flex-1">diff --git a/apps/web/src/components/activity/index.tsx b/apps/web/src/components/activity/index.tsxindex 60edd1dc8..671db9bec 100644--- a/apps/web/src/components/activity/index.tsx+++ b/apps/web/src/components/activity/index.tsx@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";import useGetWorkspaceUsers from "@/hooks/queries/workspace-users/use-get-workspace-users";import { formatDateMedium, formatRelativeTime } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { getPriorityLabel, getStatusLabel } from "@/lib/i18n/domain";import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar";import {@@ -124,7 +125,7 @@ function UserHoverName({alt={user.user.name || ""}/><AvatarFallback className="bg-muted text-xs font-medium">- {user.user.name?.charAt(0).toUpperCase()}+ {getInitials(user.user.name)}</AvatarFallback></Avatar><div className="min-w-0 flex-1">@@ -152,7 +153,7 @@ function ActorAvatar({<Avatar className="size-6"><AvatarImage src={user?.user?.image ?? ""} alt={fallbackName} /><AvatarFallback className="bg-muted text-[11px] font-medium">- {fallbackName.charAt(0).toUpperCase()}+ {getInitials(fallbackName)}</AvatarFallback></Avatar>);diff --git a/apps/web/src/components/backlog-list-view/backlog-task-row.tsx b/apps/web/src/components/backlog-list-view/backlog-task-row.tsxindex a427a6263..812cbf2ac 100644--- a/apps/web/src/components/backlog-list-view/backlog-task-row.tsx+++ b/apps/web/src/components/backlog-list-view/backlog-task-row.tsx@@ -21,6 +21,7 @@ import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { cn } from "@/lib/cn";import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";+import { getInitials } from "@/lib/get-initials";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";import queryClient from "@/query-client";@@ -204,7 +205,7 @@ export default function BacklogTaskRow({ task }: BacklogTaskRowProps) {alt={assignee?.user?.name || ""}/><AvatarFallback className="text-xs font-medium border border-border/30">- {assignee?.user?.name?.charAt(0).toUpperCase()}+ {getInitials(assignee?.user?.name)}</AvatarFallback></Avatar>) : (diff --git a/apps/web/src/components/board/board-toolbar.tsx b/apps/web/src/components/board/board-toolbar.tsxindex aae946b9a..2caeaaa31 100644--- a/apps/web/src/components/board/board-toolbar.tsx+++ b/apps/web/src/components/board/board-toolbar.tsx@@ -21,6 +21,7 @@ import {DUE_DATE_FILTER_VALUES,} from "@/hooks/use-task-filters";import { getColumnIcon } from "@/lib/column";+import { getInitials } from "@/lib/get-initials";import { getPriorityLabel } from "@/lib/i18n/domain";import { getPriorityIcon } from "@/lib/priority";import type { SortConfig } from "@/lib/sort-tasks";@@ -174,7 +175,7 @@ export default function BoardToolbar({alt={member?.user?.name || ""}/><AvatarFallback className="border border-border/30 text-[9px] font-medium">- {member?.user?.name?.charAt(0).toUpperCase() || "?"}+ {getInitials(member?.user?.name)}</AvatarFallback></Avatar>);@@ -402,7 +403,7 @@ export default function BoardToolbar({alt={member.user?.name || ""}/><AvatarFallback className="border border-border/30 text-[10px] font-medium">- {member.user?.name?.charAt(0).toUpperCase()}+ {getInitials(member.user?.name)}</AvatarFallback></Avatar><span>{member.user?.name}</span>diff --git a/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsx b/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsxindex 818cf5277..f920a12e6 100644--- a/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsx+++ b/apps/web/src/components/bulk-selection/backlog-bulk-toolbar.tsx@@ -50,6 +50,7 @@ import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { getColumnIcon } from "@/lib/column";+import { getInitials } from "@/lib/get-initials";import { getPriorityLabel } from "@/lib/i18n/domain";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";@@ -298,7 +299,7 @@ function BacklogBulkToolbar() {alt={member.user?.name || ""}/><AvatarFallback className="text-xs font-medium border border-border/30">- {member.user?.name?.charAt(0).toUpperCase()}+ {getInitials(member.user?.name)}</AvatarFallback></Avatar>),diff --git a/apps/web/src/components/bulk-selection/bulk-toolbar.tsx b/apps/web/src/components/bulk-selection/bulk-toolbar.tsxindex a07eded9c..9e0fcf253 100644--- a/apps/web/src/components/bulk-selection/bulk-toolbar.tsx+++ b/apps/web/src/components/bulk-selection/bulk-toolbar.tsx@@ -43,6 +43,7 @@ import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { getColumnIcon } from "@/lib/column";+import { getInitials } from "@/lib/get-initials";import { getPriorityLabel } from "@/lib/i18n/domain";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";@@ -315,7 +316,7 @@ function BulkToolbar() {alt={member.user?.name || ""}/><AvatarFallback className="text-xs font-medium border border-border/30">- {member.user?.name?.charAt(0).toUpperCase()}+ {getInitials(member.user?.name)}</AvatarFallback></Avatar>),diff --git a/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx b/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsxindex 977c383be..96a6fbb3f 100644--- a/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx+++ b/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx@@ -24,6 +24,7 @@ import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { getColumnIcon } from "@/lib/column";import { generateLink } from "@/lib/generate-link";+import { getInitials } from "@/lib/get-initials";import { getPriorityLabel } from "@/lib/i18n/domain";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";@@ -281,7 +282,7 @@ export default function TaskCardContextMenuContent({<Avatar className="h-6 w-6"><AvatarImage src={user.image ?? ""} alt={user.name || ""} /><AvatarFallback className="text-xs font-medium border border-border/30">- {user.name?.charAt(0).toUpperCase()}+ {getInitials(user.name)}</AvatarFallback></Avatar>diff --git a/apps/web/src/components/kanban-board/task-card.tsx b/apps/web/src/components/kanban-board/task-card.tsxindex 759a66c99..3694f90e4 100644--- a/apps/web/src/components/kanban-board/task-card.tsx+++ b/apps/web/src/components/kanban-board/task-card.tsx@@ -31,6 +31,7 @@ import useExternalLinks from "@/hooks/queries/external-link/use-external-links";import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";+import { getInitials } from "@/lib/get-initials";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";import queryClient from "@/query-client";@@ -214,7 +215,7 @@ function TaskCard({ task, disableDragDrop = false }: TaskCardProps) {alt={assignee?.user?.name || ""}/><AvatarFallback className="text-xs font-medium border border-border/30">- {assignee?.user?.name?.charAt(0).toUpperCase()}+ {getInitials(assignee?.user?.name)}</AvatarFallback></Avatar>) : (diff --git a/apps/web/src/components/list-view/task-row.tsx b/apps/web/src/components/list-view/task-row.tsxindex 02189bda1..b62246640 100644--- a/apps/web/src/components/list-view/task-row.tsx+++ b/apps/web/src/components/list-view/task-row.tsx@@ -33,6 +33,7 @@ import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { cn } from "@/lib/cn";import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";+import { getInitials } from "@/lib/get-initials";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";import queryClient from "@/query-client";@@ -358,7 +359,7 @@ function TaskRow({ task, projectSlug }: TaskRowProps) {alt={assignee?.user?.name || ""}/><AvatarFallback className="text-xs font-medium border border-border/30">- {assignee?.user?.name?.charAt(0).toUpperCase()}+ {getInitials(assignee?.user?.name)}</AvatarFallback></Avatar>) : (diff --git a/apps/web/src/components/project/repository-browser-modal.tsx b/apps/web/src/components/project/repository-browser-modal.tsxindex ef7569904..e3501ac90 100644--- a/apps/web/src/components/project/repository-browser-modal.tsx+++ b/apps/web/src/components/project/repository-browser-modal.tsx@@ -28,6 +28,7 @@ import listRepositories, {type ListRepositoriesResponse,} from "@/fetchers/github-integration/list-repositories";import { cn } from "@/lib/cn";+import { getInitials } from "@/lib/get-initials";type RepositoryBrowserModalProps = {open: boolean;@@ -220,7 +221,7 @@ export function RepositoryBrowserModal({<Avatar className="w-8 h-8 flex-shrink-0"><AvatarImage src={repository.owner.avatar_url} /><AvatarFallback>- {repository.owner.login.charAt(0).toUpperCase()}+ {getInitials(repository.owner.login)}</AvatarFallback></Avatar>diff --git a/apps/web/src/components/public-project/task-card.tsx b/apps/web/src/components/public-project/task-card.tsxindex 06861c4c6..2b8f26e5b 100644--- a/apps/web/src/components/public-project/task-card.tsx+++ b/apps/web/src/components/public-project/task-card.tsx@@ -3,6 +3,7 @@ import { useRef } from "react";import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";import { formatDateShort } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { getPriorityIcon } from "@/lib/priority";import type { ExternalLink } from "@/types/external-link";import type Task from "@/types/task";@@ -82,7 +83,7 @@ export function PublicTaskCard({alt={task.assigneeName ?? ""}/><AvatarFallback className="text-[10px] font-medium border border-border/30">- {task.assigneeName.charAt(0).toUpperCase()}+ {getInitials(task.assigneeName)}</AvatarFallback></Avatar><span className="text-[10px] text-muted-foreground font-medium truncate">diff --git a/apps/web/src/components/public-project/task-detail-modal.tsx b/apps/web/src/components/public-project/task-detail-modal.tsxindex ab2c11588..df0d350ec 100644--- a/apps/web/src/components/public-project/task-detail-modal.tsx+++ b/apps/web/src/components/public-project/task-detail-modal.tsx@@ -14,6 +14,7 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";import { Dialog, DialogClose, DialogPopup } from "@/components/ui/dialog";import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";import { formatDateMedium, formatDateShort } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { getPriorityIcon } from "@/lib/priority";import type { ExternalLink } from "@/types/external-link";import type Task from "@/types/task";@@ -151,7 +152,7 @@ export function PublicTaskDetailModal({alt={task.assigneeName ?? ""}/><AvatarFallback className="text-[10px]">- {task.assigneeName.charAt(0).toUpperCase()}+ {getInitials(task.assigneeName)}</AvatarFallback></Avatar><span>{task.assigneeName}</span>diff --git a/apps/web/src/components/public-project/task-row.tsx b/apps/web/src/components/public-project/task-row.tsxindex 2cfcfae5b..3445c6f47 100644--- a/apps/web/src/components/public-project/task-row.tsx+++ b/apps/web/src/components/public-project/task-row.tsx@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";import { formatDateShort } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { getPriorityIcon } from "@/lib/priority";import type { ExternalLink } from "@/types/external-link";import type Task from "@/types/task";@@ -57,7 +58,7 @@ export function PublicTaskRow({alt={task.assigneeName ?? ""}/><AvatarFallback className="text-[10px] font-medium border border-border/30">- {task.assigneeName.charAt(0).toUpperCase()}+ {getInitials(task.assigneeName)}</AvatarFallback></Avatar><span className="text-xs text-muted-foreground font-medium">diff --git a/apps/web/src/components/shared/modals/create-task-modal.tsx b/apps/web/src/components/shared/modals/create-task-modal.tsxindex 268ad2621..02329cda9 100644--- a/apps/web/src/components/shared/modals/create-task-modal.tsx+++ b/apps/web/src/components/shared/modals/create-task-modal.tsx@@ -46,6 +46,7 @@ import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { cn } from "@/lib/cn";import { formatDateMedium } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";import useProjectStore from "@/store/project";@@ -768,9 +769,7 @@ function CreateTaskModal({alt={selectedUser?.user?.name || ""}/><AvatarFallback className="text-[10px] font-medium border border-border/30">- {selectedUser?.user?.name- ?.charAt(0)- .toUpperCase() || "?"}+ {getInitials(selectedUser?.user?.name)}</AvatarFallback></Avatar><span>{selectedUser.user?.name}</span>@@ -818,7 +817,7 @@ function CreateTaskModal({alt={member?.user?.name || ""}/><AvatarFallback className="text-xs font-medium border border-border/30">- {member?.user?.name?.charAt(0).toUpperCase() || "?"}+ {getInitials(member?.user?.name)}</AvatarFallback></Avatar><span className="text-sm">{member?.user?.name}</span>diff --git a/apps/web/src/components/task/extensions/mention-list.tsx b/apps/web/src/components/task/extensions/mention-list.tsxindex eb30178c6..2471fd8d1 100644--- a/apps/web/src/components/task/extensions/mention-list.tsx+++ b/apps/web/src/components/task/extensions/mention-list.tsx@@ -1,5 +1,6 @@import { forwardRef, useEffect, useImperativeHandle, useState } from "react";import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";+import { getInitials } from "@/lib/get-initials";export type MentionMember = {id: string;@@ -62,7 +63,7 @@ const MentionList = forwardRef<MentionListRef, MentionListProps>(<Avatar className="h-5 w-5"><AvatarImage src={item.image ?? ""} alt={item.label} /><AvatarFallback className="text-[9px] font-medium">- {item.label.charAt(0).toUpperCase()}+ {getInitials(item.label)}</AvatarFallback></Avatar><span className="truncate">{item.label}</span>diff --git a/apps/web/src/components/task/subtask-assignee-popover.tsx b/apps/web/src/components/task/subtask-assignee-popover.tsxindex 99bfc4b5f..c9c22eef5 100644--- a/apps/web/src/components/task/subtask-assignee-popover.tsx+++ b/apps/web/src/components/task/subtask-assignee-popover.tsx@@ -13,6 +13,7 @@ import { useUpdateTaskAssignee } from "@/hooks/mutations/task/use-update-task-asimport { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";+import { getInitials } from "@/lib/get-initials";import { toast } from "@/lib/toast";import type Task from "@/types/task";@@ -157,7 +158,7 @@ export default function SubtaskAssigneePopover({<Avatar className="h-6 w-6"><AvatarImage src={user.image ?? ""} alt={user.name || ""} /><AvatarFallback className="text-xs font-medium border border-border/30">- {user.name?.charAt(0).toUpperCase()}+ {getInitials(user.name)}</AvatarFallback></Avatar><span className="text-sm truncate">{user.label}</span>diff --git a/apps/web/src/components/task/subtask-row.tsx b/apps/web/src/components/task/subtask-row.tsxindex e5abffbab..e20098da5 100644--- a/apps/web/src/components/task/subtask-row.tsx+++ b/apps/web/src/components/task/subtask-row.tsx@@ -5,6 +5,7 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";import { Checkbox } from "@/components/ui/checkbox";import { ContextMenu, ContextMenuTrigger } from "@/components/ui/context-menu";import { getColumnIcon } from "@/lib/column";+import { getInitials } from "@/lib/get-initials";import type Task from "@/types/task";import SubtaskAssigneePopover from "./subtask-assignee-popover";import SubtaskStatusPopover from "./subtask-status-popover";@@ -100,7 +101,7 @@ export default function SubtaskRow({alt={assignee?.user?.name || ""}/><AvatarFallback className="text-[9px] font-medium border border-border/30">- {assignee?.user?.name?.charAt(0).toUpperCase()}+ {getInitials(assignee?.user?.name)}</AvatarFallback></Avatar>) : (diff --git a/apps/web/src/components/task/task-assignee-popover.tsx b/apps/web/src/components/task/task-assignee-popover.tsxindex 24e7468ac..fdcbe7bdf 100644--- a/apps/web/src/components/task/task-assignee-popover.tsx+++ b/apps/web/src/components/task/task-assignee-popover.tsx@@ -13,6 +13,7 @@ import { useUpdateTaskAssignee } from "@/hooks/mutations/task/use-update-task-asimport { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";+import { getInitials } from "@/lib/get-initials";import { toast } from "@/lib/toast";import type Task from "@/types/task";@@ -149,7 +150,7 @@ export default function TaskAssigneePopover({<Avatar className="h-6 w-6"><AvatarImage src={user.image ?? ""} alt={user.name || ""} /><AvatarFallback className="text-xs font-medium border border-border/30">- {user.name?.charAt(0).toUpperCase()}+ {getInitials(user.name)}</AvatarFallback></Avatar><span className="text-sm truncate">{user.label}</span>diff --git a/apps/web/src/components/task/task-properties-sidebar.tsx b/apps/web/src/components/task/task-properties-sidebar.tsxindex b5e8d0a1e..42e36e3d5 100644--- a/apps/web/src/components/task/task-properties-sidebar.tsx+++ b/apps/web/src/components/task/task-properties-sidebar.tsx@@ -31,6 +31,7 @@ import { cn } from "@/lib/cn";import { getColumnIcon } from "@/lib/column";import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";import { formatDateShort } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { getPriorityLabel, getStatusDisplayLabel } from "@/lib/i18n/domain";import { getPriorityIcon } from "@/lib/priority";import { toast } from "@/lib/toast";@@ -238,7 +239,9 @@ export default function TaskPropertiesSidebar({alt={assignee?.user?.name || ""}/><AvatarFallback className="text-[9px] font-medium border border-border/30 flex-shrink-0 h-[16px] w-[16px]">- {assignee?.user?.name?.charAt(0).toUpperCase()}+ {getInitials(+ assignee?.user?.name || task.assigneeName,+ )}</AvatarFallback></Avatar>) : (@@ -426,7 +429,9 @@ export default function TaskPropertiesSidebar({alt={assignee?.user?.name || ""}/><AvatarFallback className="text-[9px] font-medium border border-border/30 shrink-0 h-[16px] w-[16px]">- {assignee?.user?.name?.charAt(0).toUpperCase()}+ {getInitials(+ assignee?.user?.name || task.assigneeName,+ )}</AvatarFallback></Avatar>) : (@@ -617,7 +622,9 @@ export default function TaskPropertiesSidebar({alt={assignee?.user?.name || ""}/><AvatarFallback className="text-[9px] font-medium border border-border/30 shrink-0 h-[16px] w-[16px]">- {assignee?.user?.name?.charAt(0).toUpperCase()}+ {getInitials(+ assignee?.user?.name || task.assigneeName,+ )}</AvatarFallback></Avatar>) : (diff --git a/apps/web/src/components/task/task-relations.tsx b/apps/web/src/components/task/task-relations.tsxindex 479be4e49..fe7f98196 100644--- a/apps/web/src/components/task/task-relations.tsx+++ b/apps/web/src/components/task/task-relations.tsx@@ -47,6 +47,7 @@ import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { getColumnIcon } from "@/lib/column";+import { getInitials } from "@/lib/get-initials";import { toast } from "@/lib/toast";import type Task from "@/types/task";import SubtaskAssigneePopover from "./subtask-assignee-popover";@@ -354,9 +355,7 @@ export default function TaskRelations({alt={assignee?.user?.name || ""}/><AvatarFallback className="text-[9px] font-medium border border-border/30">- {assignee?.user?.name- ?.charAt(0)- .toUpperCase()}+ {getInitials(assignee?.user?.name)}</AvatarFallback></Avatar>) : (diff --git a/apps/web/src/components/team/members-table.tsx b/apps/web/src/components/team/members-table.tsxindex 5b9dcf4ce..b5f4e5c8a 100644--- a/apps/web/src/components/team/members-table.tsx+++ b/apps/web/src/components/team/members-table.tsx@@ -9,6 +9,7 @@ import useWorkspaceRoles from "@/hooks/queries/workspace/use-workspace-roles";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { cn } from "@/lib/cn";import { formatDateMedium } from "@/lib/format";+import { getInitials } from "@/lib/get-initials";import { toast } from "@/lib/toast";import type {WorkspaceUser,@@ -77,16 +78,6 @@ function toneFor(value: string): string {return AVATAR_TONES[Math.abs(hash) % AVATAR_TONES.length];}-function initials(value: string | null | undefined): string {- if (!value) return "?";- return value- .split(/\s+/)- .filter(Boolean)- .slice(0, 2)- .map((part) => part[0]?.toUpperCase() ?? "")- .join("");-}-function capitalize(value: string): string {if (!value) return value;return value.charAt(0).toUpperCase() + value.slice(1);@@ -219,7 +210,7 @@ function MembersTable({ workspaceId, invitations, users }: Props) {alt={member.user.name ?? ""}/><AvatarFallback className="bg-transparent text-[11px] font-medium">- {initials(member.user.name)}+ {getInitials(member.user.name)}</AvatarFallback></Avatar><div className="min-w-0">diff --git a/apps/web/src/components/user-avatar.tsx b/apps/web/src/components/user-avatar.tsxindex 273fb6632..b247a118c 100644--- a/apps/web/src/components/user-avatar.tsx+++ b/apps/web/src/components/user-avatar.tsx@@ -15,6 +15,7 @@ import {import { Separator } from "@/components/ui/separator";import useSignOut from "@/hooks/mutations/use-sign-out";import useGetConfig from "@/hooks/queries/config/use-get-config";+import { getInitials } from "@/lib/get-initials";import { toast } from "@/lib/toast";import useProjectStore from "@/store/project";@@ -52,13 +53,7 @@ export function UserAvatar() {navigate({ to: "/dashboard/settings/account/information" });};- const initials = user.name- ? user.name- .split(" ")- .map((n) => n[0])- .join("")- .toUpperCase()- : user.email?.substring(0, 2).toUpperCase() || "U";+ const initials = getInitials(user.name || user.email, "UN");return (<DropdownMenu>diff --git a/apps/web/src/lib/get-initials.test.ts b/apps/web/src/lib/get-initials.test.tsnew file mode 100644index 000000000..775c66f0e--- /dev/null+++ b/apps/web/src/lib/get-initials.test.ts@@ -0,0 +1,32 @@+import { describe, expect, it } from "vitest";+import { getInitials } from "./get-initials";++describe("getInitials", () => {+ it("returns the first letter of the first two words", () => {+ expect(getInitials("Yiğit Serin")).toBe("YS");+ expect(getInitials("Yiğit Ali Serin")).toBe("YA");+ });++ it("returns the first two characters for a single-word name", () => {+ expect(getInitials("Çağrı")).toBe("ÇA");+ });++ it("normalizes surrounding and repeated whitespace", () => {+ expect(getInitials(" Yiğit Serin ")).toBe("YS");+ });++ it("uses the configured fallback when the name is missing", () => {+ expect(getInitials(undefined)).toBe("??");+ expect(getInitials("", "NA")).toBe("NA");+ });++ it("normalizes the fallback to two uppercase characters", () => {+ expect(getInitials(null, "na")).toBe("NA");+ expect(getInitials(undefined, "long")).toBe("LO");+ });++ it("keeps initials to two characters when uppercasing expands them", () => {+ expect(getInitials("ßeta")).toBe("SS");+ expect(getInitials("ßeta test")).toBe("ST");+ });+});diff --git a/apps/web/src/lib/get-initials.ts b/apps/web/src/lib/get-initials.tsnew file mode 100644index 000000000..62fe10209--- /dev/null+++ b/apps/web/src/lib/get-initials.ts@@ -0,0 +1,19 @@+// Uppercase before selecting characters: some characters expand when+// uppercased ("ß" -> "SS"), so uppercasing afterwards could yield more+// than two characters.+export function getInitials(value: string | null | undefined, fallback = "??") {+ const parts = value?.trim().split(/\s+/).filter(Boolean) ?? [];++ if (parts.length === 0) {+ return Array.from(fallback).slice(0, 2).join("").toUpperCase();+ }++ if (parts.length === 1) {+ return Array.from(parts[0].toUpperCase()).slice(0, 2).join("");+ }++ return parts+ .slice(0, 2)+ .map((part) => Array.from(part.toUpperCase())[0])+ .join("");+}diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account.tsxindex c6a390916..d1b5cb408 100644--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account.tsx+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account.tsx@@ -17,6 +17,7 @@ import {SidebarMenuItem,} from "@/components/ui/sidebar";import { cn } from "@/lib/cn";+import { getInitials } from "@/lib/get-initials";export const Route = createFileRoute("/_layout/_authenticated/dashboard/settings/account",@@ -55,7 +56,7 @@ function RouteComponent() {<Avatar className="h-9 w-9"><AvatarImage src={user?.image ?? ""} alt={user?.name || ""} /><AvatarFallback className="text-xs font-medium border border-border/30">- {user?.name?.charAt(0).toUpperCase()}+ {getInitials(user?.name)}</AvatarFallback></Avatar><div className="flex flex-col">diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/information.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/information.tsxindex 9df2d8e6a..37453e8c1 100644--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/information.tsx+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/account/information.tsx@@ -19,6 +19,7 @@ import {import { Input } from "@/components/ui/input";import { Separator } from "@/components/ui/separator";import useUpdateUserProfile from "@/hooks/mutations/use-update-user-profile";+import { getInitials } from "@/lib/get-initials";import { toast } from "@/lib/toast";export const Route = createFileRoute(@@ -197,7 +198,7 @@ function RouteComponent() {<Avatar className="h-10 w-10"><AvatarImage src={user?.image ?? ""} alt={user?.name || ""} /><AvatarFallback className="text-xs font-medium border border-border/30">- {user?.name?.charAt(0).toUpperCase()}+ {getInitials(user?.name)}</AvatarFallback></Avatar></div>diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsxindex ca2f4ea74..aca8fadcc 100644--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsx+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsx@@ -26,6 +26,7 @@ import {import useGetProjects from "@/hooks/queries/project/use-get-projects";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { cn } from "@/lib/cn";+import { getInitials } from "@/lib/get-initials";export const Route = createFileRoute("/_layout/_authenticated/dashboard/settings/projects",@@ -64,13 +65,7 @@ function RouteComponent() {workspaceId: workspace?.id || "",});- const workspaceInitials =- workspace?.name- ?.split(" ")- .filter(Boolean)- .slice(0, 2)- .map((part) => part[0]?.toUpperCase())- .join("") || "WS";+ const workspaceInitials = getInitials(workspace?.name, "WS");const selectedProjectMatch = location.pathname.match(/^\/dashboard\/settings\/projects\/([^/]+)\//,diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsxindex d162388aa..dd55ffb6d 100644--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx@@ -20,6 +20,7 @@ import getWorkspaces from "@/fetchers/workspace/get-workspaces";import { useWorkspacePermission } from "@/hooks/use-workspace-permission";import { authClient } from "@/lib/auth-client";import { cn } from "@/lib/cn";+import { getInitials } from "@/lib/get-initials";export const Route = createFileRoute("/_layout/_authenticated/dashboard/settings/workspace",@@ -68,13 +69,7 @@ function RouteComponent() {},];const isActivePath = (path: string) => location.pathname === path;- const workspaceInitials =- workspace?.name- ?.split(" ")- .filter(Boolean)- .slice(0, 2)- .map((part) => part[0]?.toUpperCase())- .join("") || "WS";+ const workspaceInitials = getInitials(workspace?.name, "WS");return (<div className="flex gap-6 h-full">diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsxindex a871108da..cb547df02 100644--- a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx@@ -30,6 +30,7 @@ import { useGetTasks } from "@/hooks/queries/task/use-get-tasks";import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";import { useRegisterShortcuts } from "@/hooks/use-keyboard-shortcuts";import { DUE_DATE_FILTER_VALUES } from "@/hooks/use-task-filters";+import { getInitials } from "@/lib/get-initials";import { getPriorityLabel } from "@/lib/i18n/domain";import { getPriorityIcon } from "@/lib/priority";import type { SortConfig } from "@/lib/sort-tasks";@@ -598,7 +599,7 @@ function RouteComponent() {alt={member.user?.name || ""}/><AvatarFallback className="text-xs font-medium border border-border/30">- {member.user?.name?.charAt(0).toUpperCase()}+ {getInitials(member.user?.name)}</AvatarFallback></Avatar><span>{member.user?.name}</span>