Skip to content

Improve statistics detail paging and overview summaries#1010

Open
dgruss wants to merge 12 commits into
UltraStar-Deluxe:masterfrom
dgruss:morestats
Open

Improve statistics detail paging and overview summaries#1010
dgruss wants to merge 12 commits into
UltraStar-Deluxe:masterfrom
dgruss:morestats

Conversation

@dgruss

@dgruss dgruss commented May 30, 2025

Copy link
Copy Markdown
Contributor

This refactors the stats page and makes it much nicer :)

About two thirds of the changeset is code, the other third is theme + language:

~/usdxdev (git)-[morestats] % git diff master --compact-summary *.pas
 src/base/UConfig.pas                              |   2 +-
 src/base/UDataBase.pas                            | 623 +++++++++++++++++++++++-
 src/base/UGraphic.pas                             |   9 +-
 src/base/UIni.pas                                 |  20 +
 src/base/UNote.pas                                |  47 +-
 src/base/URecord.pas                              |   4 +-
 src/base/USingScores.pas                          |   2 +-
 src/base/UThemes.pas                              | 173 ++++++-
 src/menu/UDisplay.pas                             |  66 +--
 src/menu/UMenu.pas                                |   1 +
 src/menu/UMenuText.pas                            | 447 ++++++++++++-----
 src/screens/UScreenPartyOptions.pas               |  58 ++-
 src/screens/UScreenScore.pas                      |   2 +-
 src/screens/UScreenStatDetail.pas                 | 902 +++++++++++++++++++++++++++++------
 src/screens/UScreenStatMain.pas                   | 448 ++++++++++++-----
 src/screens/controllers/UScreenSingController.pas |  11 +-
 16 files changed, 2267 insertions(+), 548 deletions(-)
  • Statistics detail views now use aligned columns with headers, making scores, singers, songs, and artists easier to scan
  • Best-singer stats now show score counts and can be filtered to singers with at least the median number of saved scores
  • The statistics overview now shows clearer library and score activity summaries, including recent activity, coverage, averages, and missing-video counts
  • The overview includes randomized fun facts with player, song, artist, score, and count context
  • Important names and numbers in the overview can be emphasized with inline bold formatting, and the text auto-fits to the available theme box
  • We now use dedicated strings and theme sections instead of fragile row format strings
  • The number of stats entries can be adjusted directly on the stats page with arrow keys
  • Commits are split so code, language, and theme changes can be reviewed independently

Overview of the commits:

Starting point (current master)

screenshot0009 screenshot0007 screenshot0005 screenshot0003 screenshot0001

We can see several issues here, the inefficient use of space, the low information density. Text overflowing boxes.
Lots of room for improvements.

Make statistics detail paging keyboard-driven

The first step was to make the statistics detail page able to scale by a configurable number of entries. Since the statistics detail page was already keyboard driven (next page / previous page), this allowed for a convenient way to change the number of entries per page using the arrow keys (up/down: change number of entries, left/right: switch page, as it was!)

Here as an example with 5 and 20 entries instead of 10:
screenshot0013
screenshot0011

Not beautiful yet but it works.

Add richer statistics detail query data

No visual change but nice small change set for reviewing.

Update statistics detail language strings

As an intermediate step to provide more information.

screenshot0020 screenshot0019 screenshot0018 screenshot0017

Refresh statistics detail theme scaffolding

The next step is to add the theme elements that the column-based detail view will need later. This keeps the next code commit testable on its own because the required theme sections already exist when the code starts reading them.

This commit mostly prepares:

  • table/header positioning
  • per-column sizing and alignment
  • configurable min/default/max entry counts
  • room for the later median filter hint

The placement with this commit is not perfect:
screenshot0021

Render statistics detail rows as columns

This is the main detail-screen visual improvement. Instead of formatting each row as one translated text blob, the screen now renders structured columns with headers.

That gives us:

  • stable alignment across scores, players, dates, songs, and counts
  • better use of horizontal space
  • less text overflow
  • theme-controlled column widths and gaps
  • dynamic row sizing for different entry counts
screenshot0025 screenshot0024 screenshot0023 screenshot0022

Remove obsolete statistics detail format strings

Once the detail screen no longer uses language-provided row format strings, the old STAT_FORMAT_* entries can be removed.

This makes translation files easier to maintain: translators now translate labels and headers, not fragile printf-style row layouts.

There is no visual change here.

Add median filter for best singers

The best-singer ranking can now be filtered to players with at least the median number of saved scores. For users, this makes the ranking less dominated by one-off high scores. The filter is available directly on the detail screen with M, and only appears for the best-singers view where it applies.

Once with the min. median filter on and off:
screenshot0026
screenshot0027

Add statistics overview score metrics

No visual change yet. This adds database helpers for the overview screen so the UI can ask for clear aggregate values instead of embedding SQL in screen code. This keeps the later overview redesign easier to review.

Add statistics overview language strings

No visual change yet. Adds the new overview strings before the code starts using them. This keeps the commit chain functional: the existing overview still has its old strings, while the new strings are already available for the upcoming redesign. Again, separate commit for easier review.

Refresh statistics overview theme layout

The Modern theme (and implicitly Deluxe) layout is adjusted for the denser overview content.
This adds theme-defined recent periods and gives the overview text area enough room for the richer summary.

screenshot0028

Redesign statistics overview summary

This is the main overview-screen user-facing change.

The old overview was hard to scan and mixed several unrelated facts into long text blocks. The new version groups the information into clearer sections:

  • library size and video coverage (video coverage only shown if not 100%!)
  • scores since reset
  • recent score activity
  • score coverage and averages
  • random fun-fact style stats
screenshot0026

Complete statistics language coverage

Final language cleanup after the new overview is in place.

This removes the obsolete overview format strings, completes translated labels for the new detail table, and updates the language README so translators have the correct wildcard documentation.

dgruss added 8 commits May 25, 2026 20:11
Remove the stats-detail button dependency, use keyboard shortcuts for paging, entry count, and reverse order, and persist the selected detail entry count.

The screen still uses the existing detail format strings and theme list texts, so this commit is source-only and buildable on its own.
Expose score counts and average score values in detail statistic results and populate them from the score database queries.

Existing detail rendering is kept on the old format-string path; the additional format arguments are ready for the language update that follows.
Replace the old button labels with keyboard-navigation labels, add detail table header keys, and extend existing detail format strings for the richer statistic result data.

This commit is language-only; the obsolete format strings stay in place until the rendering code stops using them.
Remove the obsolete detail buttons from Modern, add keyboard legend assets, and define the detail header/list/table sections required by the column renderer.

This commit is theme-only and lands the required theme elements before code starts reading them.
Replace detail format-string row rendering with measured table columns, headers, dynamic row allocation, and theme-driven list/table sizing.

The required theme sections and language keys landed in earlier commits; median filtering remains split out for its own source commit.
Drop the old detail row format keys now that the detail screen renders typed table columns instead of language-provided format strings.
Add a median-entry-count filter for best singers, wire it through the stats queries and total counts, and expose it from the detail screen with the M key.
Add database helpers for overview score aggregates so the UI redesign can query score, song, and singer counts by period without embedding SQL in the screen.
@dgruss dgruss changed the title More stats + entries in the highscore table Improve statistics detail paging and overview summaries May 25, 2026
dgruss added 4 commits May 26, 2026 07:49
Add the translated overview summary keys before the screen starts using them, while keeping the legacy overview keys available for the current implementation.
Add Modern theme recent-period metadata and resize the statistics overview panel before the overview screen starts using the richer summary.
Render the overview from structured library, overall-score, recent-period, and fun-fact sections, backed by the new database aggregate helpers and theme-driven recent-period metadata.
Remove legacy overview format strings, add translated detail table labels, and update the language README for the final statistics overview keys.
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