feat: learn from your mistakes#2229
Conversation
1c01a7a to
7561575
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a retrospective analysis feature called "Learn from your mistakes" that helps players review and practice the critical mistakes they made in their games. The feature identifies significant mistakes from server analysis and creates an interactive training environment where users can attempt to find better moves.
Key changes:
- Added a comprehensive retro analysis system with mistake detection and interactive training
- Extracted reusable UI components from puzzle widgets for broader use
- Enhanced the analysis board system to support different interaction modes
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/view/analysis/retro_screen_test.dart | Comprehensive test suite for the retro screen functionality |
| test/example_data.dart | Made makeSteps function public for reuse in tests |
| lib/src/view/puzzle/puzzle_feedback_widget.dart | Extracted reusable components and made FeedbackTile public |
| lib/src/view/analysis/server_analysis.dart | Added "Learn from your mistakes" button to server analysis summary |
| lib/src/view/analysis/retro_settings_screen.dart | Settings screen for retro analysis preferences |
| lib/src/view/analysis/retro_screen.dart | Main retro analysis screen with interactive mistake review |
| lib/src/view/analysis/analysis_board.dart | Enhanced base analysis board to support retro mode interactions |
| lib/src/model/explorer/opening_explorer_repository.dart | Added Riverpod provider for opening explorer repository |
| lib/src/model/common/eval.dart | Added utility method for calculating winning chances differences |
| lib/src/model/analysis/retro_controller.dart | Core controller logic for retro analysis functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
the screen recording just shows a static screen @tom-anders , perhaps wrong one? |
|
Oh that may be related to my recent emulator problems, I'll make a new one today |
veloce
left a comment
There was a problem hiding this comment.
I realise this is a lot of work, so thank you very much for this!
It looks very good, I have only small comments that should be easy to fix.
|
To improve the discoverability of the feature, I'd suggest to add a "Learn from your mistakes" button on game screen if the server analysis is available. What do you think? The button could be added in the game screen end pop-up, and game menu. |
|
Thanks for the review!
Good idea! Maybe directly after the game, we could also add a "learn from mistakes" button to the menu that would request server analysis, display some kind of progress dialog, and then take you directly to the retro screen...? |
9b6e35d to
8718496
Compare
|
Think I addressed all the comments now. Also added a new video that hopefully works this time |
yes we could do that; this adds complexity and will likely not work from time to time, but not a big deal. if we do that though, I'd handle the logic in the retro controller:
|
| return null; | ||
| } | ||
|
|
||
| // https://github.com/lichess-org/lila/blob/d29f27d8cbb0e0dac38308c23c63b828028c085f/ui/analyse/src/nodeFinder.ts#L26 |
There was a problem hiding this comment.
This is nitpicking again, but it is better to make a constant of the 0.1 here. So you can name it for better clarity and put the ref to lila code here.
There was a problem hiding this comment.
Also better just put the file where the logic is found, without the line number; lines number will most likely change.
There was a problem hiding this comment.
As I understand it, since I used the "Copy permalink" button, these links refer to a specific commit, not to the master branch. So they will always point to the same line/code
|
|
||
| /// Depth needed to evaluate alternative solution moves. | ||
| /// | ||
| /// https://github.com/lichess-org/lila/blob/d29f27d8cbb0e0dac38308c23c63b828028c085f/ui/analyse/src/retrospect/retroCtrl.ts#L151 |
There was a problem hiding this comment.
Better not put the link to Lila code actually; line number will most probably change; or just put the link to the whole rectroCtrl file.
Sounds good, I moved it to a new issue |
86d4cc7 to
1ffa130
Compare
| OpeningExplorerEntry.empty(), | ||
| ), | ||
| ); | ||
| final mockClient = MockClient((request) { |
|
rebasing your changes now with main @tom-anders |
82e35fd to
271df7e
Compare
retro_final.webm