Skip to content
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

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

Conversation

rafaeelaudibert
Copy link
Member

@rafaeelaudibert rafaeelaudibert commented Feb 3, 2025

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

@rafaeelaudibert rafaeelaudibert requested review from corywatilo, adamleithp and a team February 3, 2025 18:52
@rafaeelaudibert
Copy link
Member Author

Marked as WIP while I fix CI - it'll certainly break

Copy link
Contributor

github-actions bot commented Feb 3, 2025

Size Change: +5 B (0%)

Total Size: 1.18 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.18 MB +5 B (0%)

compressed-size-action

@rafaeelaudibert rafaeelaudibert force-pushed the 28172-improve-insight-loading-state branch from 3822319 to 531668a Compare February 3, 2025 19:57
@PostHog PostHog deleted a comment from posthog-bot Feb 3, 2025
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert force-pushed the 28172-improve-insight-loading-state branch from 2dca437 to 822d62c Compare February 3, 2025 21:12
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 14 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert marked this pull request as ready for review February 3, 2025 22:15
@PostHog PostHog deleted a comment from posthog-bot Feb 3, 2025
Comment on lines 1 to 4
/* 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%);
}
Copy link
Member Author

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?

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.

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

@rafaeelaudibert rafaeelaudibert force-pushed the 28172-improve-insight-loading-state branch from 43d1eb0 to 593b946 Compare February 4, 2025 16:40
Copy link
Member

@robbie-c robbie-c left a 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

@rafaeelaudibert rafaeelaudibert force-pushed the 28172-improve-insight-loading-state branch 2 times, most recently from 7f3cb5d to fcfd04b Compare February 5, 2025 17:31
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert force-pushed the 28172-improve-insight-loading-state branch from 9414066 to 22949c3 Compare February 5, 2025 18:25
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert force-pushed the 28172-improve-insight-loading-state branch from fbf2245 to e45008d Compare February 7, 2025 14:29
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@rafaeelaudibert rafaeelaudibert force-pushed the 28172-improve-insight-loading-state branch from 0b5a030 to 1aa3e70 Compare February 7, 2025 22:09
rafaeelaudibert and others added 11 commits February 7, 2025 19:11
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
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

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

  • chromium: 0 added, 3 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 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.

~10x~ 2x the insight loading state
3 participants