feat: add stats screen keybinding

This commit is contained in:
2026-01-04 16:37:44 +01:00
parent 8e41d0b002
commit 2d765bbf04

View File

@@ -27,7 +27,7 @@ from .table_utils import (
filter_unfinished_items, filter_unfinished_items,
format_item_as_row, format_item_as_row,
) )
from .ui import HelpScreen from .ui import HelpScreen, StatsScreen
if TYPE_CHECKING: if TYPE_CHECKING:
from textual.widgets._data_table import ColumnKey from textual.widgets._data_table import ColumnKey
@@ -41,6 +41,7 @@ class Auditui(App):
BINDINGS = [ BINDINGS = [
("?", "show_help", "Help"), ("?", "show_help", "Help"),
("s", "show_stats", "Stats"),
("n", "sort", "Sort by name"), ("n", "sort", "Sort by name"),
("p", "sort_by_progress", "Sort by progress"), ("p", "sort_by_progress", "Sort by progress"),
("a", "show_all", "All/Unfinished"), ("a", "show_all", "All/Unfinished"),
@@ -417,6 +418,10 @@ class Auditui(App):
"""Show the help screen with all keybindings.""" """Show the help screen with all keybindings."""
self.push_screen(HelpScreen()) self.push_screen(HelpScreen())
def action_show_stats(self) -> None:
"""Show the stats screen with listening statistics."""
self.push_screen(StatsScreen())
def _check_playback_status(self) -> None: def _check_playback_status(self) -> None:
"""Check if playback process has finished and update state accordingly.""" """Check if playback process has finished and update state accordingly."""
message = self.playback.check_status() message = self.playback.check_status()