Skip to content

feat: add retry option on cancellation/failure screen#135

Merged
unhappychoice merged 6 commits intomainfrom
feat/retry-option-on-failure
Sep 3, 2025
Merged

feat: add retry option on cancellation/failure screen#135
unhappychoice merged 6 commits intomainfrom
feat/retry-option-on-failure

Conversation

@unhappychoice
Copy link
Copy Markdown
Owner

close: #128

Summary

  • Add retry option to failure and cancellation screens allowing users to restart challenges without exiting the application
  • Split monolithic result_screen.rs into focused screen modules for better code organization
  • Implement proper retry handling in stage manager with clean navigation flow

Changes Made

New Features

  • Failure Screen Retry: Users can press [R] to retry failed challenges
  • Cancellation Screen Retry: Users can press [R] to retry cancelled challenges (Ctrl+C or ESC -> Q)
  • Seamless Experience: No need to restart the application to retry challenges

Code Refactoring

  • Split result_screen.rs into focused modules:
    • failure_screen.rs - Handles failed challenge display and retry
    • cancel_screen.rs - Handles cancelled challenge display and retry
    • session_summary_screen.rs - Session completion and stage results
    • sharing_screen.rs - Social media sharing functionality
  • Moved ResultAction enum to centralized location
  • Updated all imports and references throughout the codebase
  • Applied clippy suggestions for cleaner code

Implementation Details

  • Stage Manager Integration: Added proper retry handling in GameState::Failed and GameState::Exit
  • Navigation Flow:
    • [R] - Retry the same challenge
    • [T] - Back to title screen
    • [ESC] - Session summary and exit
  • Consistent UI: Both screens follow the same interaction pattern as other game screens

Test Plan

  • All existing tests pass (147 tests)
  • Code compiles without warnings after clippy fixes
  • Cargo check, test, clippy, and fmt all pass
  • Manual testing of retry functionality on both failure and cancellation scenarios

🤖 Generated with Claude Code

unhappychoice and others added 5 commits September 3, 2025 12:58
close: #128

- Add FailureScreen with retry functionality for failed challenges
- Add CancelScreen with retry functionality for cancelled challenges
- Both screens provide [R] Retry, [T] Back to Title, [ESC] Session Summary options
- Users can now retry challenges without restarting the application

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Extract SessionSummaryScreen for session completion and stage results
- Extract SharingScreen for social media sharing functionality
- Move ResultAction enum to session_summary_screen.rs for better organization
- Improve code maintainability and separation of concerns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add exports for new screen modules: CancelScreen, FailureScreen, SessionSummaryScreen, SharingScreen
- Remove old result_screen module reference
- Export ResultAction from session_summary_screen for centralized access

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update imports to use new screen modules instead of old ResultScreen
- Implement retry handling in GameState::Failed and GameState::Exit
- Add handle_cancel_result_navigation for cancellation retry logic
- Apply clippy suggestions for cleaner return statements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Delete monolithic result_screen.rs file
- All functionality has been moved to focused screen modules
- Maintains clean codebase structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 0% with 294 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.45%. Comparing base (05657c3) to head (ff78420).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/game/screens/sharing_screen.rs 0.00% 93 Missing ⚠️
src/game/screens/cancel_screen.rs 0.00% 91 Missing ⚠️
src/game/screens/failure_screen.rs 0.00% 73 Missing ⚠️
src/game/stage_manager.rs 0.00% 37 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (29.45%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
- Coverage   29.86%   29.45%   -0.41%     
==========================================
  Files          59       62       +3     
  Lines        8350     8466     +116     
==========================================
  Hits         2494     2494              
- Misses       5856     5972     +116     
Files with missing lines Coverage Δ
src/game/screens/session_summary_screen.rs 0.00% <ø> (ø)
src/game/stage_manager.rs 0.00% <0.00%> (ø)
src/game/screens/failure_screen.rs 0.00% <0.00%> (ø)
src/game/screens/cancel_screen.rs 0.00% <0.00%> (ø)
src/game/screens/sharing_screen.rs 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Fix spacing issues introduced by clippy fixes
- Ensure all code follows Rust formatting standards

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@unhappychoice unhappychoice merged commit 1f1eaf7 into main Sep 3, 2025
4 of 6 checks passed
@unhappychoice unhappychoice deleted the feat/retry-option-on-failure branch September 3, 2025 04:15
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.

feat: add retry option on cancellation/failure screen

1 participant