Commit Graph
292 Commits
Author SHA1 Message Date
David Lechner 435e367cca add ready for offline message 2021-01-28 21:01:42 -06:00
David Lechner 8b3606c397 fix check for update button not showing
this happened when the app starts when it is already up to date
2021-01-28 20:37:51 -06:00
David Lechner 252c741180 add app install button 2021-01-28 20:21:20 -06:00
David Lechner e59bfd4474 add UI to manually check for update
This adds a button to call the ServiceWorkerRegistration.update()
function. This button will be hidden if there is already an update
pending.

This also adds a button to restart the app to apply the update. This
is nice in case users accidentally close the notification that asks
to restart.

The about button is moved to the new app group in the setting menu.
2021-01-28 15:37:40 -06:00
David Lechner 447e7e901b pass registration to reload action 2021-01-28 14:00:09 -06:00
David Lechner 066a6c7d3d move scrollbar styling to @pybricks/ide-docs
This makes the scrollbar flashing less noticeable, but there is still
a bit of a flash in dark mode due to the fact that we are still
injecting the class in the load event in that case.
2021-01-28 12:45:17 -06:00
David Lechner 952416f36b apply scroll bar styling to docs iframe 2021-01-27 19:14:15 -06:00
David Lechner eb2cf3c956 add global keyboard shortcut for toggling docs
This handles the cases when the editor is not active and the docs pane
is not active and the terminal is not active.
2021-01-27 16:33:03 -06:00
David Lechner 1d7414bd83 add Ctrl-D keyboard shortcut in docs iframe
This way it still works when the docs are focused. Otherwise the browser
would try to bookmark the page.
2021-01-27 16:02:37 -06:00
David Lechner ca8192084d restore docs position after hide/show
Previously, the docs iframe was removed from the DOM when the docs
were hidden. This caused the docs to always go back to the main page
when shown.

This fixes it by using CSS to hide the docs instead of removing them
from the DOM. However, this comes with its own complications regarding
maintaining the scroll position.
2021-01-27 15:38:51 -06:00
David Lechner 64e6b3739e add keyboard shortcut to toggle docs
this is useful for users with small screens
2021-01-27 11:48:51 -06:00
David Lechner 4f00c962e1 finish TODO for checking bluetooth availability 2021-01-27 10:25:08 -06:00
David Lechner 45ac41b398 use ~ in scss imports
this allows proper click-link to files in node_modules
2021-01-27 10:25:08 -06:00
David Lechner eebeec509c don't focus buttons on click
This prevents the navbar buttons from gaining focus when clicked.
This way it prevents losing focus from the editor or terminal.
It also prevents the settings button from being highlighted after
the settings menu is closed.
2021-01-27 10:25:08 -06:00
David Lechner c7803fed19 fix wrong event type on switch
Fixes:

    index.js:1 Warning: Failed prop type: You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.
2021-01-27 10:25:08 -06:00
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