- Add position coverage, IL players, missing card warnings, and detailed sync status sections to the dashboard - Fix team sync to include IL/MiL teams (active_only=false), matching Python behavior so get_my_roster() finds WVIL/WVMiL teams - Re-fetch all dashboard data after successful sync so changes reflect immediately without navigating away - Add sWAR budget bar (90-100% range) with color thresholds from Team.salary_cap - Add team-scoped missing card queries and bulk sync status query - Mark Phase 2 and Phase 3 project plans as complete Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
CLAUDE.md — Rust Rewrite
Session Start
Read the rewrite memory file before starting work:
~/.claude/projects/-mnt-NV2-Development-sba-scouting/memory/rust-rewrite.md
It has the phase plan, completion status, architecture decisions, and current file layout.
Project Overview
Rust rewrite of the SBA Scout TUI. Uses ratatui + crossterm for the terminal UI, sqlx + SQLite for data, reqwest for API calls, and figment + TOML for configuration.
Commands
cargo build # compile
cargo run # run TUI
cargo test # run tests
cargo clippy # lint
cargo fmt # format
Architecture
Same layered structure as the Python version, ported to Rust idioms:
src/
├── main.rs # tokio runtime, event loop, file logging
├── app.rs # App struct, screen routing, nav/status bars
├── config.rs # figment-based TOML settings
├── lib.rs # module re-exports
├── api/ # reqwest HTTP client, sync pipeline, CSV importers
├── calc/ # league stats, matchup scoring, score cache, weights
├── db/ # sqlx models, queries, schema
├── screens/ # ratatui screen states (dashboard, gameday, stubs)
└── widgets/ # reusable UI components (selector)
Key Patterns
- Async throughout: tokio runtime, sqlx async, reqwest async
- Message passing:
mpsc::UnboundedSender<AppMessage>for async task → UI communication - No global state: Settings and SqlitePool passed by reference, no singletons
- TOML config (not YAML):
data/settings.tomlwithSBA_SCOUT_env var overrides
Current Screen Status
dashboard.rs— Done (roster summary, sync)gameday.rs— Done (matchup table + lineup builder)roster.rs— Stubmatchup.rs— Stublineup.rs— Stubsettings.rs— Stub
Code Style
- Run
cargo fmtandcargo clippybefore committing - Follow existing patterns in
gameday.rsfor new screens (state struct + handle_key + handle_message + render)