Skip to content

Conversation

bgrgicak
Copy link
Collaborator

Motivation for the change, related issues

Playground will soon be able to work offline , but some features like GitHub exports still require internet to work.

When offline users shouldn't be able to:

  • Change PHP versions
  • Change WordPress versions
  • Enable networking
  • Change if extensions are loaded or not
  • Export to GitHub
  • Import from GitHub
  • Report error

Some of these might get offline support in the future, but they won't be available in v1.

Implementation details

The PlaygroundReduxState store now has a offline selector.

This selector is used by the Customize Playground form and the menu to disable buttons for functionalities that don't work offline.

Testing Instructions (or ideally a Blueprint)

  • Checkout this branch
  • Open Playground http://127.0.0.1:5400/website-server/
  • Go offline (in Chrome Dev Tools > Application > Service Worker > Offline checkbox)
  • Open the Customize Playground
  • Confirm that these features are disabled
    • Change PHP versions
    • Change WordPress versions
    • Enable networking
    • Change if extensions are loaded or not
  • Open the menu (upper right corner)
  • Confirm that these features are disabled
    • Export to GitHub
    • Import from GitHub
    • Report error
      Screenshot 2024-07-12 at 13 55 19
      Screenshot 2024-07-12 at 13 55 26
@adamziel
Copy link
Collaborator

adamziel commented Jul 15, 2024

Looking good! In cc62c1d I've disabled more menu options and added a message to explain why everything is greyed out:

@adamziel adamziel merged commit b91bf62 into trunk Jul 15, 2024
@adamziel adamziel deleted the update/limit-website-while-offline branch July 15, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment