Repository navigation
fix(tui): draw an empty titled table while library sections load - #620
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: LargeModGames/spotatui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughPodcast, saved album, episode, and recently played tables now display their titles when data is unavailable. The episode table title retains the selected show name and publisher, or uses “Episodes” when no show is selected. Tests cover the four empty tables. ChangesEmpty table rendering
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The tables now display titles while data is unavailable, with no identified issue requiring a fix before merge. Architecture SummaryArchitecture risk: 🟠 High · up to The change affects 3 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@all-contributors please add @chiliec for code |
|
I've put up a pull request to add @chiliec! 🎉 |
Adds @chiliec as a contributor for code. This was requested by LargeModGames [in this comment](#620 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Summary
Closes #610.
draw_album_list,draw_podcast_table,draw_recently_played_tableanddraw_show_episodeseach drew nothing while their data was stillNone, so the pane had no border, title or header until the first page arrived (and stayed blank if the fetch failed). Each now has anelsebranch that callsdraw_tablewith&[], offset0, the same title and the same selected index, followingdraw_artist_table.draw_recently_played_table:current_route,highlight_stateandselected_song_indexmoved above theif letso theelsebranch can use them.draw_show_episodes: thetitlematch moved above theif let, so the empty pane still names the show.draw_album_tableandApp/app.vieware untouched.Tests:
renderednow delegates to arendered_with(app, area, draw)helper. Four new tests render each fn fromApp::default()intoRect::new(0, 0, 80, 8)and check for the title (Saved Albums,Podcasts,Recently Played Tracks,Episodes).test_attribute_totalintools/gates.countgoes from 2296 to 2300. There's also a CHANGELOG entry under Unreleased → Fixed.Testing
Run locally on Linux with rustc 1.98.1:
cargo test --no-default-features --features telemetry,tui empty_titled_tablebefore the fix, with only the tests added:0 passed; 4 failed(all four new tests)4 passed; 0 failed; 1265 filtered outcargo fmt --all -- --check: clean (exit 0)cargo clippy --no-default-features --features telemetry,tui -- -D warnings: finished, no warnings (exit 0)cargo test --no-default-features --features telemetry,tui:1269 passed; 0 failed, gates test includedAdditional notes
I didn't attach a screenshot because the change is only visible before data loads. The TestBackend tests cover it.
Summary by CodeRabbit