mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Sliding your finger in coordinate trainer continues to select squares

Open EmmetSchuler opened this issue 1 year ago • 2 comments

What is the problem?

When using the coordinate trainer, players tap on the square in order to select it. However as of now players can slide their finger around and it will continue to select the square under their finger. This can be confusing, because no other board behaves in this way. I also don't believe this is intended behavior.

Steps to reproduce the bug

Go to coordinate trainer Tap your finger on a square Now continue to drag your finger across the board

Expected: no more inputs are received until you lift your finger up and down again What happened: Inputs are received as long as the finger remains moving

App version

0.11.0

Device Info

Pixel 6 and Android 14

Additional information

No response

EmmetSchuler avatar Sep 13 '24 16:09 EmmetSchuler

To fix this issue we'll need to make a change in the lib/src/widgets/board_editor.dart flutter package file since it's code specifies calling the same function on tap and drag actions. Can someone help me with where I will need to make the changes and also publish a new version?

Files for reference:

  1. lib/src/view/coordinate_training/coordinate_training_screen.dart - onGuess method called inside function passed to onEditedSquare on tap/drag.
  2. [user_path]/.pub-cache/hosted/pub.dev/chessground-5.1.1/lib/src/widgets/board_editor.dart - _onTouchedEvent calls onEditedSquare

sid0-0 avatar Sep 19 '24 18:09 sid0-0

You'd need to make a PR at https://github.com/lichess-org/flutter-chessground

Note however, that this behavior is actually intended for the actual board editor (so that you can drag a finger across the board and delete pieces at every location it touches for example).

So probably, the solution would be to add a new field to the EditorPointerMode enum that has the intended behavior

tom-anders avatar Sep 19 '24 18:09 tom-anders

Another way of fixing it is to add an onTappedSquare to the Chessboard widget (and don't use the BoardEditor widget.

veloce avatar Oct 16 '24 09:10 veloce

I think we need to keep this one open until https://github.com/lichess-org/mobile/pull/1311 is merged

tom-anders avatar Jan 12 '25 07:01 tom-anders