Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapping still doesn’t cancel premoves #42

Closed
sorsted opened this issue Jul 19, 2024 · 9 comments
Closed

Tapping still doesn’t cancel premoves #42

sorsted opened this issue Jul 19, 2024 · 9 comments

Comments

@sorsted
Copy link

sorsted commented Jul 19, 2024

This issue is still there for me. I am using a clone of the main branch from a couple of days ago.

@veloce
Copy link
Collaborator

veloce commented Jul 19, 2024

I don't reproduce. And widget tests say the contrary:

// unset by tapping empty square
await tester.tapAt(squareOffset('c5'));
await tester.pump();
expect(find.byKey(const Key('e4-premove')), findsNothing);
expect(find.byKey(const Key('f5-premove')), findsNothing);

@veloce veloce closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
@sorsted
Copy link
Author

sorsted commented Jul 23, 2024

@veloce I just tested again on an Android tablet with a clone of the newest version. I still cannot cancel premoves.

@veloce
Copy link
Collaborator

veloce commented Jul 24, 2024

I maintain the feature works as intended in this package.

@sorsted
Copy link
Author

sorsted commented Jul 28, 2024

@veloce Is this convincing enough?

I'm using a clone from today. The only change I made was to line 407 of main.dart where I increased the delay by replacing 500 by 5000:

await Future.delayed(Duration(milliseconds: random.nextInt(1000) + 5000));
VID_20240728130434.mp4

@veloce
Copy link
Collaborator

veloce commented Jul 29, 2024

Finally understood what you meant. The piece is not deselected if tapped again.

@veloce
Copy link
Collaborator

veloce commented Jul 29, 2024

I remember I changed the behaviour after that issue: lichess-org/mobile#740

So I don't understand anymore.

@sorsted
Copy link
Author

sorsted commented Jul 29, 2024

Finally understood what you meant. The piece is not deselected if tapped again.

It's not just that. As you see, I simply cannot cancel a premove, except by making another premove.

@veloce
Copy link
Collaborator

veloce commented Jul 29, 2024

No, you can. By tapping anywhere on the board expect your own pieces.

I found the difference with lichess website: the how do you move pieces settings makes it behave differently if you choose "click" only or drag.

@sorsted
Copy link
Author

sorsted commented Jul 29, 2024

@veloce Great.

Anyway, if tapping anywhere also cancels premoves, then this other issue of mine becomes related. I maintain that if you make both sides interactable and turn premoves on, then the expected behaviour is that premoves should be allowed on both sides.

I guess premoves on both sides can only work if the ability to move pieces by tapping two squares is turned off; otherwise, if both players tap on a piece to select it, then when one of them taps on a destination square, the system cannot know if it was a move destination or a premove destination.

Whether or not tapping anywhere should cancel premoves is then debatable. Perhaps you should only be allowed to cancel premoves by tapping your own pieces, and only if that piece was not in a valid premove destination.

@veloce veloce reopened this Aug 2, 2024
@veloce veloce closed this as completed in dc5f810 Aug 2, 2024
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

No branches or pull requests

2 participants