After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703841 - Claim Draw should display a message when a draw cannot be claimed
Claim Draw should display a message when a draw cannot be claimed
Status: RESOLVED FIXED
Product: gnome-chess
Classification: Applications
Component: General
git master
Other Linux
: High blocker
: ---
Assigned To: Michael Catanzaro
gnome-chess-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-09 02:26 UTC by Adam Dingle
Modified: 2013-08-14 02:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Display a dialog if Claim Draw fails (3.78 KB, patch)
2013-08-11 20:52 UTC, Michael Catanzaro
none Details | Review
screenshot of new dialog (31.45 KB, image/png)
2013-08-11 21:03 UTC, Michael Catanzaro
  Details
Alternative dialog (28.35 KB, image/png)
2013-08-11 22:45 UTC, Michael Catanzaro
  Details
Display a dialog if Claim Draw fails (3.74 KB, patch)
2013-08-12 13:32 UTC, Michael Catanzaro
none Details | Review
Display a dialog if Claim Draw fails (3.74 KB, patch)
2013-08-12 13:38 UTC, Michael Catanzaro
none Details | Review
Screenshot of newest version of the dialog (28.35 KB, image/png)
2013-08-12 13:44 UTC, Michael Catanzaro
  Details
Screenshot (32.23 KB, image/png)
2013-08-13 16:39 UTC, Michael Catanzaro
  Details
Display a dialog if Claim Draw fails (3.93 KB, patch)
2013-08-13 16:42 UTC, Michael Catanzaro
none Details | Review
Display a dialog if Claim Draw fails (3.88 KB, patch)
2013-08-13 16:43 UTC, Michael Catanzaro
committed Details | Review

Description Adam Dingle 2013-07-09 02:26:22 UTC
If I press the Claim Draw button but a draw cannot be claimed, nothing happens at all.  This seems odd.  Instead, gnome-chess should display a dialog stating that a draw cannot be claimed.
Comment 1 Michael Catanzaro 2013-07-09 04:01:41 UTC
Yup. I didn't know that the option was even functional until a month ago. The surprising thing is that nobody has filed this bug before.
Comment 2 Michael Catanzaro 2013-08-11 20:52:35 UTC
Created attachment 251309 [details] [review]
Display a dialog if Claim Draw fails

Previously there was no user feedback at all if Claim Draw was used at
an incorrect time.  Instead, present a dialog explaining the usage of
Claim Draw.  It also informs the user the number of repetitions of the
current board state and presents the halfmove clock.
Comment 3 Michael Catanzaro 2013-08-11 21:03:24 UTC
Created attachment 251310 [details]
screenshot of new dialog

This patch depends on a commit from earlier today.  It's a bit verbose, but I don't think it would be terribly helpful to just say "No try again later."

The halfmove clock (which counts up the moves since last capture or pawn advancement) is unfortunately completely broken, so try to ignore that.
Comment 4 Michael Catanzaro 2013-08-11 22:36:50 UTC
Halfmove clock is fixed in git.
Comment 5 Michael Catanzaro 2013-08-11 22:45:35 UTC
Created attachment 251313 [details]
Alternative dialog

Alternative dialog, I like this one a bit better
Comment 6 Adam Dingle 2013-08-12 09:33:35 UTC
Looks good to me.  "Fifty moves have passed without capture" should probably be "50 moves have passed without a capture":

- Writing 50 using numerals is more consistent with the text above ("3 moves have passed"), and it's usually better to write large numbers using numerals anyway.
- "capture" needs an article.
Comment 7 Michael Catanzaro 2013-08-12 13:32:25 UTC
Created attachment 251348 [details] [review]
Display a dialog if Claim Draw fails

Previously there was no user feedback at all if Claim Draw was used at
an incorrect time.  Instead, present a dialog explaining the usage of
Claim Draw.  It also informs the user the number of repetitions of the
current board state and presents the halfmove clock.
Comment 8 Michael Catanzaro 2013-08-12 13:38:12 UTC
Created attachment 251349 [details] [review]
Display a dialog if Claim Draw fails

Previously there was no user feedback at all if Claim Draw was used at
an incorrect time.  Instead, present a dialog explaining the usage of
Claim Draw.  It also informs the user the number of repetitions of the
current board state and presents the halfmove clock.
Comment 9 Michael Catanzaro 2013-08-12 13:44:04 UTC
Created attachment 251350 [details]
Screenshot of newest version of the dialog

Made your corrections; also I completely reworded the first point, since "The current board state has only occurred once before" is not a very clear way to say "two."
Comment 10 Adam Dingle 2013-08-12 23:27:56 UTC
The dialog looks good now, but it seems there's a bug in the code which checks for repeated board positions.  To see the problem:

1. Start a player-versus-player game.
2. Make these moves:

   1. e4 e5; 2. Ke2 Ke7; 3. Ke1 Ke8.

3. Press Claim Draw.  You'll see a dialog stating "It is the first time this board position has occurred."  But actually this position has occurred once before, namely after 1. e4 e5.
Comment 11 Michael Catanzaro 2013-08-13 14:45:00 UTC
After turn 1 the Kings are still able to castle, but after turn 3 they cannot.  This is sufficient to make the positions different for purposes of determining triple repetition.  A pawn's ability to capture en passant on the current move is also significant for the purposes of triple repetition.

But it's certainly really confusing.  I'm not sure the best way to present this on the dialog.  Maybe add a new bullet point when this occurs, and say something along the lines of "the position has occurred X times before, but you weren't able to castle/ep then so it's really different."
Comment 12 Adam Dingle 2013-08-13 14:56:24 UTC
Aha - you're right!

This will rarely matter but when it does this is confusing.  So yes, I think it would be a good idea to add an additional bullet point when two past positions differ only in castling/en passant states.  The bullet point could simply mention that the castling/en passant state must be the same every time - I think that would be clear enough.

By the way, apparently Karpov once claimed a draw incorrectly since the right to castle was not the same in each repeated position:

http://en.wikipedia.org/wiki/Threefold_repetition#Karpov_versus_Miles
Comment 13 Michael Catanzaro 2013-08-13 16:04:31 UTC
For 3.8.4 we can't add a dialog, but we can make the behavior a bit less confusing by simply preventing the user from claiming a draw unless it would be successful; pushed 694d454a to gnome-3-8
Comment 14 Michael Catanzaro 2013-08-13 16:39:47 UTC
Created attachment 251519 [details]
Screenshot

This is the best I could come up with...
Comment 15 Michael Catanzaro 2013-08-13 16:42:45 UTC
Created attachment 251521 [details] [review]
Display a dialog if Claim Draw fails

Previously there was no user feedback at all if Claim Draw was used at
an incorrect time.  Instead, present a dialog explaining the usage of
Claim Draw.  It also informs the user the number of repetitions of the
current board state and presents the halfmove clock.

https://bugzilla.gnome.org/show_bug.cgi?id=703841

https://bugzilla.gnome.org/show_bug.cgi?id=251519
Comment 16 Michael Catanzaro 2013-08-13 16:43:54 UTC
Created attachment 251522 [details] [review]
Display a dialog if Claim Draw fails

Previously there was no user feedback at all if Claim Draw was used at
an incorrect time.  Instead, present a dialog explaining the usage of
Claim Draw.  It also informs the user the number of repetitions of the
current board state and presents the halfmove clock.
Comment 17 Michael Catanzaro 2013-08-13 17:03:24 UTC
Adam, do you know if the primary text "You cannot currently claim a draw." is supposed to end with punctuation?  I can't seem to find this in the HIG (I know it's probably in there somewhere).
Comment 18 Adam Dingle 2013-08-13 23:04:54 UTC
This dialog is what the human interface guidelines call an alert.  The 3.8 guidelines seem to be ambiguous on this point: they contain one sample alert whose text ends with a period ("All updates are complete.") and another with none ("Cannot add user").

For what it's worth, I like the period in "You cannot currently claim a draw."
Comment 19 Adam Dingle 2013-08-13 23:18:00 UTC
There seems to be one more bug.  Note that whether a position is repeated should also be determined by whose move it is.  To see the problem, start a human-versus-human game and play these moves:

1. d4 d5; 2. Qd3 Qd6; 3. Qd2 Qd8; 4. Qd1 Qd6; 5. Qd3 Qd7; 6. Qd1 Qd8; 7. Qd3 Qd6; 8. Qd2 Qd8; 9. Qd1.

Now, as Black, press Claim Draw.  The claim will succeed, even though this position has occurred only once before with Black to move, namely after 4. Qd1.
Comment 20 Michael Catanzaro 2013-08-14 02:31:58 UTC
(In reply to comment #18)
> 
> For what it's worth, I like the period in "You cannot currently claim a draw."
Works for me!

(In reply to comment #19)
> There seems to be one more bug.  Note that whether a position is repeated
> should also be determined by whose move it is.  To see the problem, start a
> human-versus-human game and play these moves:
> 
> 1. d4 d5; 2. Qd3 Qd6; 3. Qd2 Qd8; 4. Qd1 Qd6; 5. Qd3 Qd7; 6. Qd1 Qd8; 7. Qd3
> Qd6; 8. Qd2 Qd8; 9. Qd1.
> 
> Now, as Black, press Claim Draw.  The claim will succeed, even though this
> position has occurred only once before with Black to move, namely after 4. Qd1.

Good catch!  I've filed Bug #705956
Comment 21 Michael Catanzaro 2013-08-14 02:33:07 UTC
Attachment 251522 [details] pushed as 3c9ab4e - Display a dialog if Claim Draw fails