Commit Graph
763 Commits
Author SHA1 Message Date
David Lechner 4fcb82e361 bootloaderInstructions: add recovery variant
For official firmware recovery, we have separate videos for non-USB
hubs.

Closes: https://github.com/pybricks/support/issues/728
2022-12-09 15:02:15 -06:00
David Lechner 0f871c6b2c bootloaderInstructions: add videos
This adds videos to show how to enter bootloader mode.

Issue: https://github.com/pybricks/support/issues/728
2022-12-09 13:24:00 -06:00
David Lechner e12c86781a toolbar: don't wrap buttons
We can have better control over the layout and avoid wrapping by using flex.

Fixes: https://github.com/pybricks/support/issues/841
2022-12-08 17:10:47 -06:00
David Lechner bef91f948f app: fix resize handle visible through activity pane 2022-12-08 17:10:47 -06:00
David Lechner 936e142429 app: remember docs page on refresh
This persists the current docs page so that it is used on page reload
of the app. This is mostly useful for development since users should
not be refreshing the page.

It also remembers the selected page between sessions, so new windows
will open to the previous page.

Checks are added to default back to the docs index page in case the
"remembered" page is no longer valid.
2022-12-08 17:10:47 -06:00
David Lechner 74d8a258fb service-worker: don't serve index.html for static
This fixes issues where the index.html page can be served if we have
something that requests a static resource that does not exist. In the
worst case, this would the app appear recursively in the docs pane.

Also remove some unnecessary typing while we are touching this.
2022-12-08 17:10:47 -06:00
David Lechner cf74dc26ce app: bump copyright year displayed in app
We are a bit early but since will will do a final release soon, we
don't want the app to look out of date already on the first of the
year.
2022-12-08 17:10:47 -06:00
David Lechner 614e0b0074 firmware: remove android check for chunk size
This should no longer be needed since Chrome v98 (released Nov. 2021).
2022-12-08 17:10:47 -06:00
David Lechner cc20ab8c35 editor: move docs toggle from settings
This removes the docs toggle switch from the settings and adds a new
docs toggle button to the editor.

Fixes: https://github.com/pybricks/support/issues/778
2022-12-06 15:38:58 -06:00
David Lechner 55cf05d480 app: add drag handles to resizable separators
This makes them easier to discover and an easier target for touch.
2022-12-06 15:38:58 -06:00
David Lechner 05445c1b07 settings: use sessionStorage for doc state
This adds use of sessionStorage for the documentation visibility toggle.
This way, when multiple windows are open, the docs can be controlled
separately in each window. Local storage is still used as the default
value for new windows.

Issue: https://github.com/pybricks/support/issues/807
2022-12-06 15:38:58 -06:00
David Lechner ee850dec71 activities: use sessionStorage for selected tab
The useLocalStorage hook synchronizes state between windows. In the
case of the activities tabs, we don't want this state synchronized,
otherwise changing a tab in one window would change the tab in all
open windows.

Instead, we can use sessionStorage so that the state persists when
refreshing or duplicating a browser tab. Local storage is still used
as the default value so that any new window that is opened will use
the last selected state.

Issue: https://github.com/pybricks/support/issues/807
2022-12-06 15:38:58 -06:00
David Lechner 27b2c42023 tour: open settings when triggered from startup
Since we moved the first tour step to a possibly hidden place, we need
to make sure it is showing before starting the tour.

Fixes: https://github.com/pybricks/support/issues/823
2022-12-05 13:17:37 -06:00
David Lechner a262f44762 explorer: fix focus outline obscured 2022-12-02 11:37:22 -06:00
David Lechner c001ca77c1 tour: use color constants 2022-12-02 11:37:22 -06:00
Laurens Valk 65e5e6af08 editor/welcome: Stop on click.
Don't reset the position.
2022-12-02 09:20:08 +01:00
Laurens Valk 545cf786af settings: Move Welcome Tour to Help. 2022-12-02 09:20:08 +01:00
David Lechner 99760146a6 tour: move button to settings
Since we have the Pybricks logo elsewhere now, we don't need to have
this button on the toolbar. Instead, put it in the settings where it
is out of the way, but can still be used to watch the tour again if
desired.

Some steps are reordered so we don't jump back and forth between
activities since we are starting from the settings tab now.

Also fix changing the selected activities tab when closing the tour.
2022-12-01 17:08:19 -06:00
David Lechner 86a26d07ca StatusBar: always use dark mode styling
Since the background doesn't change, we shouldn't change the foreground
either. White shows up better than black on the blue, so we prefer the
dark mode styling.
2022-12-01 17:08:19 -06:00
David Lechner 6a979cafa8 editor: add pybricks logo welcome 2022-12-01 17:08:19 -06:00
David Lechner a0f05c00a4 react-aria: drop typing workaround
This was fixed upstream.
2022-12-01 17:08:19 -06:00
David Lechner 3a0130d73f editor: fix spinner jumping to top on page load 2022-12-01 17:08:19 -06:00
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