Commit Graph
159 Commits
Author SHA1 Message Date
David Lechner ae996453e8 drop polyfill for chromimum < v85
This removes the polyfill for using older chrome browsers before the
writeWithResponse and writeWithoutResponse APIs were added.
2020-12-21 13:05:47 -06:00
David Lechner 223947a16e Merge branch 'master' into dlech 2020-12-18 14:17:37 -06:00
David Lechner 32f2120ec6 fix timeout when firmware size is 10x packet size
When the firmware blob is exactly a multiple of 10 times the packet
size, the last checksum request causes the reply to the last program
request to be missed (there is only a response from the hub to the very
last program request). The program response is received, then the
checksum response is received. Since the saga is waiting for the
checksum response first, the program response is discarded.

Fix by breaking out of the loop when the firmware has been fully
transferred before making the checksum request.

Fixes: pybricks/support#178
2020-12-18 14:09:54 -06:00
Andreas Litt de237b13f9 remove stickiness of toolbar to avoid breaking the layout
clicking on a link with a URI fragment (e.g. https://docs.pybricks.com/en/latest/parameters.html#pybricks.parameters.Port)
inside the documentation iframe breaks the layout.
The browser seems to force the parent frame to scroll to the position as well.
As the toolbar is fixed, the rest of the content is scrolled under it.
Rerendering after the link click fixes the layout (at least if done manually).
But a more elegant solutions is to remove the absolute positioning of the toolbar.
It is not really necessary to pin it, as the rest of the layout always
spans over the complete width and height of the browser window.
2020-12-13 21:58:08 +01:00
David Lechner 0cf3aad910 Add keyboard shortcuts to action buttons
Just run and stop button have keys assigned for now.
2020-12-10 21:37:21 -06:00
David Lechner 113243828f add snippets for primehub and inventor hub 2020-12-10 16:59:37 -06:00
David Lechner 98feab2555 All CTRL+V in terminal
Fixes https://github.com/pybricks/support/issues/172
2020-12-10 16:28:43 -06:00
David Lechner 91fbea13f4 fix terminal losing focus after opening context menu
Fixes https://github.com/pybricks/support/issues/170
2020-12-10 15:14:39 -06:00
David Lechner 6852d56316 fix service worker after update to create-react-app 4
https://github.com/facebook/create-react-app/issues/9776
2020-11-20 22:11:07 -06:00
David Lechner 4ee50072a0 Update firmware to v3.0.0a11
Also take advantage of new helper functions in firmware package.
2020-11-20 21:08:53 -06:00
David Lechner 71ad9c1b1b Update to create-react-app 4
- had to update eslint deps
- ran into https://github.com/palantir/blueprint/issues/4112
- had to move beta.svg out of static/
- had to fix prettier formatting changes
- ran into https://github.com/facebook/jest/issues/7780
2020-11-20 21:08:53 -06:00
Laurens Valk 5561de530b Rename CPlusHub to TechnicHub 2020-10-09 20:26:52 -05:00
David Lechner 68021545c5 Add Clear command to terminal context menu
Fixes pybricks/support#103
2020-07-17 20:40:00 -05:00
David Lechner 5c3727b3ce Update @types/web-bluetooth
Now includes writeValueWithResponse and writeValueWithoutResponse
2020-07-15 13:17:40 -05:00
David Lechner 6d998b9736 remove encoding snippets 2020-07-15 13:01:56 -05:00
David Lechner a1d5fd531a fix indentation of cityhub snippet 2020-07-15 13:01:56 -05:00
David Lechner 441d517a52 Rework web assembly inclusion
This moves the .wasm file out of the static/js/ folder and into the
source tree. This way we can import it and webpack will pick it up
and version the file with a hash.

This fixes possibly running with an out of date file from the browser
cache and also fixes running offline.

The file extension had to be changed because there is a default rule in
webpack that matches the .wasm extension and causes the following error:

    Failed to compile.

    ./src/sagas/mpy-cross.wasm
    Module parse failed: magic header not detected
    File was processed with these loaders:
    * ./node_modules/file-loader/dist/cjs.js
    You may need an additional loader to handle the result of these loaders.
    Error: magic header not detected

The webpack configuration cannot be modified without ejecting
create-react-app or using something like react-app-rewired, which we
would like to avoid.

Also using ncp to copy file now which fixes building on Windows.
2020-07-03 20:29:19 -05:00
David Lechner 9cfc7c5bd1 wait for feedback more often during flashing
There have been some reports of firmware flashing not working with a
checksum timeout error, meaning that we probably overflowed a buffer
on the Bluetooth chip from sending data too fast.

We don't have info of the Bluetooth firmware so we are just guessing
here.
2020-07-02 21:37:00 -05:00
David Lechner 0944a27eb9 increase firmware flashing packet size 2020-07-02 21:37:00 -05:00
David Lechner c3037a56e6 Clarify city hub error message
It is only the bootloader/flashing firmware that is not compatible. It
can still be used with older browsers after Pybricks firmware has been
flashed.
2020-07-02 21:37:00 -05:00
David Lechner 7b49d84876 add code snippet for city hub 2020-07-02 21:37:00 -05:00
David Lechner 78b17df163 add city hub to firmware flasher 2020-07-02 21:37:00 -05:00
Laurens Valk e9783ff821 tweak beta watermark 2020-06-16 09:39:09 +02:00
David Lechner 2fdcea091e add beta watermark 2020-06-16 09:39:09 +02:00
David Lechner b3d2d94b78 update link for more info when app is updated
For now this is just linking to a github issue until we get a proper
changelog.
2020-06-15 14:53:16 -05:00
David Lechner 30db09daf5 enable code snippets in auto completion 2020-06-15 14:53:16 -05:00
David Lechner 33b80fe2c8 re-enable service worker
Password has been turned off on the website, so we can enable this again.
2020-06-15 11:51:49 -05:00
David Lechner 087fb43b35 check for missing files in firmware.zip
Found by https://github.com/pybricks/pybricks-code/pull/98/checks?check_run_id=772712591
2020-06-15 08:34:07 -05:00
Laurens Valk 44607ca410 images: add support and pybricks docs buttons 2020-06-13 16:38:22 +02:00
Laurens Valk cab8b66117 images: remove local references 2020-06-13 16:38:22 +02:00
David Lechner 37a3967f3a fix race condition when flashing firmware
On Windows, we can get the GATT notification from the bootloader before
Windows says we are done writing to the characteristic. This was
observed on the erase and checksum messages with the Control+ hub.
2020-06-13 00:41:31 -05:00
David Lechner e0e2d98cd0 rename translation files
This fixes case-insensitive file name conflicts, e.g. editor.ts Editor.ts
2020-06-13 00:00:42 -05:00
David Lechner 712117c8d8 convert lwp3-bootloader from a service to a saga
For some reason this significantly improved bluetooth performance so we
had to readjust the frequency of getting the checksum. The new value
actually makes much more sense. It is unlikely that the bootloader
actually had an 8k buffer.
2020-06-12 21:46:00 -05:00
David Lechner 3f80374215 use new app startup action in terminal sagas 2020-06-12 21:46:00 -05:00
David Lechner 72a90df92a implement context menu in terminal 2020-06-12 21:46:00 -05:00
David Lechner 084fc4b599 implement CTRL+SHIFT+C to copy from terminal 2020-06-12 21:46:00 -05:00
David Lechner 9e0a567172 fix unused state props type 2020-06-12 21:46:00 -05:00
David Lechner 7a4c05a89a add support button 2020-06-12 21:46:00 -05:00
David Lechner 6e23262f06 fix spelling of firmware 2020-06-12 21:46:00 -05:00
David Lechner 95a98241e8 simplify editor getter 2020-06-12 21:46:00 -05:00
David Lechner dd146b5f36 fix binding of editor reference
This was causing resizing of the editor to not work properly
2020-06-12 21:46:00 -05:00
David Lechner 1e0ef476ef Add docs toggle button 2020-06-12 21:46:00 -05:00
David Lechner bda007c17a convert ble service to saga 2020-06-11 22:53:38 -05:00
David Lechner f3425e2f0f rename BLEData to BleUart
These actions all relate specifically to the nRF UART GATT service
2020-06-11 22:53:38 -05:00
David Lechner 802f2bc05d use type = instead of interface extends
for consistency
2020-06-11 22:53:38 -05:00
David Lechner 7509c329d6 fix editor scroll bar on first load
It seems that some container of the Editor component is breaking the
resize calculation when the page firsts loads. So we have to be bit
hacky and defer the call the resize until after all components have
been rendered.
2020-06-11 10:06:16 -05:00
David Lechner ba14910dae move ble epic to terminal saga
this is the last epic so removing redux-observable as well
2020-06-10 21:59:34 -05:00
David Lechner 34184785c8 convert hub service and epic to saga 2020-06-10 21:59:34 -05:00
David Lechner 367d8a6178 remove buffers.expanding()
according to the docs, this is the default
2020-06-10 21:59:34 -05:00
David Lechner 61a5eb6039 add xor8 checksum
we are starting with 0xff like all known LEGO checksums of this style.
2020-06-10 21:59:34 -05:00