pychess-variants icon indicating copy to clipboard operation
pychess-variants copied to clipboard

Negative piece count in Editor

Open gbtami opened this issue 3 years ago • 8 comments

Split from https://github.com/gbtami/pychess-variants/issues/723 https://user-images.githubusercontent.com/48226312/156930148-183c8623-6f59-4570-8e42-13d148fe0d01.mp4

gbtami avatar Mar 06 '22 15:03 gbtami

This is affecting the ability to add pieces in the editor when using the Apple Pencil. I'm noticing that the editor doesn't seem to recognize the Apple pencil when dragging pieces to the board. But when I use my fingers it recognizes the pieces correctly. I was going to post a github ticket on this very issue right now but saw this and decided to simply put my input here.

Curious2021 avatar Mar 08 '22 18:03 Curious2021

@Fulmene @nnickoloff1234 any idea?

gbtami avatar Mar 09 '22 08:03 gbtami

Unfortunately don't know how to test and reproduce this without buying that specific hardware. If I had to shoot in the dark I would remove "touchmove" from this array:

https://github.com/gbtami/chessgroundx/blob/fbc577b557e37efcdec76212910c08d1b1e02126/src/types.ts#L227

But not sure what might break. Still I feel it is worth the shot, if someone can coordinate the change in source+deployment+testing, because it is a small change and just by looking at the source it makes sense "touchmove" to be removed and feels like some legacy thing from previous implementation that no longer makes sense.

nnickoloff1234 avatar Mar 10 '22 15:03 nnickoloff1234

If above change fixes the problem, but as a side effect somehow breaks something else related to pocket then I would suggest this line to be changed instead:

https://github.com/gbtami/pychess-variants/blob/03e2dbf45d8fd9c9889477aab42185046926595f/client/editorCtrl.ts#L96

To

['mousedown'].forEach(name =>

(of course then can be simplified)

nnickoloff1234 avatar Mar 10 '22 15:03 nnickoloff1234

I think I'll need to read up on web event again, but why was the touch event for eventsDragging touchmove instead of touchstart?

Fulmene avatar Mar 14 '22 05:03 Fulmene

i wrote my above comments assuming these touch* events are irrelevant, redundant and useless and tablet stuff would trigger appropriate mouse* events as well, so we don't need that touch stuff at all.

On second thought i am not sure why i would assume that, based on my zero experience with touch devices.

So indeed probably replacing "touchmove" with "touchstart" is better idea than what i suggested

nnickoloff1234 avatar Mar 14 '22 11:03 nnickoloff1234

Curious2021

I'm noticing that the editor doesn't seem to recognize the Apple pencil when dragging pieces to the board. But when I use my fingers it recognizes the pieces correctly.

I'm on android & I do not use pencil. I'm facing the issue with touch (finger) input.

I noticed this issue happens only variants with "side board editor with some piece". So particularly with these variants only* - Placement, Sittuyin, Gorogoro+, S-chess, S-House, Synochess, Shinobi

https://user-images.githubusercontent.com/48226312/164954722-421ebda7-22ac-4f66-b98e-bc71f9a057fa.mp4

I hope this information somehow help the devs. Thanks.

shuvashish76 avatar Apr 24 '22 03:04 shuvashish76

I can't add pieces to the pocket in drop variants (f.e. Shogi) as well. (Android+Mobile Chrome) But can add pieces (DnD) to the board. All in all DnD handling code is not the same when the target is the board or the pocket.

gbtami avatar Apr 25 '22 08:04 gbtami