Repository navigation
feat(webui): redesign Owner Platform analytics as a fleet dashboard - #626
Merged
Merged
Conversation
Platform analytics now reads a 7, 30 or 90-day range and shows every metric at once: KPI tiles with the change from the previous range, small-multiple enforcement bars, fleet membership growth, most and least active servers, biggest movers, each server's share of bans, spam hits and mod actions, and a sortable, filterable server table with names, icons, share bars and member directory status. The explanatory paragraph is replaced by a tooltip and a one-line partial-totals note. The platform read adds previous-window totals, server display facts and zero rows for every active server in the same single statement; the route validates ?days and reports per-server directory coverage. Refs #618
Owner
Author
|
@pullfrog review |
There was a problem hiding this comment.
Important
The required CI gate fails on an EOF whitespace error. No behavioral issues found in the reviewed changes.
Reviewed changes Fleet dashboard redesign and its API/data changes against #618, including the expanded owner requirements.
- Fleet dashboard: Range selection, KPI comparisons, simultaneous charts, rankings, fleet shares, and sortable/filterable server rows with names, icons, and directory coverage.
- API and aggregation: Owner-only range validation, per-server member totals, previous-window aggregates, and active/departed server display facts in the primary snapshot.
- Shared components and coverage: Chart empty states, ranking labels, styling, documentation, and regression tests. All 15 selected analytics frontend tests passed locally, including the existing browser layout check; API/SQL tests were inspected but not rerun locally. Fixtures do not establish live-provider behavior.
gpt-6.1-sol | 𝕏
Removing the final Platform analytics test block left its blank separator at EOF, which fails the git diff --check whitespace gate. Refs #618
Owner
Author
|
@pullfrog review |
jatmn
marked this pull request as ready for review
November 13, 2026 19:37
There was a problem hiding this comment.
✅ No new issues found. The previous EOF whitespace finding is fixed, and the required
CI passedcheck now passes.
Reviewed changes Full fleet-dashboard redesign against #618 and its expanded owner requirements.
- Owner dashboard: Selectable ranges, KPI comparisons, simultaneous enforcement/membership charts, rankings, fleet shares, and sortable/filterable server rows with display names, icons, and directory coverage.
- API and data: Owner-only range validation, per-server member totals, previous-window aggregation, and active/departed server metadata within the primary snapshot.
- Shared components and coverage: Chart empty states, alternate ranking labels, styles, documentation, and API/data/frontend regression tests. All 15 selected analytics frontend tests passed locally after building assets, including the existing community Analytics Firefox layout check; the merge-base whitespace check also passed. Rust/API tests were inspected but not rerun locally. Frontend fixtures use mocked APIs, not live providers.
gpt-6.1-sol | 𝕏
This was referenced Nov 13, 2026
This was referenced Dec 3, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Closes #618
Problem
Owners → Platform analytics showed one metric at a time behind toggle buttons, repeated y-axis labels ("1", "1", "0") for small counts, raw guild IDs in the server table, a long explanatory paragraph, and
.statscards unlike the redesigned Analytics and Database Usage pages. The read was also fixed at 30 days with no comparison, so the deeper fleet view asked for in the issue comment was not possible.Change
Page (
frontend/app.js, still under Owner in the normal web UI)KpiTile, same as community Analytics): Servers, Members (with apartialbadge), Net growth, Joins, Leaves, Warnings, Bans, Spam hits, Mod actions, Timeouts. Each tile shows the change from the previous range and a daily sparkline.importing,unverifiedorunavailablebadge.API (
crates/api/src/web/platform.rs)POST /api/platform/analytics?days=7|30|90defaults to 30. Any other value returns 400.members.by_guildmaps each counted server to its current member count and directory coverage. An active server missing from the map could not be read.Data (
src/db/analytics.rs)platform_analyticsis still a single statement in one primary snapshot. It uses materialized CTEs that cover both windows.previoustotals and, for each server,previous,active,nameandicon_hash. Name and icon come fromguild_join_info.null, because the daily counters are kept for 92 days. The guild view uses the same rule.Shared (
frontend/charts.js,frontend/icons.js)EnforcementChartandMembershipChartgain the empty-series text. On the community page this only adds text.RankListrows can show a share or a signed change in place of the count.icons.jsgains chevron icons for the sorted column, following the shared-icon and no-glyph rules.Validation
bash scripts/ci-preflight.sh --affected: passed on the exact committed tree. That run included contracts, fmt, dylint, clippy and tests for api, bot, updater, core and integration, thedual_process_smokerun, service boundaries, ESLint, the frontend Node suites (state, contrast, warmup, sr-only, package, administration), cargo deny, and cargo audit. cargo audit reported one advisory, which does not fail pull requests.scripts/frontend-state-test.mjs: six Platform analytics tests. They cover metrics shown together, empty states, names and icons, directory badges, rankings and shares, sorting and filtering, range reads, stale retention on failed refreshes, and the initial failure. All six fail against the base frontend.src/db/analytics/tests.rs: previous-window totals for the fleet and each server, display facts, a zero row for an active server, the departed server that has only previous-window activity, and the 90-daynullmembership comparison.crates/api/src/web/enrollment_tests.rs: route range validation (7, 30, 90, default, 14 → 400, non-owner → 403) andby_guildcoverage.dist/frontendin headless Firefox against a mock owner API, at 1440 px in light and dark themes and at 760 px. Results: no horizontal page scroll, KPI strip on one row at 1440 px, no wrapped numbers, no overflowing rank rows, and the server table fits at 1440 px.Limitations
remote-databaseCI job (remote libSQL) was not run locally because it needs Docker. The existinganalytics_reads_fit_the_remote_snapshot_budgettest still exercises the platform read over a delayed local Hrana fixture.members.known.Summary by Sourcery
Replace the single-metric owner platform analytics view with a comprehensive fleet dashboard for comparing activity, membership, and server-level performance across configurable time ranges.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: