Add a Statistics tab with a card for every soundtrack
Part of #41. The top bar has Quiz and Statistics tabs instead of the Statistics button. The Statistics tab replaces the quiz below the top bar (the song keeps playing) and shows every soundtrack as a card with its plays, last played date and most and least played songs, loaded from the new GET /api/v1/statistics/soundtracks. The cards can be searched (with the Search popup's matching, now in SoundtrackSearch), filtered on played or never played, and sorted A-Z, Z-A, most or least played. Clicking a card opens a popup with all its songs. Screenshots of the other states only differ in the top bar, and the layout baseline is taken again with the new statistics states.
This commit is contained in:
1 parent
f7619baf34
commit
a21b6e9b22
30 files changed
+25379
-2306
No files matched your search
@@ -6,7 +6,7 @@ extends MainWindowTestSuite
|
||||
|
||||
const MAIN_WINDOW_CHILDREN: Array[String] = [
|
||||
"Background", "TopBar", "Quiz", "PopupBackdrop", "SearchPopup", "SyncPopup", "QRPopup",
|
||||
"ShortcutsPopup", "StatisticsPopupPanel", "AboutPopup", "LogPopup",
|
||||
"ShortcutsPopup", "StatisticsView", "AboutPopup", "LogPopup", "SoundtrackStatsPopup",
|
||||
]
|
||||
|
||||
## The parts of the quiz and the scene each one comes from.
|
||||
@@ -27,15 +27,14 @@ const LOCKED_BY_SYNC: Array[String] = [
|
||||
]
|
||||
|
||||
const TOP_BAR_CHILDREN: Array[String] = [
|
||||
"TopPanelContainer", "Title", "SyncButton", "SearchButton", "StatisticsButton",
|
||||
"ShortcutsButton", "AboutButton", "QRButton",
|
||||
"TopPanelContainer", "Title", "SyncButton", "SearchButton", "ShortcutsButton",
|
||||
"AboutButton", "QRButton", "QuizTab", "StatisticsTab",
|
||||
]
|
||||
|
||||
## Each top bar button and the popup it opens in the main window.
|
||||
const TOP_BAR_POPUPS: Dictionary = {
|
||||
"SearchButton": "SearchPopup",
|
||||
"SyncButton": "SyncPopup",
|
||||
"StatisticsButton": "StatisticsPopupPanel",
|
||||
"ShortcutsButton": "ShortcutsPopup",
|
||||
"AboutButton": "AboutPopup",
|
||||
"QRButton": "QRPopup",
|
||||
@@ -285,10 +284,3 @@ func test_alt_enter_switches_fullscreen_and_settings_shows_it() -> void:
|
||||
assert_bool(settings.fullscreen_button.button_pressed).is_equal(!was_fullscreen)
|
||||
await _press_keys([KEY_ALT, KEY_ENTER])
|
||||
assert_bool(Settings.fullscreen).is_equal(was_fullscreen)
|
||||
|
||||
|
||||
func test_statistics_counts_the_soundtracks() -> void:
|
||||
_top_bar_button("StatisticsButton").pressed.emit()
|
||||
|
||||
assert_str((_window.get_node("StatisticsPopupPanel/StatisticsLabel") as Label).text) \
|
||||
.is_equal("Total amount of soundtracks in the playlist: 2")
|
||||
Reference in new issue
Block a user