Repository navigation
Conversation
Admins get an Analytics page in Wonky Drive (/drive/analytics, admin-only left-menu entry and `drive.analytics.show`): accounts, active today, weekly and monthly active users, stickiness, active users by app, sign-ups, content now and created, collaboration, AI and MCP use, and weekly sign-up cohorts. Aggregates only; admins are left out unless *Include admins* is on. Recording is first-party and minimal (specs/19): one `user_activity_day` row per person, UTC day and app, from the apps' ping at start/resume, item opens, creations and edits (the activity log) and MCP tool calls. Welcome content, scripts and the system don't count. Rows are kept 400 days. Finished days are rolled up once into `usage_day_stats` (a past day never changes), so the rolling DAU/WAU/MAU windows stay off the request path; new indexes cover the date-range scans (activity_event type+at, comment, permission grantedAt, ai_usage at, user_profile createdAt). The charts are drawn in Drive with the app's tokens, colors checked for color vision deficiency, each with a table view. The privacy policy names usage data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Superseded by #30 (same change, opened from the fork vlidholt/wonky). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An admin-only Analytics page in Wonky Drive (
/drive/analytics), built on first-party data in our own Postgres (spec:specs/19-usage-analytics.md).drive.analytics.show. Every chart has a table view, and the page shows aggregates only.board.adminEmailDomains/adminEmails), checked on the server. The left-menu entry only shows for admins (HomeNavItem(adminOnly: true)).user_activity_dayrow per person, UTC day and app; no content.analytics.purgeActivity). Tracking never fails the request that triggers it.usage_day_stats, since a past UTC day never changes. The rollingcount(DISTINCT)windows therefore run only for today.activity_event(type, at),comment(createdAt),drive_item_permission(grantedAt),ai_usage(at)(also serves the purge) anduser_profile(createdAt).wonky_drivewith the app's tokens, notwonky_charts_flutter. That engine would pullflutter_sceneand its assets into Drive's bundle. Colors were checked for color vision deficiency in light and dark.Two migrations:
usage-analytics(tables) andanalytics-indexes(rollup and indexes).Testing
wonky_server:dart test -x slow -j 2: 2,382 passed, 1 skipped. The analytics tests run in far-future date windows that they clear first, so they're isolated in the shared test database and pass on repeated runs.wonky_drive:flutter test: all non-golden tests pass, including 25 analytics widget and unit tests (admin and non-admin, period and switch, hover tooltip, table view, dark, 360 px, pseudo-locale). The goldens weren't compared locally (spec 15 §7: Linux CI only).wonky_app:flutter test -x golden,slow,e2e: all pass. The mobile left-menu test now skips admin-only entries.dart analyzeis clean in the server, Drive and the shell; the dependency rules check is OK.🤖 Generated with Claude Code