Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Bookmark icon misplaced in sidebar items with long labels (#83148)

Egor Grushinec1b55a09ef8
diff --git a/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarItems.styled.tsx b/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarItems.styled.tsx
index 77e229c49b4..003a2d276dc 100644
--- a/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarItems.styled.tsx
+++ b/frontend/src/metabase/nav/containers/MainNavbar/SidebarItems/SidebarItems.styled.tsx
@@ -7,7 +7,6 @@ import { forwardRef } from "react";
import { Link } from "metabase/common/components/Link";
import { TreeNode } from "metabase/common/components/tree/TreeNode";
-import { NAV_SIDEBAR_WIDTH } from "metabase/nav/constants";
import type { IconProps } from "metabase/ui";
import { Icon, Tooltip } from "metabase/ui";
import { alpha } from "metabase/ui/colors";
@@ -96,6 +95,7 @@ const itemContentStyle = css`
display: flex;
align-items: center;
width: 100%;
+ min-width: 0;
`;
export const FullWidthButton = styled.button<{ isSelected: boolean }>`
@@ -134,10 +134,9 @@ export const FullWidthContainer = styled.div`
`;
const ITEM_NAME_LENGTH_TOOLTIP_THRESHOLD = 35;
-const ITEM_NAME_LABEL_WIDTH = Math.round(parseInt(NAV_SIDEBAR_WIDTH, 10) * 0.7);
export const ItemName = styled(TreeNode.NameContainer)`
- width: ${ITEM_NAME_LABEL_WIDTH}px;
+ min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;