diff --git a/apps/web/src/components/chat/ThreadDetailsCard.browser.test.tsx b/apps/web/src/components/chat/ThreadDetailsCard.browser.test.tsx
index e234686d6ff0..b03b58e10f4e 100644
--- a/apps/web/src/components/chat/ThreadDetailsCard.browser.test.tsx
+++ b/apps/web/src/components/chat/ThreadDetailsCard.browser.test.tsx
@@ -45,6 +45,7 @@ function Card({
rows = 1,
automationRows = 0,
serverOverflowRows = 0,
+ issueListRows = 0,
}: {
threadRef: ScopedThreadRef;
inline: boolean;
@@ -55,6 +56,8 @@ function Card({
automationRows?: number;
/** Rows of 100px that expanded server lists add, which density ignores. */
serverOverflowRows?: number;
+ /** Rows of 100px that expanded linked issues add, which density ignores. */
+ issueListRows?: number;
}) {
return (
// The web root renders in StrictMode, which re-runs ref callbacks on every mount.
@@ -92,6 +95,9 @@ function Card({
style={{ height: serverOverflowRows * 100 }}
/>
) : null}
+ {issueListRows > 0 ? (
+
+ ) : null}
>
)}
@@ -196,3 +202,13 @@ it("stays full while expanded server rows overflow", async () => {
.element(page.getByRole("region", { name: "Thread details" }))
.toHaveAttribute("data-density", "full");
});
+
+it("stays full while expanded issue rows overflow", async () => {
+ using fixture = setup();
+ await using _screen = await render(
+ ,
+ );
+ await expect
+ .element(page.getByRole("region", { name: "Thread details" }))
+ .toHaveAttribute("data-density", "full");
+});
diff --git a/apps/web/src/components/chat/ThreadDetailsCard.tsx b/apps/web/src/components/chat/ThreadDetailsCard.tsx
index 9959dbe2dc41..aadb47d0724c 100644
--- a/apps/web/src/components/chat/ThreadDetailsCard.tsx
+++ b/apps/web/src/components/chat/ThreadDetailsCard.tsx
@@ -80,10 +80,10 @@ export function ThreadDetailsCard({
const measure = () => {
const frame = element.closest("[data-thread-details-card]");
const next = element.offsetHeight + (frame ? frame.offsetHeight - frame.clientHeight : 0);
- // PR lists, servers, lineage, side chats and automations scroll as they grow. Counting them
- // toward density would hide the section and workspace controls when the user asks to see more.
+ // PR and issue lists, servers, lineage, side chats and automations scroll as they grow.
+ // Counting them toward density would hide the section and workspace controls when the user asks to see more.
const lists = element.querySelectorAll(
- "[data-thread-relationships-panel], [data-thread-side-chats-panel], [data-thread-details-pr-list], [data-thread-automations-panel], [data-thread-details-server-overflow]",
+ "[data-thread-relationships-panel], [data-thread-side-chats-panel], [data-thread-details-pr-list], [data-thread-details-issue-list], [data-thread-automations-panel], [data-thread-details-server-overflow]",
);
const fittingHeight =
next - Array.from(lists).reduce((sum, list) => sum + list.offsetHeight, 0);
diff --git a/apps/web/src/components/chat/ThreadDetailsIssueRows.tsx b/apps/web/src/components/chat/ThreadDetailsIssueRows.tsx
index 5726d1edeca1..36776560c594 100644
--- a/apps/web/src/components/chat/ThreadDetailsIssueRows.tsx
+++ b/apps/web/src/components/chat/ThreadDetailsIssueRows.tsx
@@ -160,27 +160,31 @@ export function ThreadDetailsIssueRows({
const [expandedThread, setExpandedThread] = useState(null);
const threadKey = scopedThreadKey(threadRef);
const expanded = expandedThread === threadKey;
- const hasMore = compact && links.length > 1;
- const visibleLinks = hasMore && !expanded ? links.slice(0, 1) : links;
+ const row = (link: ThreadIssueLink) => (
+
+ );
+ const [first, ...rest] = links;
+ if (first === undefined || !compact || rest.length === 0) return <>{links.map(row)}>;
return (
<>
- {visibleLinks.map((link) => (
-
- ))}
- {hasMore ? (
- setExpandedThread(expanded ? null : threadKey)}
- />
+ {row(first)}
+ {expanded ? (
+
+ {rest.map(row)}
+
) : null}
+ setExpandedThread(expanded ? null : threadKey)}
+ />
>
);
}
diff --git a/apps/web/src/components/chat/ThreadDetailsPrRow.browser.test.tsx b/apps/web/src/components/chat/ThreadDetailsPrRow.browser.test.tsx
index 666bbccd1368..d58a084f4bf6 100644
--- a/apps/web/src/components/chat/ThreadDetailsPrRow.browser.test.tsx
+++ b/apps/web/src/components/chat/ThreadDetailsPrRow.browser.test.tsx
@@ -455,6 +455,8 @@ it("names the first linked issue and reveals more issues on demand", async () =>
await expect.element(extra).not.toBeInTheDocument();
await screen.getByRole("button", { name: "Show 1 more" }).click();
await expect.element(extra).toBeVisible();
+ // The details card leaves this list out of its density measurement.
+ expect(extra.element().closest("[data-thread-details-issue-list]")).not.toBeNull();
await screen.getByRole("button", { name: "Show less" }).click();
await expect.element(extra).not.toBeInTheDocument();
});