Skip to content
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

Persist state of lock store between tabs #531

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IshavSohal
Copy link
Member

@IshavSohal IshavSohal commented Jan 30, 2025

Related Item(s)

#520

Changes

  • Persist the state of the lock store between tabs, in particular the editor and preview tabs
  • Close the preview's BroadcastChannel upon lang change (this was causing the reported error)

Notes

  • I decided to use this plugin to persist the state of the lock store. If we don't want to use this, let me know of preferred alternatives. I could also try creating our own composable if needed
  • I noticed that, within the preview component, when window.props is not defined (which occurs upon reloading the tab), the BroadcastChannel was not being created. Was this intentional? Currently I'm creating the BroadcastChannel in both cases (hence the plugin), but I can revert this if necessary

Testing

Steps:

  1. Load any product
  2. Open devtools
  3. Within the metadata editor, preview the product
  4. Within the preview tab open devtools
  5. Move your mouse around in the preview tab
  6. Switch back to the editor tab, and notice the console logs indicating that the messages sent by the preview's BroadcastChannel were received
  7. Within the preview tab switch languages and repeat 5-6
  8. Within the preview tab refresh and repeat 5-6
  9. Throughout the testing, the 'Session Extended' toast should not appear on mouse movement in the preview tab

This change is Reviewable

@IshavSohal IshavSohal added PR: Build PR that involves changes to the build. This includes changes to the Github Actions. For JS wizards. PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review. labels Jan 30, 2025
Copy link

Your demo site is ready! 🚀 Visit it here: https://ramp4-pcar4.github.io/storylines-editor/issue-520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Build PR that involves changes to the build. This includes changes to the Github Actions. For JS wizards. PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant