Skip to content

Statspage - #4873

Open
ryanbarlow97 wants to merge 14 commits into
mainfrom
statspage
Open

Statspage#4873
ryanbarlow97 wants to merge 14 commits into
mainfrom
statspage

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

Description:

image

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory

Please put your Discord username so you can be contacted if a bug or regression is found:

w.o.n

Copilot AI lite review requested due to automatic review settings August 4, 2026 23:57
@ryanbarlow97
ryanbarlow97 requested a review from a team as a code owner August 4, 2026 23:57
@ryanbarlow97 ryanbarlow97 self-assigned this Aug 4, 2026
@ryanbarlow97 ryanbarlow97 added the UI/UX UI/UX changes including assets, menus, QoL, etc. label Aug 4, 2026
@ryanbarlow97 ryanbarlow97 modified the milestones: v35, v34 Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 345e7592-a7ff-49fb-a458-ebd038a3b709

📥 Commits

Reviewing files that changed from the base of the PR and between b221442 and 9c49acd.

⛔ Files ignored due to path filters (1)
  • resources/images/TradeShipIconWhite.svg is excluded by !**/*.svg
📒 Files selected for processing (3)
  • resources/lang/en.json
  • src/client/components/baseComponents/stats/PlayerStatsSummary.ts
  • tests/client/PlayerStatsSummary.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • resources/lang/en.json
  • src/client/components/baseComponents/stats/PlayerStatsSummary.ts

Walkthrough

Player statistics now support recent aggregate data, all filter selections, Humans Vs Nations, summary metrics, sectioned tables, and updated English translations. Tests cover schema parsing, aggregation, rendering, filtering, and missing values.

Changes

Player statistics

Layer / File(s) Summary
Statistics schema and validation
src/core/ApiSchemas.ts, tests/StatsSchema.test.ts
Adds recent aggregate schemas, legacy recent-game support, supported game modes, and Humans Vs Nations validation.
Filter selection and statistics aggregation
src/client/components/baseComponents/stats/PlayerStatsTree.ts, tests/client/PlayerStatsSummary.test.ts
Adds all filters, leaf aggregation, recent-game merging, selection validation, and filter resets.
Summary and table rendering
src/client/components/baseComponents/stats/PlayerStatsSummary.ts, src/client/components/baseComponents/stats/PlayerStatsTable.ts, tests/client/PlayerStatsSummary.test.ts, tests/client/PlayerStatsTable.test.ts
Adds summary metrics and reusable sections for player statistics. Missing values render as zeroes.
Statistics localization
resources/lang/en.json
Adds Humans Vs Nations, all-filter, warship, detailed metric, summary, and win-rate labels.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: Translation

Suggested reviewers: evanpelle

Sequence Diagram(s)

sequenceDiagram
  participant PlayerStatsTreeView
  participant PlayerStatsTree
  participant PlayerStatsSummary
  participant PlayerStatsTable
  PlayerStatsTreeView->>PlayerStatsTree: select filters
  PlayerStatsTree->>PlayerStatsTreeView: return aggregated statistics
  PlayerStatsTreeView->>PlayerStatsSummary: provide selected leaf
  PlayerStatsSummary->>PlayerStatsTreeView: render summary metrics
  PlayerStatsTreeView->>PlayerStatsTable: provide selected statistics
  PlayerStatsTable->>PlayerStatsTreeView: render statistic sections
Loading

Poem

Filters align, the records glow,
Recent wins and metrics flow.
Ships and nukes take their place,
Gold and diplomacy share the space.
All modes speak with labels clear.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the statistics page, which is the primary change in the pull request.
Description check ✅ Passed The description includes the statistics page screenshot and confirms translations and tests for the related UI changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management Aug 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/client/PlayerStatsSummary.test.ts (1)

373-392: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Set the filter state before checking the leaf.

PlayerStatsTreeView initializes all filters to ALL_SELECTION. This test never selects Public or Free For All, so it exercises the all-types aggregation branch. With one fixture leaf, the assertion can pass without proving the exact branch described in the comment.

Set tree.selectedType = GameType.Public and tree.selectedMode = GameMode.FFA before appending the element. If this test must cover Medium, use a non-public fixture because the Public path ignores difficulty.

Suggested test setup
     const tree = new PlayerStatsTreeView();
+    tree.selectedType = GameType.Public;
+    tree.selectedMode = GameMode.FFA;
     tree.statsTree = {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/client/PlayerStatsSummary.test.ts` around lines 373 - 392, Update the
test setup for “keeps a leaf's own recent stats when no tree-level aggregate
exists” by assigning tree.selectedType = GameType.Public and tree.selectedMode =
GameMode.FFA before appending the tree, so it exercises the exact-selection
branch rather than all-types aggregation. Keep the existing leaf and assertion
unchanged unless the implementation’s Public path requires a non-public fixture
to cover Medium.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/client/PlayerStatsSummary.test.ts`:
- Around line 373-392: Update the test setup for “keeps a leaf's own recent
stats when no tree-level aggregate exists” by assigning tree.selectedType =
GameType.Public and tree.selectedMode = GameMode.FFA before appending the tree,
so it exercises the exact-selection branch rather than all-types aggregation.
Keep the existing leaf and assertion unchanged unless the implementation’s
Public path requires a non-public fixture to cover Medium.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ed436b1-e102-4d98-9ac5-58efbb5d06af

📥 Commits

Reviewing files that changed from the base of the PR and between a951fea and b221442.

📒 Files selected for processing (8)
  • resources/lang/en.json
  • src/client/components/baseComponents/stats/PlayerStatsSummary.ts
  • src/client/components/baseComponents/stats/PlayerStatsTable.ts
  • src/client/components/baseComponents/stats/PlayerStatsTree.ts
  • src/core/ApiSchemas.ts
  • tests/StatsSchema.test.ts
  • tests/client/PlayerStatsSummary.test.ts
  • tests/client/PlayerStatsTable.test.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • tests/StatsSchema.test.ts
  • tests/client/PlayerStatsTable.test.ts
  • src/core/ApiSchemas.ts
  • resources/lang/en.json
  • src/client/components/baseComponents/stats/PlayerStatsTable.ts
  • src/client/components/baseComponents/stats/PlayerStatsSummary.ts
  • src/client/components/baseComponents/stats/PlayerStatsTree.ts

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI/UX UI/UX changes including assets, menus, QoL, etc.

Projects

Status: Development

Development

Successfully merging this pull request may close these issues.

2 participants