diff options
| author | Christian Cleberg <[email protected]> | 2026-04-15 22:28:45 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-15 22:28:45 -0500 |
| commit | 4cbe592e0a0fae13f0a89918a66fd983dd84464f (patch) | |
| tree | c2aac9d6e3c7b0f44adf07b86385f2ce06f1cf10 /nba/tui/styles.tcss | |
| parent | 00f695c765aead8aa0160a3c676cf85716178beb (diff) | |
| download | nba-scores-4cbe592e0a0fae13f0a89918a66fd983dd84464f.tar.gz nba-scores-4cbe592e0a0fae13f0a89918a66fd983dd84464f.tar.bz2 nba-scores-4cbe592e0a0fae13f0a89918a66fd983dd84464f.zip | |
feat: add Textual TUI with auto-refresh, leaders, playoff picture, and box score
Introduces an interactive terminal UI via the `--tui` flag backed by the
Textual framework. Scores and standings auto-refresh on a configurable
interval (default 60s, minimum 10s) using asyncio with nba_api calls
offloaded to a thread pool to keep the event loop unblocked.
New tabs:
- Scores / Standings (existing views, now live-updating)
- Leaders: top-25 by stat category, cycle with < / > keys
- Playoff Picture: conference seeding with clinch/elimination status
- Box Score: per-player live stats, load any game with keys 1–9
Refactored scores.py and standings.py to separate rendering from I/O
(get_scoreboard_table, get_east/west_standings_table), keeping the
existing static CLI path fully intact. Added -sc / -st shortcut flags.
Adds textual>=0.89.1,<7.0 dependency, build-system declaration for uv,
and package-data entry for the bundled .tcss stylesheet.
Diffstat (limited to 'nba/tui/styles.tcss')
| -rw-r--r-- | nba/tui/styles.tcss | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/nba/tui/styles.tcss b/nba/tui/styles.tcss new file mode 100644 index 0000000..816608c --- /dev/null +++ b/nba/tui/styles.tcss @@ -0,0 +1,58 @@ +Screen { + background: $background; +} + +TabbedContent { + height: 1fr; +} + +TabPane { + overflow: auto auto; + padding: 1 2; +} + +/* Scores tab */ +#scores-content { + width: auto; +} + +/* Standings & Playoff tabs — two columns side by side */ +#standings-container, +#playoff-container, +#boxscore-container { + height: 1fr; + width: 100%; +} + +#east-content, +#west-content, +#playoff-east-content, +#playoff-west-content { + width: 1fr; + overflow: auto auto; + padding-right: 2; +} + +/* Leaders tab */ +#leaders-content { + width: auto; + overflow: auto auto; +} + +/* Box Score tab */ +#home-content, +#away-content { + width: 1fr; + overflow: auto auto; + padding-right: 2; +} + +/* Countdown / status bar */ +#countdown { + dock: bottom; + height: 1; + background: $panel; + color: $text-muted; + content-align: right middle; + padding-right: 2; +} |
