Skip to content

Add Kolibri-usage filters and CSV export to admin Users page#5922

Draft
rtibbles wants to merge 1 commit into
learningequality:hotfixesfrom
rtibbles:get_laura_the_deets_stat
Draft

Add Kolibri-usage filters and CSV export to admin Users page#5922
rtibbles wants to merge 1 commit into
learningequality:hotfixesfrom
rtibbles:get_laura_the_deets_stat

Conversation

@rtibbles
Copy link
Copy Markdown
Member

Summary

Adds a Download CSV action on the admin Users page so Laura can pull user emails for outreach. Adds four filters for likely-Kolibri-usage signals: published a channel, made Studio edits, joined recently, active recently. CSV includes email, basic activity, and registration info (locations, storage needed, source).

State Screenshot
Default view with new filter row Default
Two new checkbox filters applied Filtered
Download CSV disabled when count is 0 Disabled

References

Slack thread with Laura on Studio activity signals that correlate with Kolibri usage.

Reviewer guidance

How to test:

  • /administration/users: toggle the new filters and confirm counts narrow (they AND with the existing filters).
  • Click Download CSV with no filter → snackbar says "No filters applied"; no download.
  • Apply a filter, click Download CSV → file downloads as studio_users_<YYYY-MM-DD>.csv. Verify Locations / Heard from / Yes-No columns.
  • Filter to 0 results → button is disabled.

Worth a closer look:

  • viewsets/user.pyAdminUserCSVFilter(AdminUserFilter, RequiredFilterSet) MRO; required-filter enforcement comes from RequiredFiltersFilterBackend recognising detail=False.
  • Load-tested at 30k users / 17k channels: all scenarios <1s.

AI usage

Used Claude Code (Superpowers) to brainstorm the design and implement the changes. The spec, plan, and code were reviewed at each step; backend + frontend tests, a load test at 30k users / 17k channels, and a manual browser smoke-test all pass.

Adds four new filters to the admin Users page based on signals of likely
Kolibri usage (Slack conversation with Laura): published a channel,
made Studio edits, joined recently, active recently. Adds a Download CSV
action that streams the filtered user list as CSV, including registration
information (locations, storage needed, source).

Backend filters share Exists() expressions between AdminUserFilter and the
CSV action's annotate() call. The CSV endpoint uses AdminUserCSVFilter
(a RequiredFilterSet subclass) so unfiltered exports return 412.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant