simularium / simularium-website

Front end website for the Simularium project, includes the Simularium viewer
https://simularium.allencell.org
Apache License 2.0
6 stars 3 forks source link

Feature/conversion check server #452

Closed interim17 closed 8 months ago

interim17 commented 9 months ago

Problem

We want to ping the Octopus server to see if it is healthy before letting the user proceed too far along the auto-conversion workflow.

Closes #389

Solution

This is the front end follow up to Alli's work, which set up the health check communication between the the Viewer and Octopus.

Reviewing this PR requires a dev build of the viewer, and a local instance of Octopus running, fun! A glimpse into the future.

Style things

I did a walkthrough of the modal styling with @lynwilhelm and have her approval on it. If you look at these designs you may notice that the auto-conversion designs are old and out of sync with the most current global style guidance.

For devs in review, if something on your machine looks/behaves dramatically wrong, or is vastly different than the screen shot, please let me know, but don't be too concerned about the design brief, Lyndsay and I are in touch about it all.

Screenshot 2023-12-07 at 1 28 26 PM Hover state: Untitled 2

Code things

To check the server health we need to implement some logic to account for the fact that WebSocket requests don't have an automatic response if the request fails:

configureFileConversionLogic is where the action happens:

Steps to Verify:

1) You need a dev build of the viewer installed in the website. Building from main will work. npm run build and copy the path of your viewer repo into package.json 2) You need an Octopus instance running locally at server ip "0.0.0.0" and port 8765, I can try to help you set this up if needed, @ascibisz is a also a wiz at this. 3) When your server is running, npm run start the website and go to http://localhost:9001/import or choose "import other file type" from the Load model menu. 4) Select Smoldyn for your conversion engine and upload any file that ends in .txt 5) Click next. If your server is running you should proceed to the next page, and also see a log of "conversion-server-live" in your console. 6) To test failure, repeat steps 3-6 without running your local Octopus instance. When you click Next you should see the error modal. 7) Similarly, if you turn octopus on between page load and file upload step, you should be able to advance. 8) Vice versa, if octopus is not running when you load the page, but then you turn it on, and then you upload a file, it should hopefully let you advance!

interim17 commented 8 months ago

A couple updates:

We were updating the viewer status toVIEWER_IMPORTING to disable some buttons in the app header but it was not working well because any trigger of VIEWER_ERROR status would reactive the buttons. We don't need it now that we have conversionStatus so I removed it entirely and also updated both of the status types based on @ShrimpCryptid 's feedback.

The redux initializeConversion() action is now handling the configuration and conversion so we were able to thin a little code from a few other places and it should be more semantic now. Thanks for the ongoing feedback!

ShrimpCryptid commented 8 months ago

Copied over from another PR I accidentally commented on:

image The cancel button is really faint when hovered.

image Also, the delete button is invisible until hovering over the text filename.