Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(phai): make the new sidebar view scroll internally (#68250)

Georgiy Tarasovb17a2ba87805
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index da64199c51a9..6d3cae17ba00 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -4959,7 +4959,7 @@ snapshots:
scenes-app-customer-analytics-accounts--default--dark:
hash: v1.k794b7964.c208ae9e334d2f3dc220f35ceb269b124a054acef5e342fdbc583e026f05d52f.vE6mY_JxSO2tMmTZ8TbCRnXZW8qRN8fNdsmT0zXP5VU
scenes-app-customer-analytics-accounts--default--light:
- hash: v1.k794b7964.3d2515571d6b369099cb87266a3f6c619806ebcef93c26000282a1a0b8cfe979.O2c6Y2Ba6CnAChnAc3dbccjAPzPa74dRTqzmF1H76aE
+ hash: v1.k794b7964.12bd6621a42884928ca2d187e70e676a79f2edbad2f09a1f4cc42140d7cce6c1.S2kYUTzb6Rv3AVPOA8YWSrs-GLXK_MUNH4Gpib6dwcA
scenes-app-customer-analytics-accounts--empty--dark:
hash: v1.k794b7964.892b7da6722a32bd8383152a945e4bbc30eefebf1b9daa79d615e55a969e1a52._oCcXCKvTuiGNNd4h0WZ2YoMvWXtHmgHCxHmljYucH0
scenes-app-customer-analytics-accounts--empty--light:
diff --git a/frontend/src/scenes/max/Max.tsx b/frontend/src/scenes/max/Max.tsx
index e5ab672a53da..3c37eac928f2 100644
--- a/frontend/src/scenes/max/Max.tsx
+++ b/frontend/src/scenes/max/Max.tsx
@@ -237,7 +237,11 @@ export const MaxInstance = React.memo(function MaxInstance({ sidePanel, tabId }:
return sidePanel ? (
<>
- <SidePanelContentContainer contentClassName="flex flex-col flex-1">
+ {/* The new view scrolls internally (virtualized thread, history list), so the ScrollArea
+ content must stay clamped to the panel height — without `min-h-0` its `min-height: auto`
+ grows it to fit the whole thread and no scroller ever engages. The legacy view is the
+ opposite: it relies on this container growing so the outer viewport scrolls it. */}
+ <SidePanelContentContainer contentClassName={cn('flex flex-col flex-1', isNewView && 'min-h-0')}>
{header}
{content}
</SidePanelContentContainer>
diff --git a/frontend/src/scenes/max/components/PhaiSidePanelChat.tsx b/frontend/src/scenes/max/components/PhaiSidePanelChat.tsx
index 2c6537e3b685..e1ddfa92f320 100644
--- a/frontend/src/scenes/max/components/PhaiSidePanelChat.tsx
+++ b/frontend/src/scenes/max/components/PhaiSidePanelChat.tsx
@@ -13,7 +13,13 @@ export const MAX_SIDE_PANEL_ID = 'max-side-panel'
*/
export function PhaiSidePanelChat(): JSX.Element {
return (
- <div className="flex flex-col h-full min-h-0">
+ // `flex-1 min-h-0`, NOT `h-full`: the side panel hosts this inside a ScrollArea whose content
+ // grows with its children (`min-height: auto`), so a percentage height resolves against the
+ // grown box — the runner then inflates to its full thread height and its internal scrollers
+ // never engage (and `overscroll-contain` on the thread swallows wheel events entirely).
+ // Taking remaining flex space instead (zero min-content contribution) keeps the panel clamped
+ // to the viewport so the thread/history scroll internally as designed.
+ <div className="flex flex-col flex-1 min-h-0">
<SidePanelRunner panelId={MAX_SIDE_PANEL_ID} />
</div>
)