-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] With two pybricks code windows open, file menu opens on both #807
Comments
The root cause is that we use local storage to persist the state which is shared between all windows. There is a bit more state than just the selected activity tab that is tied to local storage and will affect all open windows.
The position of panes that control the size of the docs and the terminal also use local storage, but the control doesn't update when the storage changes so we don't see the change in other windows. The oneshot for showing the Pybricks tour on first run also uses local storage, but in that case we do want the state shared between windows. |
What is the expected behavior when you close all windows that are in different states and then open a new window? |
I think the current behavior is definitely fine for this release. I was giving a demo on a small screen when I noticed this, but it is easy enough to just close the file menu again. |
The useLocalStorage hook synchronizes state between windows. In the case of the activities tabs, we don't want this state synchronized, otherwise changing a tab in one window would change the tab in all open windows. Instead, we can use sessionStorage so that the state persists when refreshing or duplicating a browser tab. Local storage is still used as the default value so that any new window that is opened will use the last selected state. Issue: pybricks/support#807
This adds use of sessionStorage for the documentation visibility toggle. This way, when multiple windows are open, the docs can be controlled separately in each window. Local storage is still used as the default value for new windows. Issue: pybricks/support#807
The useLocalStorage hook synchronizes state between windows. In the case of the activities tabs, we don't want this state synchronized, otherwise changing a tab in one window would change the tab in all open windows. Instead, we can use sessionStorage so that the state persists when refreshing or duplicating a browser tab. Local storage is still used as the default value so that any new window that is opened will use the last selected state. Issue: pybricks/support#807
This adds use of sessionStorage for the documentation visibility toggle. This way, when multiple windows are open, the docs can be controlled separately in each window. Local storage is still used as the default value for new windows. Issue: pybricks/support#807
The cases of the selected activity tab and the documentation show/hide state have been fixed. |
Describe the bug
Open two browser tabs or windows. Click the left hand file icon to open the file bar. Now it opens on both browser windows.
Expected behavior
Button activity constrained to one browser window.
The text was updated successfully, but these errors were encountered: