RaspberryPiFoundation / editor-ui

Code Editor web component
https://editor-static.raspberrypi.org
Apache License 2.0
36 stars 9 forks source link

Cannot switch output layout between split/tabbed when editor is running #683

Open maxelkins opened 1 year ago

maxelkins commented 1 year ago

User story

As a user, I would like to switch my output layout while my code is running, so that I don't have to stop my code.

Details

At the moment you cannot switch between split/tabbed while the code is running. It is also not clear that you currently need to stop you code to do so, leading to unsucessful user interactions - as recently shown by the latest editor research.

I'm not sure if this is a tech limitation or a bug?

This is a problem with all visual outputs, aka including sensehat.

Current interaction demo

https://github.com/RaspberryPiFoundation/editor-ui/assets/43481548/7ccebbb7-177b-4074-a782-bb1b4fc99917

Suggestions

Option 1 (preferred): User can change the output layout while code is running and the code continues to run.

Option 2: User can change the layout when code is running, but if there are tech limitations here, could we stop the code when the split/tabbed button is hit, change the layout, then rerun the code? (All from 1 click). Down side to this is that the current output is lost - could be frustrating for unique generative visual outcomes etc.

Option 3: We hide the split/tabbed button while the code is running so that the user doesn't have a unsucessful interaction. I'll like to avoid this option if possible.

loiswells97 commented 1 year ago

The observed functionality was introduced to work around the problem of moving/switching the p5 canvas mid-run. The differing tab structure of the two layouts currently means that the output gets cleared when you switch view because the same canvas/output div is not being used for both views. We might need to change the structure/store the output in redux (not sure this would work for p5 though) in order to fix this.