From c4930f315cdc6bd8a337e089afcae071e6a1a8a0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 3 Apr 2026 18:49:36 -0400 Subject: [PATCH] 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 --- app/components/Breadcrumb.tsx | 6 +----- app/components/DocumentBreadcrumb.tsx | 30 ++++++++------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/app/components/Breadcrumb.tsx b/app/components/Breadcrumb.tsx index d3671651e3..164b2d1cd4 100644 --- a/app/components/Breadcrumb.tsx +++ b/app/components/Breadcrumb.tsx @@ -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; } diff --git a/app/components/DocumentBreadcrumb.tsx b/app/components/DocumentBreadcrumb.tsx index 65e83119fb..6763043280 100644 --- a/app/components/DocumentBreadcrumb.tsx +++ b/app/components/DocumentBreadcrumb.tsx @@ -101,11 +101,16 @@ function DocumentBreadcrumb( ), + icon: node.icon ? ( + + ) : 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 ? ( - <> - {" "} - {title} - - ) : ( - title - ); - if (!doc) { - return <>{content}; + return <>{title}; } return ( @@ -236,7 +224,7 @@ const DocumentName = observer(function DocumentName_({ }} > - {content} + {title} );