Skip to content

fix(experiments): maybe fix flapping snapshot #36705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

andehen
Copy link
Contributor

@andehen andehen commented Aug 15, 2025

Problem

Snapshots are flapping

Changes

How did you test this code?

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR addresses flapping snapshot tests in the experiments feature by modifying the styling approach for the LemonTable component in the Exposures view. The change replaces CSS-based height and overflow handling with the LemonTable component's built-in scrollable prop.

Specifically, the PR removes the CSS classes max-h-[160px] overflow-auto that were applied to the LemonTable and replaces them with scrollable={{ y: 160 }} prop. This change affects the experiments exposure data table that displays timeseries data for experiment results.

The modification aligns with PostHog's approach to handling UI consistency issues by leveraging component-native properties rather than external CSS styling. The LemonTable's built-in scrollable prop provides more deterministic rendering behavior, ensuring the DOM structure and styling remain consistent across test runs. This change maintains the same visual functionality (a scrollable table with 160px height limit) while providing more stable rendering for snapshot tests.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it only changes the implementation approach for achieving the same visual outcome
  • Score reflects a targeted fix for a specific testing issue using established component APIs with no functional changes to user experience
  • Pay close attention to the LemonTable component usage to ensure the scrollable prop provides equivalent behavior to the removed CSS classes

Context used:

Context - When flapping snapshots are detected, provide a clear warning message indicating that they are productivity killers and must be fixed as soon as possible. Include suggestions for common causes, such as using ResizeObserver instead of CSS container queries. (link)

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Aug 15, 2025

Size Change: 0 B

Total Size: 2.68 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 2.68 MB

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

6 snapshot changes in total. 0 added, 6 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@rodrigoi rodrigoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this, looked like an overflow problem, although it's weird that it was intermittent.

@andehen andehen force-pushed the experiments/fix-flapping-snapshots branch from 58ecdfd to ae84e35 Compare August 15, 2025 14:57
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

4 snapshot changes in total. 0 added, 4 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

4 snapshot changes in total. 0 added, 4 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@andehen andehen force-pushed the experiments/fix-flapping-snapshots branch from 52188e5 to cbad20a Compare August 15, 2025 15:57
@andehen andehen force-pushed the experiments/fix-flapping-snapshots branch from cbad20a to 03b459f Compare August 15, 2025 16:03
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

20 snapshot changes in total. 0 added, 20 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

4 snapshot changes in total. 0 added, 4 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants