Skip to content

test(tui): exercise Escape through the global handler - #903

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
WaterWhisperer:test/escape-navigation
Oct 20, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
WaterWhisperer:test/escape-navigation

Conversation

@WaterWhisperer

@WaterWhisperer WaterWhisperer commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Update the Escape tests for Recently Played, Album List and Album Tracks to start on their respective screens and call handle_app.

Correct the Album List and Recently Played Left-key tests to start on their own blocks.

Fixes #825.

Testing

Testing

  • cargo fmt --all -- --check
  • cargo clippy --no-default-features --features telemetry,tui -- -D warnings
  • cargo test --no-default-features --features telemetry,tui
  • cargo test --no-default-features --features telemetry,tui esc_leaves
  • cargo test --no-default-features --features telemetry,tui on_left_press

Additional notes


💬 Questions or want to chat with other contributors? Join the spotatui Discord.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Escape-key navigation behavior when leaving Album List, Album Tracks, and Recently Played routes.
    • The interface now returns to the empty view while preserving the relevant route in hover mode.
  • Tests

    • Expanded coverage for application-level Escape handling across navigation routes.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8fbec94d-eb9f-4653-93bb-b86cf736dbb0
📥 Commits

Reviewing files that changed from the base of the PR and between 63bad62 and 12dfde8.

📒 Files selected for processing: 3
  • src/tui/handlers/album_list.rs
  • src/tui/handlers/album_tracks.rs
  • src/tui/handlers/recently_played.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Tests for Album List, Album Tracks, and Recently Played now dispatch Escape through handle_app. They verify the resulting active and hovered blocks. Two left-navigation tests now start from their matching screen block.

Changes: List-screen Escape tests

Layer / File(s) Summary
Route-state test coverage
src/tui/handlers/album_list.rs, src/tui/handlers/album_tracks.rs, src/tui/handlers/recently_played.rs
The Escape tests seed each screen’s route and call handle_app. They verify that the active block becomes Empty and the screen remains hovered. The Album List and Recently Played left-navigation tests now start from their matching blocks.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 12dfd

The changed Escape tests cover the requested route behavior. No actionable merge-blocking risk was found; normal validation remains appropriate.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the permitted conventional-commit prefix test(tui):, concisely describes the updated Escape tests, and uses an imperative subject.
Linked Issues check Passed The changes satisfy the coding requirements in directly linked issue #825. The three tests push RouteId::RecentlyPlayed, RouteId::AlbumList, and RouteId::AlbumTracks, assert the matching active …
Out of Scope Changes check Passed The diff changes only test imports and test setup, names, entry points, and assertions in the three handler test modules. These changes directly implement issue #825. No production handler, Artist tes…
Full details: Linked Issues check

Explanation

The changes satisfy the coding requirements in directly linked issue #825. The three tests push RouteId::RecentlyPlayed, RouteId::AlbumList, and RouteId::AlbumTracks, assert the matching active block before Escape, call crate::tui::handlers::handle_app, and assert ActiveBlock::Empty with the matching hovered block. The Album List and Recently Played on_left_press tests now start on their own blocks. The Album Tracks left-key test is unchanged. The reported test names match the esc_leaves filter.

Full details: Out of Scope Changes check

Explanation

The diff changes only test imports and test setup, names, entry points, and assertions in the three handler test modules. These changes directly implement issue #825. No production handler, Artist test, or unrelated file changes are present in the reviewed diff.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit edbf51c into LargeModGames:main Oct 20, 2026
32 checks passed
@WaterWhisperer
WaterWhisperer deleted the test/escape-navigation branch October 21, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Three on_esc tests pass without testing anything

2 participants