I meant to change this before merging the previous commit, but missed it.
The mismatch test was hard to understand and didn't increase coverage,
so let's leave it out.
Enable the stream option on the text decode for the stdout and uart
stream handlers that pipe data to the terminal. This fixes improperly
printing multibyte unicode characters that get split across multiple
data packets.
A new decode is added for each different stream in case both are used
at the same time.
Fixes: https://github.com/pybricks/support/issues/1743
Mac users have recently been reporting failed firmware updates due to
the hub disconnecting during the update process. This is likely due to
the Mac sending packets faster than the hub can handle. This changes
the arbitrary BLE firmware burst size from 10 to 8 to reduce the chance
of the hub getting overwhelmed.
Fixes: https://github.com/pybricks/support/issues/1787
For some reason, two is now using the last item in the svg group for
centering, which was one of the eyes. The changes the order so that the
body is not the last item and centering works again.
Dialogs were off of the screen due to the overlays being bigger than
the view port. This is fixed by adding some style to limit the size.
Also multi-step dialogs are hard-coded to have min-width of 800px in
blueprints.js, so we need to override this on smaller screens.
Fixes: https://github.com/pybricks/support/issues/1271
This avoids trying to perform two DFU operations on the same device
at one time. Flashing is so fast, this seems the better option than
trying to support flashing more than one device at a time.
Fixes: https://github.com/pybricks/support/issues/1146
This was overlooked when we updated to React 18. This fixes console
error about using React 17 behavior.
StrictMode had to be disabled because it broke the editor.
Since updating to Blueprintjs 5.x we can get aliasing artifacts on the
cursor due to bad rendering of box-shadow. This overrides it with
border instead.
https://github.com/xtermjs/xterm.js/issues/4580
Since we share the same editor instance with multiple models, we need
to ensure undo stack consistency when changing the model, otherwise
we can lose some history, e.g. if a not active model is modified.
When we import/replace a file that is open in an editor, instead of
modifying the file in storage, we need to modify the file in the editor.
This allows the modification to be pushed on the undo stack so that
the user can undo the change in case it wrote over any of their recent
changes.
Issue: https://github.com/pybricks/support/issues/975
After updating to @types/node 18.x, we started getting an error when
mocking FileWithHandle. For some reason, the type hints don't allow
for partial implementation anymore.
Hack around the problem by just casting the partial implementation.
The adjusted color made it look like the toast was disabled. Having
buttons the same color as the toast is a bit weird but consistent
with the Blueprintjs style for toasts.
This adds a new flag from Pybricks Profile v1.3.0 for documentation
purposes. We currently don't support native modules in Pybricks Code
so we aren't using this for now.
To avoid the Linux feature of pasting on middle click, we need to
consume the mouse up event in the browser on middle click instead of
mouse down.
This also sets the `selectionClipboard` editor option to false which
should disable the feature altogether in the monaco editor but the
setting seems to be broken in the browser[1].
[1]: https://github.com/microsoft/vscode/issues/181050
Fixes: https://github.com/pybricks/support/issues/1046
Since we now have periodic status messages, we don't need to do anything
to get into a known state.
This caused unexpected behavior when connecting to a hub that is already
connected in a second window.
Code depends on always receiving a didWrite/didFailToWrite, however
when a hub disconnected, these tasks were being cancelled. Spawning
protects them from cancellation.
Don't flash progress for short actions like starting repl and stopping
user program. If the hub becomes disconnected, these actions can take
a long time before failing and in that case, we do want to show the
progress indicator.
The Loaded state is not used anywhere else, so we can replace it with
the Unknown state. Then we can make all other command-in-progress
states (start repl/stop user program) the same as download and run.
When the command completes, the hub is in an unknown state until a
status message is received. The Disconnected states overrides all other
states.
- Add check for repl start command success/fail.
- Show error message on fail.
- Rename start repl action.
- Add new did start/did fail to start repl actions.
- Change terminal saga to use did start repl action to focus terminal.
- Add more tests.
WebBluetooth generally uses DomException with name NetworkError to mean
that Bluetooth is disconnected, so we can use that to provide a helpful
error message.
When disconnect is requested, we should not longer allow interacting
with the hub, so we say the runtime state is unknown until it is
confirmed to be disconnected.
Fixes: https://github.com/pybricks/support/issues/1021
useFetch() was trying to actually fetch the license file and mocking
fetch() caused errors about not wrapping code in act(). So instead,
we can avoid all errors by just mocking useFetch() instead.
Since we are using jsdom, the emscripten generated code doesn't use
the node filesystem lookup for .wasm files. But then it falls back to
node for file:// urls, but this doesn't work because node treats file:
as a drive letter.
We can work around this by modifying the node path.normalize() function
to return the correct path.
Fixes: https://github.com/pybricks/pybricks-code/issues/1584
Some user events trigger react dom changes. These need to be wrapped in
act() to avoid a warning printed to the console. To be save, we wrap
all instances.
Also add a new dialog to get user input when file names conflict.
Previously, we were not supplying a list of existing files, so existing
files were silently written over.
Fixes: https://github.com/pybricks/support/issues/833