Skip to content

Add overview and top list tabs to the data page - #7

Open
bluebird42 wants to merge 1 commit into
mainfrom
feat/data-top-list
Open

bluebird42 wants to merge 1 commit into
mainfrom
feat/data-top-list

Conversation

@bluebird42

@bluebird42 bluebird42 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

The data page only showed space-wide totals, so there was no way to see which videos drive the views. The page now reuses the settings tab bar with two tabs:

  • Overview (/data) keeps the existing numbers, history and sources unchanged.
  • Top list (/data/top-list) ranks the space's 25 most viewed videos this year, with each row linking to the video.

Views per video use the same definition as the overview: a session counts once it has watched at least one second. The new Analytics.space_top_videos/2 query groups by embed and session, and Embeds.dashboard_videos_by_hash/2 resolves names and dashboard ids within the current space only. Deleted videos keep their events, so the query fetches up to 50 rows and the page drops anything that no longer resolves before taking the top 25. The shared trial space returns an empty list, matching space_data/1. When a space cannot view statistics, the existing notice moves into the tab bar and both tabs show empty states.

Both scoped (/:space_id/data/top-list) and unscoped routes are added, and DashboardRoutes.data_top_list_path/2 builds them.

Overview tab:

Data page overview tab

Top list tab (synthetic data):

Data page top list tab

Validation:

  • New LiveView tests cover the tab links and patch navigation, and rank two videos by views while leaving out a deleted video with more views; the existing data page tests pass.
  • mix compile --warnings-as-errors, mix format --check-formatted and Credo passed.
  • Checked both tabs in the development stack with synthetic events sent through /v1/events.

No migration is needed; the query reads the existing events table.

Reuse the settings tab bar on the data page. Overview keeps the existing
statistics; the new top list ranks the space's videos by views this year,
counted per video with the same one-second threshold as the overview.
Deleted videos are left out.

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