nodsup-halnux / wui

Front End Library for Gall Apps and Agents, to display app states in various formats.
0 stars 0 forks source link

Deal with State issues #5

Closed nodsup-halnux closed 4 months ago

nodsup-halnux commented 4 months ago

Our library is a wrapper around an app, that must dispatch app specific pokes and requests to the app. It must also run the app, and interact with its state. Currently three options were considered to accomplish this:

Consulted Neal, Jack and Scott for these issues.

1) Usage of the ++on-peek arm: We can call the app directly, to use this functionality. However, students have to do some implementation in the arm to extract all the state, or sections of it.

2) Core Composure, and adjusting the wrapper call: Using a %+ and passing in the state directly. So we have the state passed in, and also lodged in the subject tree of the app door. This did not work however, as we had two separate copies of the state, and it would stay perpetually bunted.

3) Usage of the ++on-save arm and zap-gar: This calls the app directly, pulls the state without update issues, and gets us what we want.

(3) was chosen in the end.

:: board ((q:(need (need (on-peek:ag /x/dbug/state))))) -.+.game
:: reminder: peek produces a unit unit cage.
::=/  mystate  on-save:ag  ~&  mystate
=/  gamestate  !<(appstate on-save:ag)  
?~  board.gamestate  !!
~&  "our state before frontpage call::"  ~&  gamestate
:_  this  (make-200 rid (frontpage bol gamestate))  ::  !<(state on-save:ag)
== :
nodsup-halnux commented 4 months ago

In the end (3) was used. It made 2-way Sail Page interaction a bit difficult (on updating the app after the Sail page sends data back), but this was scrapped for 1-way requirements. Left intact for now.

Time Estimate: 6 hours.