Skip to content

Add period selection and engagement totals to the data overview - #8

Open
bluebird42 wants to merge 1 commit into
feat/data-top-listfrom
feat/data-overview-periods
Open

bluebird42 wants to merge 1 commit into
feat/data-top-listfrom
feat/data-overview-periods

Conversation

@bluebird42

@bluebird42 bluebird42 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

The data page showed three fixed view counts (today, this month, this year) and a bar per month, so there was no way to look at the last week, compare with an earlier period, or see how long people actually watched.

The overview now has a period switch for the last 24 hours, 7 days, 30 days or 12 months (default 30 days, kept in the URL as ?period=). For the chosen period it shows:

  • Views, watch time, average watch time per view and average completion, each compared with the period of equal length right before it.
  • A chart of views per hour, day or month, with watch time as a line.
  • Device and browser breakdowns for the same period.

A view is one playback session of one video with at least one second watched, the same threshold as before. Completion is the furthest point reached divided by the video's duration. Times are in UTC. The queries live in the new MaveCore.Analytics.Overview and read the existing events table; the public space data API (Analytics.space_data/1) is unchanged.

video_metric_card gains an optional unit and comparison line; the video page keeps its current look, and storybook has an example.

Stacked on #7.

Last 30 days, compared with the 30 days before (synthetic data):

Data overview for the last 30 days

Last 12 months, per month:

Data overview for the last 12 months

Validation:

  • New Analytics.Overview tests cover the period windows, views, watch time, completion, the previous period and the one-second threshold against ClickHouse.
  • LiveView tests cover the period switch, the comparison and the loading state; the existing data page tests were updated.
  • mix compile --warnings-as-errors, mix format --check-formatted, Credo and git diff --check passed.
  • Full Core suite: 1,200 of 1,204 passed. The four failures are in StoragePolicyTest and fail identically on main in my local setup (storage reached through host.docker.internal); they are unrelated.
  • Checked all four periods in the development stack with 60 days of synthetic events.

No migration is needed.

The overview now covers 24 hours, 7 days, 30 days or 12 months instead of
fixed today/month/year counts. Views, watch time, average watch time per
view and average completion are compared with the period before, and a
chart shows views and watch time per hour, day or month. Device and browser
breakdowns follow the selected period.

A view is one playback session of one video with at least one second
watched; times are in UTC. The public space data API is unchanged.

Co-Authored-By: Claude Opus 5.5 <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