Improve statistics detail paging and overview summaries#1010
Open
dgruss wants to merge 12 commits into
Open
Conversation
cc4ba7d to
11fadc8
Compare
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.
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.
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.
This refactors the stats page and makes it much nicer :)
About two thirds of the changeset is code, the other third is theme + language:
Overview of the commits:
Starting point (current master)
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:


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.
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:
The placement with this commit is not perfect:

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:
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:


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.
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:
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.