Instead of rendering the toaster separate from the main index, add it
there so we can inherit all of the context providers. This requires
passing the ref object instead of the toaster instance itself, so
sagas have to be updated.
This changes things up a bit so that files are handled by uuid instead
of path. The allows for files to be renamed without breaking things.
Also some improvements with persistence of the view state for each
file is made.
This starts moving alerts to the same subsystem where they are relevant
instead of putting everything in notifications.
So far, only the explorer file in use error is handled like this.
This replaces the delete notification with a new alert dialog. This
makes for better keyboard interaction and forces the user to make a
decision before doing anything else.
Also fixes closing the editor before deleting the file.
This refactors the new file wizard to be more independent. Most of the
control is now done through the saga instead of splitting it between
react and the sagas.
Also fix a few issues while we are touching this:
- pressing enter now accepts the dialog
- newly created file is now activated in the editor
This splits the fileStorage archive into two sagas to separate concerns.
fileStorage now just gives a dump of the database and explorer deals
with the user interaction and zipping.
This uses the real rootReducer to populate the initial state in the test
AsyncSaga. This way we don't have to populate default values. Since it
isn't used often, we can omit the parameter and just call the updateState()
method after creating the object if modifications are needed.
- registration is moved from top-level index to app/sagas.
- mock implementation is provided for tests
- actions are renamed to include "app" prefix
- actions are changed to not use non-serializable arguments
- reducers are changed to not use non-serializable state
This replaces the localStorage file storage with a new backend that uses
localForage (indexeddb) for storing the file contents. This will also
allow storing multiple files.
This makes use of the new web file system api for a better user
experience when saving a file. It now shows a proper save as dialog
instead of just downloading the file automatically.
Fixes: https://github.com/pybricks/support/issues/84
This adds a firmware version check that shows an error message if the
connected hub is running an older Pybricks firmware version.
Issue: https://github.com/pybricks/support/issues/482
The Pybricks firmware now includes the BLE Device Information Service
to provide firmware and Pybricks protocol versions.
For now, checking that the service is present is enough to know that the
firmware is up to date. But we will need to add additional checks as
soon as the protocol is changed.