Commit Graph
277 Commits
Author SHA1 Message Date
David Lechner 68fb7e68f2 format scss files 2021-01-27 10:25:08 -06:00
David Lechner 8d77004aed improve print margin contrast in dark mode 2021-01-26 21:33:17 -06:00
David Lechner 547dff7150 better fit of license dialog on small screens 2021-01-26 21:09:45 -06:00
David Lechner afc8e7c628 include offline copy of docs
This grabs the docs via the @pybricks/ide-docs package and copies them
to the build directory with copy-webpack-plugin.

The service worker automatically picks up these files for precache
since they go through webpack.
2021-01-25 21:05:14 -06:00
David Lechner 0acaaf0f55 fix extra pixels under icons in buttons
Since the img is in a span, it was treated as text and added 4 pixels
on the bottom for the descender height.

By using `display: block;` it won't be treated as text.

Fixes pybricks/pybricks-code#268
2021-01-25 10:39:11 -06:00
David Lechner de573407cb Fix crash when tabbing through buttons
This fixes a crash caused by react-dropzone due to the fact that button
elements aren't compatible with whatever react-dropzone is looking for.

    TypeError: rootRef.current.isEqualNode is not a function
    (anonymous function)
    node_modules/react-dropzone/dist/es/index.js:473
    470 |
    471 | var onKeyDownCb = useCallback(function (event) {
    472 |   // Ignore keyboard events bubbling up the DOM tree
    > 473 |   if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
        | ^  474 |     return;
    475 |   }
    476 |

Wrapping it in a div element solves the problem.

Also disable tabIndex on the dropzone to prevent the button from being
focused twice when tabbing through the buttons.
2021-01-24 13:31:42 -06:00
David Lechner 5614bb1747 add check command to editor
This adds a check command ala Mu editor.
2021-01-24 12:27:16 -06:00
David Lechner c209bdb1ac replace settings icon with scaled up version
This is a scaled up version of the icon from blueprintsjs.
2021-01-24 11:27:40 -06:00
David Lechner 73f155d370 add Select All to editor context menu 2021-01-24 10:56:41 -06:00
David Lechner fcb0bf3d9c add Select All to terminal context menu
The usual keyboard shortcut of Ctrl-A is not allowed since that triggers
raw REPL mode in MicroPython.
2021-01-24 10:55:00 -06:00
David Lechner 9b0427fd33 allow selecting text in dialogs and toasts
It is useful to be able to copy this info when reporting bugs.

Issue: pybricks/pybricks-support#228
2021-01-24 10:39:43 -06:00
David Lechner a9d827d21d split didRequest and didFailToRequest 2021-01-23 19:34:49 -06:00
David Lechner 2049edf874 split didSend and didFailToSend actions 2021-01-23 19:22:02 -06:00
David Lechner 683cb02b5a convert index sagas to typed-redux-saga/macro 2021-01-23 18:59:10 -06:00
David Lechner 3ba52e560d convert terminal sagas to typed-redux-saga/macro 2021-01-23 18:58:26 -06:00
David Lechner ca5bb8f2a5 convert mpy sagas to typed-redux-saga/macro 2021-01-23 18:52:43 -06:00
David Lechner 9f643f6a57 convert lwp3-bootloader-ble sagas to typed-redux-saga/macro 2021-01-23 18:51:22 -06:00
David Lechner 430643242e convert hub sagas to typed-redux-saga/macro 2021-01-23 18:47:48 -06:00
David Lechner cdea878e65 convert editor sagas to typed-redux-saga/macro 2021-01-23 18:35:44 -06:00
David Lechner 7be42b143a convert ble-uart sagas to typed-redux-saga/macro 2021-01-23 18:34:02 -06:00
David Lechner 425390ef0b convert lwp3-bootloader-protocol sagas to typed-redux-saga/macro 2021-01-23 18:30:55 -06:00
David Lechner 19d8f9ce3a convert license sagas to typed-redux-saga/macro 2021-01-23 18:26:57 -06:00
David Lechner 97a2a6671b convert error-log sagas to typed-redux-saga/macro 2021-01-23 18:25:17 -06:00
David Lechner a862800dda convert notification sagas to typed-redux-saga/macro 2021-01-23 18:24:23 -06:00
David Lechner f51a0377a9 convert settings sagas to typed-redux-saga/macro 2021-01-23 18:21:15 -06:00
David Lechner d578882031 convert app sagas to typed-redux-saga/macro 2021-01-23 18:19:15 -06:00
David Lechner 6e8629c838 ignore not-test code in coverage 2021-01-23 18:16:56 -06:00
David Lechner 467627dc75 flash-firmware: drop error on fail to connect
This error is already handled elsewhere.
2021-01-23 17:29:43 -06:00
David Lechner dcaf9f6ff4 fix checksum verification
the checksum returned by the hub is only one byte, so the 4-byte
checksum used in the firmware can't be used
2021-01-23 15:28:38 -06:00
David Lechner 5d1311216c add notifications for firmware flash errors 2021-01-23 15:27:36 -06:00
David Lechner 1a6f77ece3 remove disconnectMonitor()
This fixes multiple didFailToFinish() actions for a single flash
firmware request in certain cases.

Since 783f7e2 is fixed, waitForDidRequest() will always return with
success or error. So when used alone, waitForDidRequest() will process
the error. When using race(waitForDidRequest(), waitForResponse()),
waitForResponse() will handle the error if it wins the race and cancel
waitForResponse().
2021-01-23 13:46:54 -06:00
David Lechner 819810e52a add workaround for bluez notification issue
https://crbug.com/1170085
2021-01-23 13:36:33 -06:00
David Lechner 783f7e2337 fix write function being cancelled on disconnect 2021-01-22 20:25:01 -06:00
David Lechner bf6d64c211 fix unbound method call 2021-01-22 19:03:37 -06:00
David Lechner b5d3fe17da add proper error handling for checksum mismatch 2021-01-22 18:54:43 -06:00
David Lechner 768762347a add proper error handling for firmware flash size 2021-01-22 18:29:47 -06:00
David Lechner 4bbd1efad5 add proper error handling for init command error 2021-01-22 18:23:59 -06:00
David Lechner 3208faa7e6 add proper error handling for fail to fetch 2021-01-22 17:44:10 -06:00
David Lechner b1883a9d1c make sure we are getting coverage of checksum messages 2021-01-22 16:51:42 -06:00
David Lechner 2f5d1fb976 add another test for mismatch device type 2021-01-22 16:39:41 -06:00
David Lechner e984cffbb4 add try/catch for unexpected errors 2021-01-22 16:30:52 -06:00
David Lechner e5d98cdd84 add proper error handling for bad device id 2021-01-22 16:22:54 -06:00
David Lechner 3ec067e930 add test for unknown bootloader command 2021-01-22 16:08:13 -06:00
David Lechner 8ad2b78d4c add proper error handling for hub erase fail 2021-01-22 15:58:10 -06:00
David Lechner b58ec9a754 fix HubError type check 2021-01-22 15:58:10 -06:00
David Lechner c1c08e5ced add state initializer in async saga constructor 2021-01-22 15:58:10 -06:00
David Lechner 08fea237c9 change setState() to updateState()
this way we don't wipe out state if we change a different value
2021-01-22 15:58:10 -06:00
David Lechner 79e06bcd51 add test for response timeout 2021-01-22 15:58:10 -06:00
David Lechner 7a5e344b66 add helper function to disconnect and cancel 2021-01-22 15:58:10 -06:00
David Lechner a88fa3d425 consolidate firmware fail to start and finish
they had too much overlap
2021-01-22 15:58:10 -06:00