dwave-examples / 3d-bin-packing

Use a hybrid solver to use the minimum number of bins to pack items with different dimensions
Apache License 2.0
51 stars 24 forks source link

Integrate `streamlit` app into LeapIDE better #25

Closed randomir closed 2 years ago

randomir commented 2 years ago

Currently, in LeapIDE, streamlit app is run with default options:

streamlit run bin_packing_app.py

producing bindings on:

image

In LeapIDE, none of these URL can be opened directly (e.g. with ctrl+click), as all workspace services are proxied to a secure https URL behind LeapIDE authorization.

In addition, because port on-open behavior is defined as:

https://github.com/dwave-examples/3d-bin-packing/blob/a04629892f104106a33bebcf4bda52b49af8c0c1/.gitpod.yml#L7-L9

notification popup with "Open Browser" button is suppressed.

And usually, external window opening is blocked by UA. As a result, it might be unclear to the end used how to actually open streamlit app in a new tab (hence: #24), as:

One workaround is to document the behavior, and suggest user opens "Remote Explorer" sidepane, locates the app port (8501) and clicks "Open Browser" icon.

However, we can do better: