fix: Breadcrumb item text disappearing when document has icon (#11942) (#11948)

Move document icons out of the ContextMenu trigger span and into the
action's icon property, consistent with how collection icons work. Block-level
icon elements (FontAwesome, custom emoji) inside the inline span were taking
a full line and pushing text below the overflow clip. Also remove display:flex
from breadcrumb Item so text-overflow:ellipsis works correctly.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom MoorandClaude Opus 4.6 authored and GitHub committed 2026-04-03 18:49:36 -04:00
1 parent 5d5213101e
commit c4930f315c
2 files changed
+10 -26

No files matched your search

+1 -5
View File
@@ -113,20 +113,16 @@ const Item = styled(Link)<{ $highlight: boolean; $withIcon: boolean }>`
${ellipsis()}
${undraggableOnDesktop()}
display: flex;
flex-shrink: 1;
min-width: 0;
cursor: var(--pointer);
color: ${s("text")};
font-size: 15px;
height: 24px;
line-height: 24px;
font-weight: ${(props) => (props.$highlight ? "500" : "inherit")};
margin-left: ${(props) => (props.$withIcon ? "4px" : "0")};
svg {
flex-shrink: 0;
}
&:hover {
text-decoration: underline;
}
+9 -21
View File
@@ -101,11 +101,16 @@ function DocumentBreadcrumb(
<DocumentName
documentId={node.id}
collection={collection}
icon={node.icon}
color={node.color}
title={title}
/>
),
icon: node.icon ? (
<StyledIcon
value={node.icon}
color={node.color}
initial={title.charAt(0).toUpperCase()}
/>
) : undefined,
section: ActiveDocumentSection,
to: {
pathname: node.url,
@@ -197,14 +202,10 @@ const CollectionName = observer(function CollectionName_({
const DocumentName = observer(function DocumentName_({
documentId,
collection,
icon,
color,
title,
}: {
documentId: string;
collection: Collection | undefined;
icon: string | undefined;
color: string | undefined;
title: string;
}) {
const { t } = useTranslation();
@@ -212,21 +213,8 @@ const DocumentName = observer(function DocumentName_({
const doc = documents.get(documentId);
const menuAction = useDocumentMenuAction({ documentId });
const content = icon ? (
<>
<StyledIcon
value={icon}
color={color}
initial={title.charAt(0).toUpperCase()}
/>{" "}
{title}
</>
) : (
title
);
if (!doc) {
return <>{content}</>;
return <>{title}</>;
}
return (
@@ -236,7 +224,7 @@ const DocumentName = observer(function DocumentName_({
}}
>
<ContextMenu action={menuAction} ariaLabel={t("Document options")}>
<span>{content}</span>
<span>{title}</span>
</ContextMenu>
</ActionContextProvider>
);