Closed ctm closed 2 weeks ago
I'm doing a "before mom gets up" spike to see if I can set up the communication pathway from parent window to child window. I'm doing this now because I deployed structure sheets for upcoming and running events already, but haven't yet adjusted how level durations are dealt with, and I think they can be done a little more cleanly in templates if we don't use templates directly during tournament creation. Here's what I'll explore this morning:
WindowProxy
that is returned by open_with_url_and_target_and_features
DemoParams
)NewEvent
)Create::capture_values
send the appropriate message if a Window has been savedWindowProxy
when its closed property is set"message"
Turns out, it took me a while just to write up this list, because I've been browsing MDN. postMessage
has some intricacies I'm still exploring.
Since web_sys::Window::post_message_with_transfer
uses JsValue
for both the message
and the transfer
parameters, there's no option to use postcard
into an ArrayBuffer
. Considering the small size of the payload in the infrequency of transfer, this restriction actually makes things easier because it means I shouldn't (honestly!) spend any time looking into serializing via postcard
. We'll just use JsValueSerdeExt
.
Turns it was better to use serde-wasm-bindgen
than JsValueSerdeExt
, but I do have the pathway working. So now the child window gets the initial state of the create dialog and gets a new state any time the state is changed. The remaining steps are:
HashMap<StructureId, Structure>
data
field with the appropriate Structure
into an Event
EventAndOwner
DemoParams
(see NickMapper::demo
)NewEvent
(see NickMapper::process_pen_user_request
on the CreateEvent
match arm: i.e., line 769)update
create and store the EventAndOwner
view
use the stored EventAndOwner
UpdateCreatedAt
Msg
variant and have it update the created_at fieldset_created_at_timeout
that sends an UpdateCreatedAt
appropriatelyhtml
methodThis was supposed to just be a little bit of exploration yesterday morning, but mom's schedule went kittywampus yesterday and I chose to work on this issue in between events in her day. Now I'm close to results and I have "an hour" "to spare", so I'll push on and try to get it deployed today or tomorrow, not because it's important, but just to finish it and get it out of the way.
Done. Deploying now.
Decided to not test with second granularity because it'll only take a minute to test with minute granularity and it'll take more than a minute to set up the test with second granularity. OTOH, each time the minute granularity test fails, I have to poke around, make changes and/or add instrumentation and then test again, and then wait up to a minute to see my results. In the grand scheme of things, that extra minute doesn't mean much, but it'd be frustrating, however the minute granularity test worked on the first try. I love Rust.
Make it so that when people are creating a tournament, if they click the circle-i they get a tentative structure sheet.
Currently, when people are creating a tournament, the circle-i takes them to a template for the structure they currently have selected. Instead, we can bring them to something like
/structure/new
and then send information from the parent window to the child window. That information would be the choices currently selected, then as choices are changed, we could update the child window.This is easily done, but we need to implement structure sheets (#1439), first. It's not a high priority both because the functionality isn't really that important and because we still have about a month of the WSOP-Style series left and in round numbers, nobody will be creating tournaments during it.