Dyalog / ewc-client

Other
1 stars 4 forks source link

CurCell should not be updated until CellMove callback sends Proceed #284

Open mkromberg opened 1 week ago

mkromberg commented 1 week ago

As for KeyPress, CurCell needs to report the active cell BEFORE the move. Currently, in DemoScroll, if you move from Cell [1,1] to [1,2], you will see:

{"Event":{"ID":"F1.VGRID","EventName":"CellMove","EventID":"2539b4e3-aedb-444c-a63e-f8ad544eec06","Info":[1,2,1,0,0,0,""]}}

Callback requests CurCell and receives response [1,2]:

{"WG":{"ID":"F1.VGRID","Properties":["CurCell"],"WGID":"78"}} {"WG":{"ID":"F1.VGRID","Properties":{"CurCell":[1,2]},"WGID":"78"}}

Callback sends Proceed: {"EC":{"EventID":"2539b4e3-aedb-444c-a63e-f8ad544eec06","Proceed":1}}

cursork commented 1 week ago

To be clear, my understanding is that this should be:

{"WG":{"ID":"F1.VGRID","Properties":["CurCell"],"WGID":"78"}} {"WG":{"ID":"F1.VGRID","Properties":{"CurCell":[1,1]},"WGID":"78"}}

mkromberg commented 1 week ago

Note that when a KeyPress precedes a CellMove, the following should be true:

1) KeyPress events should NOT update CurCell 2) If a KeyPress is confirmed, the client should perform "default processing" for the keystroke 3) Some keys like cursor arrows and enter have defined behaviours that trigger CellMove events 4) If one of these keys was pressed and there is a CellMove event defined, a CellMove event should be sent 5) ONLY if/when the CellMove is confirmed should CurCell be updated

On the other hand, if a CellMove is caused by a mouse click, then:

1) The CellMove event should be sent to the server 2) If it is rejected, CurCell must remain unchanged and focus remain in the previous cell 3) If it is approved, CurCell can now change