Commit Graph
100 Commits
Author SHA1 Message Date
David Lechner 2edfc7e127 v2.2.0-beta.4 2023-05-16 15:51:28 -05:00
David Lechner 945657d465 update pybricks packages
new firmware + api and docs
2023-05-16 15:49:20 -05:00
David LechnerandDavid Lechner b4db152fca index.scss: change info toast color
The adjusted color made it look like the toast was disabled. Having
buttons the same color as the toast is a bit weird but consistent
with the Blueprintjs style for toasts.
2023-05-15 16:33:47 -05:00
David LechnerandDavid Lechner 4c272d132d yarn: update memfs version
The webpack dev server was crashing in this module. Updating seems to
fix the issue.
2023-05-15 16:33:47 -05:00
David LechnerandDavid Lechner 6d844b78e3 ble-pybricks-service/protocol: add UserProgramMultiMpy6Native6p1
This adds a new flag from Pybricks Profile v1.3.0 for documentation
purposes. We currently don't support native modules in Pybricks Code
so we aren't using this for now.
2023-05-01 12:54:57 -05:00
David LechnerandDavid Lechner e4b6ea0960 editor: don't paste on middle click to close tab
To avoid the Linux feature of pasting on middle click, we need to
consume the mouse up event in the browser on middle click instead of
mouse down.

This also sets the `selectionClipboard` editor option to false which
should disable the feature altogether in the monaco editor but the
setting seems to be broken in the browser[1].

[1]: https://github.com/microsoft/vscode/issues/181050

Fixes: https://github.com/pybricks/support/issues/1046
2023-04-27 12:12:08 -05:00
David LechnerandDavid Lechner be7112c123 hub/sagas: fix not dispatching 100% progress
We were calling the action creator without actually dispatching the
action.

Fixes: https://github.com/pybricks/support/issues/1044
2023-04-25 12:02:30 -05:00
David LechnerandDavid Lechner 1219a377d4 ble/sagas: show alert when Pybricks Profile is newer
If the user sideloads a firmware that has communication features that
are newer than what is supported by the app, then show a warning message.
2023-04-24 17:38:53 -05:00
David LechnerandDavid Lechner 618f7840da always use * as for semver imports
The imported names are very short, so it is helpful to always include
semver.
2023-04-24 17:38:53 -05:00
David LechnerandGitHub 924cfff539 Merge pull request #1709 from pybricks/dlech
v2.2.0-beta.3
2023-04-24 12:40:43 -05:00
David Lechner 56aab66047 CHANGELOG: fix link 2023-04-24 12:08:33 -05:00
David Lechner e3cfe856b9 index.scss: use pybricks blue for info toasts
This makes toasts fit better in the color scheme.
2023-04-24 11:18:13 -05:00
David Lechner 8ac59f3d8d v2.2.0-beta.3 2023-04-24 11:18:03 -05:00
David LechnerandDavid Lechner 0a33c6a24b CHANGELOG: fix copy/pasted firmware version 2023-04-21 16:59:51 -05:00
David LechnerandDavid Lechner 62c4ba013c update to Pybricks firmware v3.3.0b4 2023-04-21 16:59:51 -05:00
David LechnerandDavid Lechner 02a0d974f3 hub/sagas: don't stop user program after connect
Since we now have periodic status messages, we don't need to do anything
to get into a known state.

This caused unexpected behavior when connecting to a hub that is already
connected in a second window.
2023-04-19 13:03:48 -05:00
David LechnerandDavid Lechner 337209744c add support for Pybricks Profile v1.3.0 2023-04-19 13:03:48 -05:00
David LechnerandDavid Lechner 63a1026dae ble-pybricks-service: document @since 2023-04-19 13:03:48 -05:00
David LechnerandDavid Lechner 17ab06d32d hub/reducers: additional coverage 2023-04-19 13:03:48 -05:00
David LechnerandDavid Lechner c8002c743a hub/reducers: fix older firmware mpy version heuristics 2023-04-19 13:03:48 -05:00
David LechnerandDavid Lechner a28ea572ae status-bar: fix height styling
Since this is display: flex, it needs min/max-height instead of plain
height.
2023-04-05 19:27:48 -05:00
David LechnerandDavid Lechner 1e764b4e95 ble/sagas: spawn ble writes
Code depends on always receiving a didWrite/didFailToWrite, however
when a hub disconnected, these tasks were being cancelled. Spawning
protects them from cancellation.
2023-04-01 15:17:22 -05:00
David LechnerandDavid Lechner c8e7e86da0 toolbar/buttons/bluetooth: show progress on disconnect 2023-04-01 13:52:03 -05:00
David LechnerandDavid Lechner 379965e48f toolbar/buttons: debounce short progress
Don't flash progress for short actions like starting repl and stopping
user program. If the hub becomes disconnected, these actions can take
a long time before failing and in that case, we do want to show the
progress indicator.
2023-04-01 13:38:19 -05:00
David LechnerandDavid Lechner 3baaff5b61 ble/sagas: avoid Linux 5 second disconnect when possible
If the user did not request disconnection, then we know this is a true
disconnect event and not an early one so we don't need the delay hack
in that case.

Issue: https://github.com/pybricks/support/issues/600
Issue: https://github.com/pybricks/support/issues/1021
2023-04-01 13:38:19 -05:00
David LechnerandDavid Lechner 73248fe6aa hub/reducers: simplify Disconnected state logic
Reduce duplicate code by only checking for current state == Disconnected
once.
2023-04-01 13:38:19 -05:00
David LechnerandDavid Lechner 69605ada4a hub/reducers: consolidate command in progress states
The Loaded state is not used anywhere else, so we can replace it with
the Unknown state. Then we can make all other command-in-progress
states (start repl/stop user program) the same as download and run.
When the command completes, the hub is in an unknown state until a
status message is received. The Disconnected states overrides all other
states.
2023-04-01 13:38:19 -05:00
David LechnerandDavid Lechner ce29984be5 hub/sagas: show error if stopping failed
- Finish TODO to show error if stopping fails.
- Make button busy in case waiting for failure takes a long time.
2023-04-01 13:38:19 -05:00
David LechnerandDavid Lechner be3afa167a hub/sagas: fix error message not shown when starting repl
- Add check for repl start command success/fail.
- Show error message on fail.
- Rename start repl action.
- Add new did start/did fail to start repl actions.
- Change terminal saga to use did start repl action to focus terminal.
- Add more tests.
2023-04-01 13:38:19 -05:00
David LechnerandDavid Lechner 70020275a7 ble/alerts/Disconnected: better error message for disconnected
WebBluetooth generally uses DomException with name NetworkError to mean
that Bluetooth is disconnected, so we can use that to provide a helpful
error message.
2023-04-01 13:38:19 -05:00
David LechnerandDavid Lechner 19f6862bb5 hub/reducers: change hub runtime state when disconnecting
When disconnect is requested, we should not longer allow interacting
with the hub, so we say the runtime state is unknown until it is
confirmed to be disconnected.

Fixes: https://github.com/pybricks/support/issues/1021
2023-04-01 13:38:19 -05:00
David LechnerandGitHub 93cce0352f Merge pull request #1650 from pybricks/dlech
v2.2.0-beta.2
2023-03-31 13:37:18 -05:00
David Lechner 91b82ab737 v2.2.0-beta.2 2023-03-31 13:19:36 -05:00
David LechnerandDavid Lechner 7cd986dbd8 Pybricks firmware v3.3.0b3 2023-03-28 10:44:23 -05:00
David LechnerandDavid Lechner be32c37f18 editor/sagas: focus editor when activated
When a file is activated, it is an indication that the user wants to
edit the file right now, so the editor should be focused.
2023-03-28 10:44:23 -05:00
David LechnerandDavid Lechner 38dc8d984d tool-versions: update to node 18
Node 16 reaches end of life in about 6 months so we might as well
update to 18 now since it seems to be working.
2023-03-10 18:16:27 -06:00
David LechnerandDavid Lechner 2f5d11b648 LicenseDialog: fix console errors in tests
useFetch() was trying to actually fetch the license file and mocking
fetch() caused errors about not wrapping code in act(). So instead,
we can avoid all errors by just mocking useFetch() instead.
2023-03-10 18:16:27 -06:00
David LechnerandDavid Lechner 3114ac4e2b mpy/sagas: fix tests attempting to load .wasm via http
Since we are using jsdom, the emscripten generated code doesn't use
the node filesystem lookup for .wasm files. But then it falls back to
node for file:// urls, but this doesn't work because node treats file:
as a drive letter.

We can work around this by modifying the node path.normalize() function
to return the correct path.

Fixes: https://github.com/pybricks/pybricks-code/issues/1584
2023-03-10 18:16:27 -06:00
David LechnerandDavid Lechner d88ce8998f test: wrap all user calls in act()
Some user events trigger react dom changes. These need to be wrapped in
act() to avoid a warning printed to the console. To be save, we wrap
all instances.
2023-03-10 18:16:27 -06:00
David LechnerandDavid Lechner 78290eb927 github/workflows: update to actions/setup-node@v3
This fixes deprecation warnings about v2 using node 12.
2023-03-10 18:16:27 -06:00
David LechnerandGitHub 6e313c39f1 Merge pull request #1577 from pybricks/dlech
v2.2.0-beta.1
2023-03-08 18:28:31 -06:00
David Lechner 77ba67a38e v2.2.0-beta.1 2023-03-08 18:12:51 -06:00
David Lechner 7d3c77664c fix vertical button margin in dialogs 2023-03-08 18:06:49 -06:00
David Lechner eee8bff17b update Pybricks firmware to v3.3.0b2 2023-03-08 17:49:20 -06:00
David LechnerandDavid Lechner af160c99a8 more code coverage 2023-03-08 15:07:16 -06:00
David LechnerandDavid Lechner 6a9405e653 explorer: add support for importing ZIP
Also add a new dialog to get user input when file names conflict.

Previously, we were not supplying a list of existing files, so existing
files were silently written over.

Fixes: https://github.com/pybricks/support/issues/833
2023-03-07 14:31:12 -06:00
David LechnerandDavid Lechner d9e8a794d0 package.json: patch jsdom to get SubmitEvent
Backport [1] to jsdom 20.

[1]: https://github.com/jsdom/jsdom/pull/3481
2023-03-07 14:31:12 -06:00
David LechnerandDavid Lechner 68d7932ef9 NewFileWizard: fix setUseTemplate casing 2023-03-07 14:31:12 -06:00
David LechnerandDavid Lechner bad7f1b066 app/constants: add zip file extension and mime type 2023-03-07 14:31:12 -06:00
David LechnerandDavid Lechner ea1b377247 github: update more actions versions
fixes deprecation warnings
2023-02-17 16:29:45 -06:00
David LechnerandGitHub 155361727b Merge pull request #1527 from pybricks/dlech
v2.1.1
2023-02-17 16:22:07 -06:00
David Lechner c2d4974a0e v2.1.1 2023-02-17 16:00:55 -06:00
David Lechner 41763c2f9f package.json: update Pybricks firmware to v3.2.3 2023-02-17 15:59:54 -06:00
David LechnerandDavid Lechner 2777b61023 yarn dedupe 2023-02-17 11:52:19 -06:00
David LechnerandDavid Lechner 2d777e0dc4 github: update actions versions
- fixes deprecation warnings
- fixes codecov upload failures
2023-02-17 11:20:21 -06:00
David LechnerandDavid Lechner ac00b82cab firmware/installPybricksDialog: fix hub name error icon style 2023-02-16 14:10:07 -06:00
David LechnerandDavid Lechner 63597e4b88 firmware/installPybricksDialog: only call useFirmware() once
We were unpacking the firmware twice. Instead, we should only call
useFirmware() once and pass the results as props.
2023-02-16 14:10:07 -06:00
David LechnerandDavid Lechner a841562c6c firmware/installPybricksDialog: remove hard-coded hub name size check
The UI has been rearranged so we now have firmware metadata available
when we validate the hub name.
2023-02-16 14:10:07 -06:00
David LechnerandDavid Lechner 13c69918e1 firmware/installPybricksDialog: add basic metadata check
This will catch some errors. Mainly this is to ensure we show an error
if someone tries to use, e.g. a NXT firmware file that isn't supported
in Pybricks Code yet. Error message isn't great but we don't expect this
to be hit often, if ever, by non-developers.
2023-02-16 14:10:07 -06:00
David LechnerandDavid Lechner c8bcddbffd firmware/installPybricksDialog: fix use of useCustomFirmware()
useCustomFirmware() was called multiple times with the same file which
resulted in the same file being parsed 3 times. Instead we should only
call useCustomFirmware() and pass the results as props instead.
2023-02-16 14:10:07 -06:00
David LechnerandDavid Lechner 0d3447a0b6 editor: show error message on fail to activate
When gotoError fails to activate a file, we need to show an error
message, otherwise it just appears to the user that the button is
broken.

Fixes: https://github.com/pybricks/support/issues/924
2023-02-13 16:13:58 -06:00
David LechnerandDavid Lechner 876f1f2118 toolbar/ActionButton: drop workaround for https://github.com/palantir/blueprint/issues/5889
This was fixed in @blueprintjs/popover2 v1.12.1
2023-02-01 11:05:43 -06:00
David LechnerandGitHub 0db20ce894 Merge pull request #1425 from pybricks/dlech
v2.1.0
2023-01-06 15:59:33 -06:00
David Lechner 4551280544 v2.1.0 2023-01-06 15:49:03 -06:00
David Lechner 7a052b6595 LICENSE: update copyright year 2023-01-06 15:47:52 -06:00
David Lechner b24bd6a03b package: update firmware to v3.2.2 2023-01-06 15:45:47 -06:00
David LechnerandDavid Lechner 5330821a96 pybricksMicropython: use new PythonError type property
This was introduced in Pyodide 0.22 and saves us from having to parse
the message for the type.

Could also affect https://github.com/pybricks/support/issues/772 (but
there is no known reproducible case to check it).
2023-01-04 11:20:52 -06:00
David LechnerandGitHub b18bb5e18a Merge pull request #1414 from pybricks/dlech
v2.1.0-beta.4
2022-12-30 16:21:46 -06:00
David Lechner 2de7803c77 v2.1.0-beta.4 2022-12-30 16:10:49 -06:00
David Lechner 62d7fdff36 editor/sagas: disable code completion trigger on space
This gets in the way when typing comments and often results in
accepting a completion that was not intended.

Fixes: https://github.com/pybricks/support/issues/894
2022-12-30 16:07:52 -06:00
David Lechner 7d5c9710e5 editor/sagas: fix signature trigger characters
The intended behavior is that comma should trigger signature help when
it is not showing. retrigger only triggers if already showing.
2022-12-30 16:04:48 -06:00
David LechnerandDavid Lechner d119cb564e editor: fix find widget z-index
When open, the find widget was visible above modal dialogs because
of z-index.
2022-12-30 14:08:36 -06:00
David LechnerandDavid Lechner ca50d60b2c app: fix vertical resizing issues
Some new issues with layout when resizing the browser window vertically
were caused either by recent xterm updates or other recent style changes.

This works around those issues.
2022-12-30 14:08:36 -06:00
David LechnerandGitHub 594bd0495c Merge pull request #1412 from pybricks/dlech
2.1.0-beta.3
2022-12-28 17:34:34 -06:00
David Lechner 810ee362c6 editor/sagas: maintain jedi sort order
Now that jedi returns names that start with `_`, we need to make sure
they don't end up at the top of the list for completions.
2022-12-28 17:23:59 -06:00
David Lechner dfe1d3b721 v2.1.0-beta.3 2022-12-28 17:07:29 -06:00
David Lechner e153ffe295 pybricksMicropython: fix import completion for user module
The pybricks_jedi package was filtering on only pybricks modules but
now has a feature to amend the filter to include user modules.

Fixes: https://github.com/pybricks/support/issues/759
2022-12-28 17:04:23 -06:00
David Lechner a981bcbda2 editor/pybricksMicroPython: fix numeric literal highlighting
This was picking up leading underscores, e.g. the first `__` in
`__name__`.
2022-12-28 16:40:43 -06:00
David Lechner 2f14fde584 package: update @pybricks/jedi to v1.7.0 2022-12-28 16:20:03 -06:00
David LechnerandDavid Lechner 74f1619eb3 app: fix clipping of editor popups
Editor popups like the ones for code completion were getting clipped
by the layout pane containers.
2022-12-27 17:35:11 -06:00
David LechnerandDavid Lechner 1482e9f197 editor/pybricksMicroPython: add constant formatting 2022-12-27 17:35:11 -06:00
David LechnerandDavid Lechner 098c8e60ab editor/pybricksMicroPython: add Side to hub template
This is included in pybricks.parameters on all hubs.
2022-12-27 17:35:11 -06:00
David LechnerandDavid Lechner 43a6f63eaf editor/pybricksMicroPython: improve f-string highlighting
Fixes: https://github.com/pybricks/support/issues/875
2022-12-27 17:35:11 -06:00
David LechnerandDavid Lechner 5bef7e2637 editor/pybricksMicroPython: improve operator highlighting
This handles newer things like the := operator better.
2022-12-27 17:35:11 -06:00
David LechnerandDavid Lechner 1db0c48844 editor/pybricksMicroPython: improve numeric literal highlighting
- Drop Python 2.x "L" suffix.
- Add support for underscores.
- Drop including leading minus sign.
- Add support for binary.
- Add support for octal.
2022-12-27 17:35:11 -06:00
David LechnerandGitHub 8dd0cb8c54 Merge pull request #1408 from pybricks/dlech
v2.1.0-beta.2
2022-12-26 09:49:26 -06:00
David Lechner e5154013c3 v2.1.0-beta.2 2022-12-26 09:39:06 -06:00
David Lechner 212a3c85ff package.json: update @pybricks/firmware@6.6.0 2022-12-26 09:36:24 -06:00
David LechnerandGitHub 578a6afeab Merge pull request #1406 from pybricks/dlech
v2.1.0-beta.1
2022-12-23 11:10:32 -06:00
David Lechner 90b7c2256e v2.1.0-beta.1 2022-12-23 10:54:04 -06:00
David LechnerandDavid Lechner d5bcb8c758 package: bump @pybricks/python-program-analysis to v2.0.0
This includes fixes for parsing additional Python syntax features
added since Python 3.4 that are implemented by MicroPython.
2022-12-22 18:01:27 -06:00
David LechnerandDavid Lechner bb2fa3ae1d package: switch to @pybricks/python-program-analysis
The package we were using was only for Python 3.4 and didn't include
async/await which broke imports in any script that used async/await.

Fixes: https://github.com/pybricks/support/issues/873
2022-12-22 13:21:02 -06:00
David LechnerandDavid Lechner a77acc1001 firmware/bootloaderInstructions: hide video from tests
The video element makes a bunch of noise (console.error) in tests.
2022-12-22 13:21:02 -06:00
David LechnerandDavid Lechner f083ad84ef pybricksMicropython/lib: log parser errors
This makes it easier for users to diagnose errors.

Issue: https://github.com/pybricks/support/issues/873
2022-12-22 13:21:02 -06:00
David LechnerandDavid Lechner 48b99cb3a5 public/manifest: change display to "standalone"
"fullscreen" is for immersive apps like games (and is only available
on Android currently which is why we didn't notice the app going
fullscreen on desktop).

Fixes: https://github.com/pybricks/support/issues/867
2022-12-21 20:27:21 -06:00
David LechnerandDavid Lechner b255a145e3 components/ViewHeightSensor: remove view height sensor
This appears to no longer be necessary for correct app height on Android.
2022-12-21 19:44:11 -06:00
David LechnerandDavid Lechner 27b8b1e428 editor: fix iOS keyboard button position 2022-12-21 19:44:11 -06:00
David LechnerandDavid Lechner fc695b5b88 package: update xterm to v5.1.0
This updates xterm and the fit addon. (the dependabot update for v5.1.0
alone broke scrolling but it seems to be fixed with the fit addon update).
2022-12-21 16:28:17 -06:00
David LechnerandDavid Lechner 64b6251c1a terminal: add audio/visual feedback when no user program
Characters typed into the terminal are only sent to the hub when a user
program is running. This provides audio and visual feedback to indicate
to the user that keystrokes have no effect when the user program is not
running.
2022-12-21 16:28:17 -06:00
David LechnerandDavid Lechner 808e6c0e85 firmware/bootloaderInstructions: use ol count attribute
Using styles for changing list starting numbers doesn't have good
cross-browser support. We can set the start count using the start
attribute of the ol element instead.

Issue: https://github.com/pybricks/support/issues/868
2022-12-21 16:28:17 -06:00