Commit Graph
332 Commits
Author SHA1 Message Date
David Lechner 605a910746 Fix failing download and run
The firmware was changed to send status updates at a regular interval
which caused the hub state to change back to idle prematurely during
download and run. This caused any program more than one or two lines
long to fail.

Issue: https://github.com/pybricks/support/issues/290
2021-04-06 13:48:38 -05:00
David Lechner 76a5f8fe26 drop HubRuntimeStatusType Idle and Running
These are no longer used
2021-04-06 13:42:26 -05:00
David Lechner 829e47c75a Wrap long lines in compiler error
This way we don't overflow the toast.
2021-04-01 14:24:31 -05:00
David Lechner 09ba8bb035 Increase toast max-width
This makes it big enough to fit the compiler error message

    IndentationError: unindent doesn't match any outer indent level

If we still have problems with overflow we should probably look at
ways to wrap <pre> text instead of making this wider.
2021-04-01 14:13:25 -05:00
David Lechner 55e724e8d8 Allow splitting long notifications
This adds the ability to split notification messages in to multiple paragraphs.
2021-04-01 13:58:01 -05:00
David Lechner ca1ec0a64e Add Device Information Service support
The Pybricks firmware now includes the BLE Device Information Service
to provide firmware and Pybricks protocol versions.

For now, checking that the service is present is enough to know that the
firmware is up to date. But we will need to add additional checks as
soon as the protocol is changed.
2021-04-01 13:29:10 -05:00
David Lechner 64c75640ba ble-pybricks-service: add some tests 2021-03-12 08:54:20 -06:00
David Lechner 56829a502c ble-pybricks-service/sagas: fix filtering of command send completions
Since didSend and didFailToSend are part of the same enum as the command
send actions types, we have to filter them out when subscribing to the
send actions.
2021-03-10 11:19:06 -06:00
David Lechner 684df491e0 ble-uart/sagas: use array to managed forked tasks
This simplifies keeping track of which tasks need to be canceled in the
error paths.
2021-03-10 11:00:54 -06:00
David Lechner 4b3a6fea5e hub: fix missed notification when connecting
This fixes the first notification being missed due to the notification
handler not being started until after notifications are enabled.

It also fixes the DidConnect action changing the state to Unknown after
a notification was received that set the state to a known value.
2021-03-10 10:30:15 -06:00
David Lechner 430147487e implement Pybricks service stop command 2021-03-10 10:30:15 -06:00
David Lechner 61c34fc4b1 implement BLE Pybricks service status notifications
This is the beginning of the BLE Pybricks service implementation, so
changes are made to get a handle to the Pybricks control characteristic
and enable notifications.

Currently, only one event (the status report event) and no commands are
implemented on this characteristic.

The new status report event replaces monitoring the UART for >>>>
strings to get the current hub state.

Also includes some minor cleanup in the ble-uart/actions for consistency.
2021-03-10 10:30:15 -06:00
David Lechner cdd74706c5 toolbar is not a navbar
This adds custom styling for the toolbar (inspired by blueprintsjs
navbar). But this lets us use the correct role and not fight the
navbar styling so much.
2021-02-01 13:02:07 -06:00
David Lechner 1e5d25086b move app version to constants 2021-02-01 13:02:06 -06:00
David Lechner a8b3f5dcf7 use env for app name 2021-02-01 13:02:06 -06:00
David Lechner 9005e909ba refactor common context menu code 2021-02-01 10:26:06 -06:00
David Lechner 714cf8b8cb remove use of ContextMenuTarget from Terminal 2021-02-01 10:26:06 -06:00
David Lechner af964c04b4 use fake redux store in component tests 2021-02-01 10:26:06 -06:00
David Lechner 4b6817d9ad drop use of decorator for editor context menu 2021-02-01 10:26:06 -06:00
David Lechner 6ccb77a5ad add test for snippets 2021-02-01 10:26:06 -06:00
David Lechner 4c5adc20e7 add tests for AboutDialog 2021-02-01 10:26:06 -06:00
David Lechner 36596e9a00 add tests for StatusBar 2021-02-01 10:26:06 -06:00
David Lechner 2955fe1f24 add tests for lwp3-bootloader reducers 2021-02-01 10:26:06 -06:00
David Lechner 922dee31c2 add tests for licenses reducers 2021-02-01 10:26:05 -06:00
David Lechner b7061f63b4 add tests for firmware reducers 2021-02-01 10:26:05 -06:00
David Lechner 6ed5dca8ce add tests for editor reducers 2021-02-01 10:26:05 -06:00
David Lechner bf2bb5e81d add a failed to disconnect action 2021-02-01 10:26:05 -06:00
David Lechner d3e67950a6 add tests for ble reducers 2021-02-01 10:26:05 -06:00
David Lechner ad6e2b73cc make settings open/close local 2021-02-01 10:26:05 -06:00
David Lechner dd951bd4fc make about dialog open/close local 2021-02-01 10:26:05 -06:00
David Lechner 89523b3915 make license dialog state local 2021-02-01 10:26:05 -06:00
David Lechner e5073399a0 drop explicit state interfaces
This could cause subtle bugs like the one fixed here where license
was renamed to licenses.
2021-02-01 10:26:05 -06:00
David Lechner 650888bbf7 add app reducer tests 2021-02-01 10:26:05 -06:00
David Lechner 37b5ebd8f7 app pb-app- prefix to terminal-padding class 2021-02-01 10:26:05 -06:00
David Lechner 334668bdfb rework mobile view height 2021-02-01 10:26:05 -06:00
David Lechner 3c152a48ea remove extraneous console.log() 2021-02-01 10:26:05 -06:00
David Lechner a24c263789 move terminal dataSource to context
state should only hold serializeable data
2021-02-01 10:26:05 -06:00
David Lechner 0c20e52a45 don't allow optional args in actions
This can lead to subtle bugs.

Fixes firmware flash button not working.
2021-02-01 10:26:05 -06:00
David Lechner 6f204a65f6 reorganize src/ directory
Makes for much less scrolling/jumping around.

https://redux.js.org/style-guide/style-guide#structure-files-as-feature-folders-or-ducks
2021-02-01 10:26:05 -06:00
David Lechner b30c31f8b7 use shorthand form to map dispatches
https://redux.js.org/style-guide/style-guide#use-the-object-shorthand-form-of-mapdispatch-with-connect
2021-02-01 10:26:05 -06:00
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