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(insights): stretch sample-data chart to its container height (#117703)

Sam Pennington0f98f7fcd258
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 557ddd6b48b0..5427da06d4cb 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -2525,17 +2525,21 @@ snapshots:
components-releasestagetag--internal--light:
hash: v1.k794b7964.18c439d8f91e2f463a5212933f502cd084ac8c4d796963ba7ff8c8946e4cc5fb.uEErXKcQANzO8ov9EwNwoFS-YcmeCWkxYTTAkQkRRoE
components-sample-data-state--all-variants--dark:
- hash: v1.k794b7964.f78ff2e4dfb88eb594e79cfd2946658b5cf762d48f60586fc52ca5cfa5edae93.lTPuhty3xFx4X4LZxMSTIGchYb4cDBus5_GB8-pQa6w
+ hash: v1.k794b7964.ba65f5d8e57054f325e170812f9d31c057a8f8070d14b3e5716d7c3ba02015d4.IIBB6wB_wsIZrSeiCXxlHgISe-3Fl0x4TjCibmfzGrY
components-sample-data-state--all-variants--light:
- hash: v1.k794b7964.0c07edc11002b2ce97bc1d9ade124e890d09f6ac320be361fa69734a57d883a0.ZC5gGxbcfhBg7mb3LwAxEd1U3BsR21JB6_M8MKW6xx8
+ hash: v1.k794b7964.3411c1d7ee4e5438f4b734990b0c4a92c6f43e6dd665753ce7e0b9a31c63821e.ak4ir1KbKJecDHZxQW-RnAOp83Bh4x6io90YIGidujs
+ components-sample-data-state--in-trends-insight-container--dark:
+ hash: v1.k794b7964.e3d6fad2d4fe34560cac1ef28978c867941094f2c9576488c08731694152821b.OJEdHAzePZmVzaGzV9ZwEAN1wmOjSLQ0MdFX3IfvolY
+ components-sample-data-state--in-trends-insight-container--light:
+ hash: v1.k794b7964.ac28a959fdb17a7f5b652ea842c868d1b4e7f3e64f16fe0d83b3934a8b9999cb.g_2sXAo-vCvj6VtLph3kfcMdz195fvWHgUcWDwVHx4s
components-sample-data-state--with-setup-pull-request--dark:
- hash: v1.k794b7964.a7647c826dc90cc8f49595664f6da4e08b6a623c018b67413168e7a423ea4e5b.zYzBM5U_KBYjVXH7MR_BUlxgJuH6t6IMTcDtgmwn_rQ
+ hash: v1.k794b7964.90568ee1cef92acc75b4ffdb5a45fbd6885ded5a52c0da8d38cba743b20fcbef.hCQrxb2KAzXadxML1u6yWKRBwBhgrI7cxjTV3ln9-xA
components-sample-data-state--with-setup-pull-request--light:
- hash: v1.k794b7964.c999858750e590d7e4f9a824e9c4284cdec860e01740c3a55e3da95e07ac0b3b.sQkDf-suJjVk-MAuh_TLKI14oh4mQH5jnHRjFTCV6wM
+ hash: v1.k794b7964.8dd4fe1c3ba133d79c380a7b2b54671d4436ea4a7c44f77114a3a12e7f1df608.rlcBcKUDp6bQ6ThZh_IFJUqQ4iUWY5ueBtE3hIPagnQ
components-sample-data-state--wizard-installing--dark:
- hash: v1.k794b7964.5f13bf50d33b9d3257d8a93eea04dc06edfc31a86ac947e74fc7f32ff23750da.vV-ots4x1jS78n1arxGnPxkVZ2x3hiQSekk9XBwvvdo
+ hash: v1.k794b7964.183aeffec9299b6082c9a77379809f72d795d2fb6f526690f38f8d3e7238fd68.2k-6L2URel53OIeEQso_E2F2aYU7eUtmkYqCMm0IpKU
components-sample-data-state--wizard-installing--light:
- hash: v1.k794b7964.2052c49beff2e0a5c5c533ae05c73bacc2619a04053b4529acf93574160c3a66.sTXp62J02o4EVCFfSt9_QV7YwS6UN87FpVxkPGrmZ3o
+ hash: v1.k794b7964.ce75ffc2d117ea9dba7116ae3fe76e11e374492042ecf6525a0b16e938a2683b.lw3ixL5MAvNstgtC9RqdSQyRvK8XdjSFdA5R6D2x66s
components-sample-data-tag--default--dark:
hash: v1.k794b7964.59c7a8b6d1d563565a9f3efa7c9bac27a87225ec9bee0021e0b80e5420783056.9w3awIuhlR02uWkYgTVenAzkCRqWD4s20qdlLzfmwnw
components-sample-data-tag--default--light:
diff --git a/frontend/src/scenes/insights/EmptyStates/SampleDataState.scss b/frontend/src/scenes/insights/EmptyStates/SampleDataState.scss
index 704163959035..6f3425dc65a9 100644
--- a/frontend/src/scenes/insights/EmptyStates/SampleDataState.scss
+++ b/frontend/src/scenes/insights/EmptyStates/SampleDataState.scss
@@ -42,8 +42,8 @@
// The quill chart root stretches via flex-1, so it needs a flex column parent
display: flex;
flex-direction: column;
+ align-self: stretch;
width: 100%;
- height: 100%;
// The chart is a picture of made-up data, so it answers nothing the pointer asks of it.
// Hover still reaches __viz, which owns the settle-to-full-opacity effect.
@@ -68,30 +68,22 @@
animation: SampleDataState__fade-up 0.7s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}
- // One-shot entrance animations complete instantly for reduced motion or screenshot tests;
- // the looping "breathe" is dropped entirely.
- &--static &__viz {
- animation: none;
- }
-
+ // Reduced motion and screenshot tests get no animation at all. A zero-duration animation is not
+ // enough, because headless Chromium in CI can paint its 0% keyframe, which hides the placeholder.
+ &--static &__viz,
&--static &__chart,
&--static &__row,
&--static &__number {
- animation-duration: 0s;
- animation-delay: 0s;
+ animation: none;
}
}
@media (prefers-reduced-motion: reduce) {
- .SampleDataState__viz {
- animation: none;
- }
-
+ .SampleDataState__viz,
.SampleDataState__chart,
.SampleDataState__row,
.SampleDataState__number {
- animation-duration: 0s;
- animation-delay: 0s;
+ animation: none;
}
}
diff --git a/frontend/src/scenes/insights/EmptyStates/SampleDataState.stories.tsx b/frontend/src/scenes/insights/EmptyStates/SampleDataState.stories.tsx
index 9ba611331c9c..129e9058be1e 100644
--- a/frontend/src/scenes/insights/EmptyStates/SampleDataState.stories.tsx
+++ b/frontend/src/scenes/insights/EmptyStates/SampleDataState.stories.tsx
@@ -32,6 +32,18 @@ export const AllVariants: Story = {
),
}
+/** Uses the real `.InsightVizDisplay > .TrendsInsight` container instead of a fixed-height div, so it can catch height regressions the other stories can't. */
+export const InTrendsInsightContainer: Story = {
+ loaders: [async () => void (await import('~/queries/nodes/InsightViz/InsightViz.scss'))],
+ render: () => (
+ <div className="InsightVizDisplay border rounded w-160">
+ <div className="TrendsInsight TrendsInsight--ActionsLineGraph">
+ <SampleDataState variant="line" />
+ </div>
+ </div>
+ ),
+}
+
/** The wizard's cloud run is still working - no PR yet, so an "Installing PostHog..." tag shows. */
export const WizardInstalling: Story = {
decorators: [