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(surveys): stack the editor preview in narrow scenes (#117895)

Lucas Faria6703c2a7212d
diff --git a/frontend/src/layout/navigation-3000/Navigation.tsx b/frontend/src/layout/navigation-3000/Navigation.tsx
index d2c2b1d91f08..d25f745dd899 100644
--- a/frontend/src/layout/navigation-3000/Navigation.tsx
+++ b/frontend/src/layout/navigation-3000/Navigation.tsx
@@ -140,7 +140,7 @@ export function Navigation({
<main
className={
mode === 'zen'
- ? 'p-4'
+ ? '@container/main-content p-4'
: mode === 'embedded'
? '@container/main-content min-h-screen p-4'
: mode === 'minimal' && sceneConfig?.layout !== 'plain'
diff --git a/frontend/src/scenes/surveys/SurveyEdit.tsx b/frontend/src/scenes/surveys/SurveyEdit.tsx
index dd94c840d41f..6e575121ed18 100644
--- a/frontend/src/scenes/surveys/SurveyEdit.tsx
+++ b/frontend/src/scenes/surveys/SurveyEdit.tsx
@@ -629,7 +629,7 @@ export default function SurveyEdit({ id }: { id: string }): JSX.Element {
return null
})()}
</div>
- <div className="flex flex-col xl:grid xl:grid-cols-[1fr_400px] gap-x-4 h-full">
+ <div className="flex flex-col @min-[60rem]/main-content:grid @min-[60rem]/main-content:grid-cols-[1fr_400px] gap-x-4 gap-y-8 h-full">
<div className="flex flex-col gap-2 flex-1 SurveyForm">
<LemonCollapse
activeKey={selectedSection || undefined}
@@ -646,7 +646,7 @@ export default function SurveyEdit({ id }: { id: string }): JSX.Element {
{({ onChange, value }) => {
return (
<div className="flex flex-col gap-2">
- <div className="grid grid-cols-2 2xl:grid-cols-4 gap-4">
+ <div className="grid grid-cols-2 @min-[80rem]/main-content:grid-cols-4 gap-4">
<PresentationTypeCard
active={value === SurveyType.Popover}
onClick={() => {
diff --git a/frontend/src/scenes/surveys/SurveyFormAppearance.tsx b/frontend/src/scenes/surveys/SurveyFormAppearance.tsx
index 146c9e2141f9..f24f83315fff 100644
--- a/frontend/src/scenes/surveys/SurveyFormAppearance.tsx
+++ b/frontend/src/scenes/surveys/SurveyFormAppearance.tsx
@@ -32,7 +32,7 @@ export function SurveyFormAppearance({
}
return survey.type !== SurveyType.API ? (
- <div className="flex flex-col h-full gap-2 items-start flex-1 xl:pl-8 pt-8 xl:pt-0">
+ <div className="flex flex-col h-full gap-2 items-start flex-1 @min-[60rem]/main-content:pl-8">
<SurveyAppearancePreview
survey={survey as Survey}
previewPageIndex={effectivePageIndex}