Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sidebar-row-label-width.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hashintel/petrinaut": patch
---

Sidebar list labels use the full row width and truncate with an ellipsis consistently; the row menu button only takes space while hovering the row or while its menu is open.
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,15 @@ const listItemRowStyle = cva({
true: {
cursor: "pointer",

/* Reveal the action button on hover or when its menu is open */
/* Reveal the action button on hover or when its menu is open. Hidden
with `display` rather than `opacity` so it takes no space and the
label keeps the full row width until the button is shown. */
"& [data-row-action]": {
opacity: "[0]",
transition: "[opacity 150ms ease-out]",
},
"& [data-row-action] svg": {
transform: "[translateX(2px)]",
transition: "[transform 150ms ease-out]",
display: "none",
},
"&:hover [data-row-action], & [data-row-action][data-state=open]": {
opacity: "[1]",
display: "flex",
},
"&:hover [data-row-action] svg, & [data-row-action][data-state=open] svg":
{
transform: "none",
},
},
},
isSelected: {
Expand Down Expand Up @@ -118,13 +111,21 @@ const listItemContentStyle = css({

const listItemNameStyle = css({
flex: "[1]",
minWidth: "[0]",
fontSize: "sm",
fontWeight: "medium",
lineHeight: "snug",
color: "neutral.s115",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
/* renderItem may nest its own lines (e.g. a name with a subtitle); each
line truncates the same way plain-text items do. */
"& *": {
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
},
});

const LIST_ITEM_ICON_SIZE = 12;
Expand Down
Loading