-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: Improve insights overall loading state #28229
Conversation
Marked as WIP while I fix CI - it'll certainly break |
Size Change: 0 B Total Size: 1.18 MB ℹ️ View Unchanged
|
3822319
to
531668a
Compare
📸 UI snapshots have been updated33 snapshot changes in total. 0 added, 33 modified, 0 deleted:
Triggered by this commit. |
...__/scenes-app-insights-error-empty-states--estimated-query-execution-time-too-long--dark.png
Outdated
Show resolved
Hide resolved
frontend/__snapshots__/scenes-app-insights-error-empty-states--long-loading--dark.png
Outdated
Show resolved
Hide resolved
2dca437
to
822d62c
Compare
📸 UI snapshots have been updated14 snapshot changes in total. 0 added, 14 modified, 0 deleted:
Triggered by this commit. |
/* TODO: Migrate this to a CSS variable (with a `bg-` Tailwind class) once @adamleithp finishes his Tailwind work */ | ||
.insights-empty-state { | ||
background-color: rgb(129 129 129 / 20%); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamleithp I'm expecting us to be able to use some kind of ´bg-gray-600/50` class once your TW4 changes are live, are we getting that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that we don't let engineers write this kind of tailwind class; adding opacity on the fly promotes deviation from controlled colors and leads to potential contrast issues!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR modernizes the insight loading states across PostHog to be more visually lightweight and consistent with modern design patterns.
Key changes:
- Replaced class-based selectors with data attributes (e.g.
[data-attr="insight-empty-state"]
) across test files for better maintainability - Added rotating loading messages with fade transitions in EmptyStates.tsx
- Simplified loading state UI by removing extra wrappers and reducing vertical space
- Implemented non-linear progress bar that caps at 99% using arctangent function
- Consolidated styles using Tailwind classes instead of separate CSS files
The changes improve visual consistency while maintaining core functionality and test coverage.
13 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile
frontend/src/scenes/insights/EmptyStates/EmptyStates.stories.tsx
Outdated
Show resolved
Hide resolved
frontend/src/scenes/insights/EmptyStates/EmptyStates.stories.tsx
Outdated
Show resolved
Hide resolved
43d1eb0
to
593b946
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let the more design-oriented people give their feedback about that part. It looks like greptile has a few good comments here
7f3cb5d
to
fcfd04b
Compare
📸 UI snapshots have been updated18 snapshot changes in total. 0 added, 18 modified, 0 deleted:
Triggered by this commit. |
9414066
to
22949c3
Compare
📸 UI snapshots have been updated32 snapshot changes in total. 0 added, 32 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
fbf2245
to
e45008d
Compare
📸 UI snapshots have been updated32 snapshot changes in total. 0 added, 32 modified, 0 deleted:
Triggered by this commit. |
0b5a030
to
1aa3e70
Compare
📸 UI snapshots have been updated3 snapshot changes in total. 0 added, 3 modified, 0 deleted:
Triggered by this commit. |
frontend/__snapshots__/scenes-app-insights-loading-messages--loading-messages--dark.png
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah here it is, looks great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could probably sit on the default background like before (less box inside a box, and also that progress bar remainder is kinda lost...), that's my only suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could probably sit on the default background like before (less box inside a box, and also that progress bar remainder is kinda lost...), that's my only suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole idea that @corywatilo suggested in #28172 is the box so that it looks more like a Skeleton with that gray background. The problem here might be that we're trying to add it to places it shouldn't be, thoughts? If the UI isn't ready for a Skeleton-ready container (too box-y, which I agree), then maybe we should just scratch this for now. Or maybe we should make that bg optional? Not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yea Cory does specifically [in a] "frame", ok fair enough, let's see how it goes! LGTM, it's definitely better than it was.
/* TODO: Migrate this to a CSS variable (with a `bg-` Tailwind class) once @adamleithp finishes his Tailwind work */ | ||
.insights-empty-state { | ||
background-color: rgb(129 129 129 / 20%); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that we don't let engineers write this kind of tailwind class; adding opacity on the fly promotes deviation from controlled colors and leads to potential contrast issues!
336aef1
to
bc7309f
Compare
This isn't very modern and it occupies a lot of space. This was prompted by it not fitting the Web Vitals UI, let's tweak it all around the app and see if it looks nicer like this.
Or else the snapshot is never generated because the selector is never found
We only need the gray background while loading, let's remove it from the other ones
bc7309f
to
abd6c9a
Compare
📸 UI snapshots have been updated28 snapshot changes in total. 0 added, 28 modified, 0 deleted:
Triggered by this commit. |
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Our loading state for insights isn't very modern and it occupies a lot of space. This was prompted by it not fitting the Web Vitals UI, let's tweak it all around the app and see if it looks nicer like this.
Gravacao.de.Tela.2025-02-05.153252.mp4
Does this work well for both Cloud and self-hosted?
Oh yeah
How did you test this code?
Visually locally + snapshots
Closes #28172