Skip to content

Commit 5ef78ec

Browse files
committed
fix(web): many automations no longer hide the thread details Automations section
1 parent b50d8a1 commit 5ef78ec

3 files changed

Lines changed: 26 additions & 7 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export function ThreadAutomationsPanel(props: {
153153
</Tooltip>
154154
}
155155
>
156-
<ul className="m-0 list-none p-0">
156+
<ul className="m-0 max-h-[13.5rem] list-none overflow-y-auto overscroll-contain p-0">
157157
{boundTasks.map((task) => (
158158
<li
159159
key={task.id}

‎apps/web/src/components/chat/ThreadDetailsCard.browser.test.tsx‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ function Card({
4343
inline,
4444
fixture,
4545
rows = 1,
46+
automationRows = 0,
4647
}: {
4748
threadRef: ScopedThreadRef;
4849
inline: boolean;
4950
fixture: ReturnType<typeof setup>;
5051
/** Rows of 100px shown at full density. Compact always takes 50px. */
5152
rows?: number;
53+
/** Rows of 100px in an automations list shown at full density. */
54+
automationRows?: number;
5255
}) {
5356
return (
5457
// The web root renders in StrictMode, which re-runs ref callbacks on every mount.
@@ -73,9 +76,14 @@ function Card({
7376
contentKey={String(rows)}
7477
>
7578
{(density) => (
76-
<p style={{ height: density === "full" ? rows * 100 : 50 }}>
77-
Details for {threadRef.threadId}
78-
</p>
79+
<>
80+
<p style={{ height: density === "full" ? rows * 100 : 50 }}>
81+
Details for {threadRef.threadId}
82+
</p>
83+
{density === "full" && automationRows > 0 ? (
84+
<section data-thread-automations-panel style={{ height: automationRows * 100 }} />
85+
) : null}
86+
</>
7987
)}
8088
</ThreadDetailsCard>
8189
</ChatCanvasContext>
@@ -158,3 +166,14 @@ it("returns to full density when hidden items make the content fit", async () =>
158166
await screen.rerender(<Card threadRef={threadB} inline fixture={fixture} rows={2} />);
159167
await expect.element(card).toHaveAttribute("data-density", "full");
160168
});
169+
170+
it("keeps full density when many automations make the content tall", async () => {
171+
using fixture = setup();
172+
await using _screen = await render(
173+
<Card threadRef={threadB} inline fixture={fixture} rows={2} automationRows={6} />,
174+
);
175+
await expect.element(page.getByText("Details for thread-b")).toBeVisible();
176+
await expect
177+
.element(page.getByRole("region", { name: "Thread details" }))
178+
.toHaveAttribute("data-density", "full");
179+
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ export function ThreadDetailsCard({
7878
const measure = () => {
7979
const frame = element.closest<HTMLElement>("[data-thread-details-card]");
8080
const next = element.offsetHeight + (frame ? frame.offsetHeight - frame.clientHeight : 0);
81-
// PR lists, lineage and side chats scroll as they expand. Counting them toward density
82-
// would hide the section and workspace controls when the user asks to see more rows.
81+
// PR lists, lineage, side chats and automations scroll as they grow. Counting them toward
82+
// density would hide the section and workspace controls when the user asks to see more rows.
8383
const lists = element.querySelectorAll<HTMLElement>(
84-
"[data-thread-relationships-panel], [data-thread-side-chats-panel], [data-thread-details-pr-list]",
84+
"[data-thread-relationships-panel], [data-thread-side-chats-panel], [data-thread-details-pr-list], [data-thread-automations-panel]",
8585
);
8686
const fittingHeight =
8787
next - Array.from(lists).reduce((sum, list) => sum + list.offsetHeight, 0);

0 commit comments

Comments
 (0)