Commit Graph
891 Commits
Author SHA1 Message Date
David Lechner 35cef50e44 editor: drop use of react-monaco-editor
The upstream package is currently broken and doesn't actually save us
any work.
2022-12-01 17:08:19 -06:00
David Lechner 49f3c5d8f3 components: move ViewHeightSensor
we've moved all of the other components already
2022-11-29 10:59:15 -06:00
Laurens Valk 0f02c64800 src/components: Move ClipboardIcon and ExternalLinkIcon from utils.
See https://github.com/pybricks/pybricks-code/pull/1321#pullrequestreview-1190431986
2022-11-25 13:40:44 -06:00
Laurens Valk 986cb7c184 sponsor/alerts: Add address copy notification.
Fixes https://github.com/pybricks/support/issues/806
2022-11-25 13:40:44 -06:00
Laurens Valk 96f9ce313f src/sponsor: Fix button doing nothing.
Now it copies the address to the clipboard for convenience.
2022-11-25 13:40:44 -06:00
David Lechner e01fb1fbe9 eslint: strict equality
Enforce use of ===/!== and fix existing issues.
2022-11-23 17:20:45 -06:00
David Lechner 1d9dd82191 explorer/sagas: don't show error on user cancel
fileSave can raise DomException+AbortError if use clicks cancel in the
OS file dialog. We should not show an error message in this case.
2022-11-23 17:20:45 -06:00
David Lechner d7726325ab blueprintjs-icons: fix missing large trash icon 2022-11-23 17:20:45 -06:00
David Lechner e8b57fe3d9 toolbar/ActionButton: drop aria-haspopup workaround
The fixe has been merged upstream.
2022-11-23 17:20:45 -06:00
David Lechner 9f538490e5 toolbar: remove OpenFileButton
This is no longer used.
2022-11-23 17:20:45 -06:00
David Lechner d323db4d1b toolbar/ActionButton: only disable using style
This removes use of the button disable property since it removes the
button from the accessibility tree and also makes tooltips not work.
The styling is kept the same by manually including the disable style.
2022-11-23 17:20:45 -06:00
David Lechner bb8015eae5 test: finish TODO for escape key hack
Fix was merged upstream so we can remove the hack.
2022-11-22 15:56:56 -06:00
David Lechner 9fe62467d5 alerts: use shorthand return 2022-11-22 15:56:56 -06:00
David Lechner 95199e44c1 hub/alerts/UserProgramSize: add alert for program too big
This finishes the TODO about adding a proper message.

Fixes: https://github.com/pybricks/support/issues/810
2022-11-22 15:56:56 -06:00
David Lechner db438be40b editor: finish remove hack TODO
The upstream fix was merged, so the workaround is no longer needed.
2022-11-22 15:56:56 -06:00
David Lechner 764083e6be monaco-extension: finish TODO
code was merged upstream, so we no longer need the workaround
2022-11-22 15:56:56 -06:00
David Lechner ea84c48159 service-worker: fix caching of app icons
The application icons, like favicon.ico were not being cached properly
and were missing when the app was used offline.

Changing the strategy to CacheFirst and changing the test to include
all images fixes the problem.
2022-11-19 16:58:27 -06:00
David Lechner 7850a505e4 about: fix icon not working offline
Issue: https://github.com/pybricks/pybricks-code/issues/1245
2022-11-18 19:28:00 -06:00
David Lechner b5b857bca5 firmware/sagas: implement restoring official firmware
Closes: https://github.com/pybricks/pybricks-code/issues/1104
2022-11-18 19:28:00 -06:00
David Lechner cf99ab223d firmware/sagas: refactor firmwareFlashUsbDfu
This allows the firmwareFlashUsbDfu to take an arbitrary binary blob
instead of a Pybricks firmware.zip file. This will allow it to be used
to restore the official LEGO firmware as well.
2022-11-18 19:28:00 -06:00
David Lechner 71c8605773 firmware/restoreOfficialDialog: change to multistep dialog
This gives instructions on how to put the hub in bootloader mode like
the install Pybricks dialog and sets the stage for doing the DFU restore
without going to another website.

Issue: https://github.com/pybricks/pybricks-code/issues/1104
2022-11-18 19:28:00 -06:00
David Lechner 44169bd178 firmware/bootloaderInstructions: extract component
This extracts the instructions for placing a hub in bootloader mode to
a separate component so that it can be shared.
2022-11-18 19:28:00 -06:00
David Lechner f167f168ee fix missing icons
Warning sign was missed in 90b04f8. 20px error and info are added just
in case.
2022-11-18 19:28:00 -06:00
David Lechner 745d09df7a constants: add LEGO registered trademark
This shouldn't be translated so we make a constant to ensure that. Also
makes it easy to get the registered trademark symbol which isn't
trivial to type on the keyboard.
2022-11-18 19:28:00 -06:00
David Lechner 597419be47 ble/alerts/BluetoothNotAvailable: add browser support paragraph
Browsers such as Brave and Opera are based on Chromium but disable
Web Bluetooth. In this case, we can't tell the difference between the
browser not supporting it or the Bluetooth adapter not being present.
So we make the error message cover all possibilities.

Issue: https://github.com/pybricks/support/discussions/804
Issue: https://github.com/pybricks/support/issues/635
2022-11-18 19:28:00 -06:00
David Lechner d48734b513 ble-pybricks-service/protocol: add CommandType.ResetInUpdateMode 2022-11-18 19:28:00 -06:00
David Lechner 6f91c57743 firmware/sagas: add delay after connecting
This adds a delay after connecting to a hub when flashing firmware via
BLE before sending any commands. This gives the OS Bluetooth stack time
to finish enumerating the Bluetooth device before we start trying to
interact with the device. Hopefully this fixes issues for some people
who are seeing problems while flashing firmware.

Issue: https://github.com/orgs/pybricks/discussions/792
2022-11-11 13:00:40 -06:00
David Lechner b2e098f2dd app: catch error when checking for updates
ServiceWorkerRegistration.update() can raise exceptions, so we need to
catch and handle them, otherwise it will crash redux sagas and the app
will stop responding.

Fixes: https://github.com/pybricks/pybricks-code/issues/1299
2022-11-11 13:00:40 -06:00
David Lechner 992923bf15 SponsorDialog: make team link inline
Also buttons cannot be inside of `<p>` tags.
2022-11-10 13:47:16 -06:00
David Lechner 3e50e58206 mpy/sagas: use "new" webpack asset URL
Jest added support for wasm imports which broke our tests. In the mean
time, Webpack 5 added a new asset inclusion mechanism that can work
around this and removes the need for our existing webpack workaround.
2022-11-10 13:47:16 -06:00
Laurens Valk 6ca0c49557 sponsor: Add an introduction. 2022-11-10 13:06:38 -06:00
Laurens Valk 4e64347870 sponsor: Add Paypal link.
Provide some more convenience options.

Also add an ENS domain while we are at it.
2022-11-10 13:06:38 -06:00
David Lechner 072358036a explorer/newFileWizard: update layout
- move switch under template title
- add description text
- style changes
2022-11-08 13:56:38 -06:00
Laurens Valk 68810f071a explorer/newFileWizard: Invert template inclusion UI.
Instead of having the option to delete the template after selecting it, it is more intuitive to have a toggle for including it.
2022-11-08 13:56:38 -06:00
David Lechner e2f448c12b index: make checked:disabled radio buttons appear unchecked 2022-11-08 13:56:38 -06:00
David Lechner 3974613738 activities: fix not scrolling on overflow
This adds css needed to make the activities tab view contents scroll
appropriately when the contents don't fit vertically.

Fixes: https://github.com/pybricks/support/issues/782
2022-11-08 13:56:38 -06:00
David Lechner d8b8672793 pybricksMicropython/python-worker: consolidate loadPackage
The pyodide.loadPackage() method can take an array arg, so we don't
have to call it multiple times.
2022-11-08 13:56:38 -06:00
David Lechner cb5101282b firmware/sagas: fix checksum validation
The checksum can be 0, so we can't be lazy and use `!checksum` to test
for undefined.

Issue: https://github.com/pybricks/support/issues/724#issuecomment-1295929316
2022-10-29 14:05:31 -05:00
David Lechner 2d9a0ca39e terminal: focus when repl is requested 2022-10-28 18:01:39 -05:00
David Lechner 03f6c004db sponsor: add new button and dialog
Issue: https://github.com/pybricks/support/issues/719
2022-10-28 18:01:39 -05:00
David Lechner ede6f80f49 explorer/newFileWizard: add empty file option
Fixes: https://github.com/pybricks/pybricks-code/issues/771
2022-10-28 18:01:39 -05:00
David Lechner 7810a8ee87 components/hubPicker: use images instead of text 2022-10-28 18:01:39 -05:00
David Lechner 90b04f85b3 webpack: add hack to remove unused icons
This follows the suggestions from [1] to reduce the package size by
only including the icons we are actually using. This gets the main
module small enough to avoid the CRA "The bundle size is significantly
larger than recommended." warning (gzipped size is < 512KB).

[1]: https://github.com/palantir/blueprint/issues/2193
2022-10-27 13:17:51 -05:00
David Lechner 694b064683 remove unnecessary {} 2022-10-27 13:17:51 -05:00
David Lechner 0725203d66 app: lazy-load terminal
This changes the terminal sagas and components to be lazy loaded to
improve time until first render.
2022-10-27 13:17:51 -05:00
David Lechner c49f37f5e4 editor: lazy load
This makes the required changes needed to make the editor components
and sagas lazy-load to improve the time before the first render of the
app.

This is done by making sure we only import types from the monaco editor
module anywhere other than the saga and the component modules and using
React.lazy to lazy-load the component and start the sagas.

This cuts the main bundle time to less than 1/2 so load time should be
over twice as fast now.
2022-10-27 13:17:51 -05:00
David Lechner 0f56bb7174 app/actions: drop didStart
This action is no longer used.
2022-10-27 13:17:51 -05:00
David Lechner 509c635a07 ble/sagas: add workaround for BlueZ quirk
The 'gattserverdisconnected' event is called before the device is
actually disconnected, so if the user tries to connect again
immediately, the web browser will show a still "paired" device, but
selecting this devices results in an infinite wait. This is a bug in
Chromium, but we can work around it by adding a delay to give BlueZ
time to actually disconnect the device.

Closes: https://github.com/pybricks/support/issues/600
2022-10-26 16:20:08 -05:00
David Lechner 57c87da464 editor: disable word-based suggestions
This turns off the default word-based suggestions. This was useful when
we didn't have proper code completion but now can be distracting.

Fixes: https://github.com/pybricks/support/issues/757
2022-10-25 13:48:02 -05:00
David Lechner e41a297922 editor: close tab on middle-click
Fixes: https://github.com/pybricks/support/issues/758
2022-10-25 12:57:07 -05:00