Skip to content

feat: Display count of persons for early access features #30966

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

Merged
merged 3 commits into from
Apr 8, 2025

Conversation

rafaeelaudibert
Copy link
Member

Problem

This bothered me, so I fixed it. Previously, we had to keep clicking until we had loaded all of the users because we could see how many had enabled access to our feature.

Changes

Query and display the count 🤷🏻

image

Does this work well for both Cloud and self-hosted?

Yeap

How did you test this code?

Manual

This bothered me so I fixed it. Previously we had to keep clicking until we had loaded *all* of the users because we could see how many had enabled access to our feature, we're now displaying it at the top.
@rafaeelaudibert rafaeelaudibert requested a review from a team April 8, 2025 22:01
Comment on lines +103 to +118
const results = await Promise.all(
['true', 'false'].map((value) =>
performQuery<ActorsQuery>({
kind: NodeKind.ActorsQuery,
properties: [
{
key: values.featureEnrollmentKey,
type: PropertyFilterType.Person,
operator: PropertyOperator.Exact,
value: [value],
},
],
select: ['count()'],
})
)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe I could do this with a single query and a breakdown? I don't know enough about our queries to know that yet, happy to change if that's possible

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

Overall, this PR refactors the early access feature UI to dynamically display the count of opted-in and opted-out users by integrating a new loader into the existing logic.

  • Updated user count labels in products/early_access_features/frontend/EarlyAccessFeature.tsx (LemonTabs labels now show counts).
  • Added a new personsCount loader with breakpoint delays in products/early_access_features/frontend/earlyAccessFeatureLogic.ts.
  • Renamed the filtering helper to featureFlagRecordingEnrolmentFilter for clarity.
  • Ensured consistent integration with async queries and state management for dynamic updates.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Apr 8, 2025

Size Change: +670 B (+0.01%)

Total Size: 13.2 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 13.2 MB +670 B (+0.01%)

compressed-size-action

Copy link
Contributor

@haacked haacked left a comment

Choose a reason for hiding this comment

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

Don't know enough about querying to suggest whether you should try to make it a single query, but code looks good to me otherwise.

@rafaeelaudibert rafaeelaudibert enabled auto-merge (squash) April 8, 2025 22:26
@rafaeelaudibert rafaeelaudibert merged commit 0c33ba4 into master Apr 8, 2025
110 checks passed
@rafaeelaudibert rafaeelaudibert deleted the count-early-access-features-users branch April 8, 2025 22:38
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.

2 participants