Skip to content

Comments

Crazyhouse support 🎉 #2662

Open
tom-anders wants to merge 6 commits intolichess-org:mainfrom
tom-anders:crazyhouse
Open

Crazyhouse support 🎉 #2662
tom-anders wants to merge 6 commits intolichess-org:mainfrom
tom-anders:crazyhouse

Conversation

@tom-anders
Copy link
Collaborator

@tom-anders tom-anders commented Feb 21, 2026

Phone Screen:

image

Tablet:

image image

Small phone:

image

@tom-anders
Copy link
Collaborator Author

(Based on #2660 so that I can test support in analysis board)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the Crazyhouse chess variant to the Lichess mobile app. Crazyhouse is a variant where captured pieces can be dropped back onto the board, requiring UI for displaying and interacting with "pockets" of captured pieces.

Changes:

  • Introduces a new PocketsMenu widget to display captured pieces that can be dragged onto the board
  • Refactors board parameter passing by introducing a sealed GameBoardParams class to unify readonly and interactive board states
  • Adds variant-changing capability in standalone analysis mode
  • Enables the Crazyhouse TV channel and updates variant support lists

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/src/widgets/pockets.dart New widget for displaying captured pieces with drag-and-drop support
lib/src/model/game/game_board_params.dart New sealed class unifying board parameters (readonly vs interactive)
lib/src/widgets/game_layout.dart Refactored to use GameBoardParams and display pockets for Crazyhouse
lib/src/view/analysis/analysis_layout.dart Added sideToMove parameter and pocket rendering support
lib/src/view/analysis/analysis_screen.dart Added "Change variant" menu option for standalone analysis
lib/src/model/common/chess.dart Added Crazyhouse to supported variants and hasDropMoves property
lib/src/model/tv/tv_channel.dart Uncommented Crazyhouse TV channel
lib/src/widgets/pgn.dart Strip 'P' prefix from pawn drops in PGN display
lib/src/utils/screen.dart Added helper function for pocket square sizing
lib/src/constants.dart Added padding constant for Crazyhouse layout
test/widgets/game_layout_test.dart Added test for Crazyhouse drop moves
test/view/analysis/analysis_screen_test.dart Added tests for variant changing and Crazyhouse support
Multiple screen files Updated to use new GameBoardParams API
Comments suppressed due to low confidence (6)

lib/src/view/analysis/analysis_layout.dart:216

  • Typo in comment: "to large" should be "too large"
    lib/src/utils/screen.dart:3
  • Potentially unnecessary import: The import 'package:lichess_mobile/src/widgets/pockets.dart' appears to only be used in a documentation comment (line 48). Documentation references don't require imports. Consider removing this import to avoid creating an unnecessary dependency, unless PocketsMenu types are actually used in the code.
import 'package:lichess_mobile/src/widgets/pockets.dart';

lib/src/widgets/pockets.dart:23

  • Grammar error in documentation comment. The phrase "pieces from the pockets are can be dragged" should be "pieces from the pockets can be dragged" (remove "are").
  /// If this is equal to [side], pieces from the pockets are can be dragged onto the board to make a move.

lib/src/widgets/pgn.dart:1245

  • The logic to strip the 'P' prefix from pawn drops is too broad and could potentially affect non-drop moves. Consider checking if the move contains '@' (the drop move indicator) before stripping the prefix. For example: branch.sanMove.san.contains('@') && branch.sanMove.san.startsWith('P@'). This would make the logic more robust and only apply to actual pawn drop moves in crazyhouse notation.
    final san = branch.sanMove.san.startsWith('P')
        ? branch.sanMove.san.substring(1)
        : branch.sanMove.san;

test/view/analysis/analysis_screen_test.dart:162

  • Typo in comment: "crazhouse" should be "Crazyhouse"
          // Change to crazhouse, pockets should be displayed:

lib/src/view/analysis/analysis_screen.dart:598

  • Missing localization: The text 'Change variant' is hardcoded and has a TODO comment for l10n. This should be properly localized before merging.
              makeLabel: (context) => const Text('Change variant'), // TODO l10n

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tom-anders tom-anders force-pushed the crazyhouse branch 2 times, most recently from 950a9b9 to d9258b3 Compare February 21, 2026 13:24
@tom-anders
Copy link
Collaborator Author

(Based on #2660 so that I can test support in analysis board)

rebased now 👍

@veloce
Copy link
Contributor

veloce commented Feb 21, 2026

There are conflicts from your other PR @tom-anders

@tom-anders
Copy link
Collaborator Author

There are conflicts from your other PR @tom-anders

fixed now 👍

@veloce
Copy link
Contributor

veloce commented Feb 22, 2026

Will review asap. I am focusing on releasing offline computer right now. Next will be variants.

@veloce
Copy link
Contributor

veloce commented Feb 22, 2026

Oh, sorry there is another conflict.

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.

2 participants