Skip to content

Commit 660773a

Browse files
committed
fix(web): ignore capped project overflow in parent breadcrumb fit
1 parent 37bd97c commit 660773a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/web/src/components/chat/ChatHeader.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export const ChatHeader = memo(function ChatHeader({
9696
if (!list || !parentThreadLink) return;
9797
// Measure the untruncated labels, including a collapsed parent's hidden
9898
// text, so expanding and collapsing never change the fit calculation.
99+
// Width-capped labels (the project) never grow, so their overflow is skipped.
99100
const measure = () => {
100101
const gap = Number.parseFloat(getComputedStyle(list).columnGap) || 0;
101102
const width = Array.from(list.children).reduce(
@@ -105,7 +106,9 @@ export const ChatHeader = memo(function ChatHeader({
105106
return (
106107
total +
107108
(item.firstElementChild?.getBoundingClientRect().width ?? 0) +
108-
(label ? label.scrollWidth - label.clientWidth : 0) -
109+
(label && getComputedStyle(label).maxWidth === "none"
110+
? label.scrollWidth - label.clientWidth
111+
: 0) -
109112
(ellipsis?.getBoundingClientRect().width ?? 0)
110113
);
111114
},

0 commit comments

Comments
 (0)