Commit Graph
92 Commits
Author SHA1 Message Date
David Lechner bad7f1b066 app/constants: add zip file extension and mime type 2023-03-07 14:31:12 -06:00
David 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 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 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
Laurens Valk a7a0f5221b firmware/alerts: Show correct instructions for Linux.
Also link to pybricks website for udev rules instead.
2022-12-20 12:09:04 -06:00
David Lechner 5d3c74b777 firmware/dfuWindowsDriverInstallDialog: move instructions in app
This replaces the link for Windows DFU USB driver installation
instructions with a new in-app dialog containing the instructions.

Fixes: https://github.com/pybricks/support/issues/858
2022-12-19 15:17:31 -06:00
David Lechner 9d71bb4734 eslint: enable react-hooks checks
Also fix all errors, which can lead to subtile bugs.

Mostly fixings deps and refactoring to make typescript happy.
2022-12-17 13:56:01 -06:00
David Lechner d00297f53b app: drop focus-within styling
This ended up causing dual focus rings which goes against ARIA recommendations.
2022-12-16 17:54:36 -06:00
David Lechner 2810088889 app: add empty alternate to icons in scss
We are using font icons, so we don't want screen readers to try to read
them.
2022-12-16 17:54:36 -06:00
David Lechner 9944725be6 app: use aria landmark roles
This add use of the main and complementary roles (via semantic html
elements main and aside) to make it easy for assistive technologies
to jump to the major components of the app.
2022-12-16 17:54:36 -06:00
David Lechner b7a9c20cfe app: remove use of deprecated iframe frameborder property
The recommended way to do this is to use style sheets instead.
2022-12-16 17:54:36 -06:00
Laurens Valk 8aa82eee46 firmware/bootloaderInstructions: Refactor.
- Use steps for the connection procedure
- Use categories (To do: consider making numbering consecutive)
- Show hub bootloader device name explicitly
- List official app to use for recovery (make V2/V3 explicit)
- Copy edit

Also fix the layout (class) of the installation panel to make it consistent with the style of the recovery panel.
2022-12-15 14:59:36 -06:00
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 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 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 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 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 c001ca77c1 tour: use color constants 2022-12-02 11:37:22 -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 9fe62467d5 alerts: use shorthand return 2022-11-22 15:56:56 -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 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
Laurens Valk 6ca0c49557 sponsor: Add an introduction. 2022-11-10 13:06:38 -06: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 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 6675310390 spelling 2022-10-14 16:21:18 -05:00
9994e8f4b4 build(deps): bump jest and @types/jest (#1131)
* build(deps): bump jest and @types/jest

Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) and [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest). These dependencies needed to be updated together.

Updates `jest` from 28.1.3 to 29.0.3
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.0.3/packages/jest)

Updates `@types/jest` from 28.1.8 to 29.0.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: "@types/jest"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* [dependabot skip] Fix yarn.lock

* update test snapshots for jest 29

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-fix <dependabot-fix@example.com>
Co-authored-by: David Lechner <david@pybricks.com>
2022-09-13 17:06:24 +00:00
David Lechner f24db4a89b implement cache bursting based on http header version
In 096eea7, we made use of APIs that require special http headers to be
configured on the server. This had a side effect of causing the
documentation iframe to not load because the browser would cache the
headers of the iframe index.html page.

We can work around this by providing a header version to do cache
bursting via a query parameter on this page.
2022-09-09 11:33:20 -05:00
David Lechner 5b71c7314a app/App: move firmware flash dialogs from settings
The flash firmware dialog show action can be triggered even when the
settings panel is not mounted, so we need to move the dialogs up in
the tree to the app level.

Fixes: https://github.com/pybricks/support/issues/694
2022-08-12 18:00:57 -05:00
David Lechner 90b459d5db firmware/restoreOfficialDialog: add new dialog 2022-07-27 18:17:20 -05:00
David Lechner 8bece7d957 tour: add new tour component 2022-07-27 15:19:36 -05:00
David Lechner 76444c032c firmware/installPybricksDialog: add warning for windows/linux usb
This warns the user before failure. Otherwise they will click the flash
button and no devices will appear in the scan dialog.
2022-07-27 15:19:36 -05:00
David Lechner 6d07713eb5 firmware: implement flashing via USB DFU 2022-07-21 18:36:32 -05:00
David Lechner 85deb42f76 firmware: add multi-step dialog 2022-07-20 12:32:17 -05:00
David Lechner c3fec0b779 app: drop last focused feature
This feature that keeps track of last focused item in the activities
panel broke child dialogs like the about dialog.

Fixes: https://github.com/pybricks/support/issues/682
2022-07-06 17:56:08 -05:00
David Lechner c4b0a9a781 add version to docs path
This adds the @pybricks/ide-docs package version to the static path.
This should ensure that we don't get a cached older version in the
browser when the ide-docs package is updated.
2022-07-06 14:17:53 -05:00
Bert ac86a829e7 Bump copyright year to 2022 in constants.ts (#935) 2022-06-26 09:59:57 -05:00
David Lechner a17cfbe4b8 app: use ref instead of state for last focused item
This prevents the full app from rendering when the last focused item
changes. This item doesn't have an effect on the rendered state so it
shouldn't be stored using state.
2022-06-15 12:03:29 -05:00
David Lechner 0e1a6c47a5 app: fix terminal padding for focus within outline 2022-05-18 10:57:42 -05:00
David Lechner ef7f6d15c4 improve focus styles 2022-05-16 21:59:58 -05:00
David Lechner 8ba4d49e3b components: add new component to fix a11y issues 2022-05-15 23:27:55 -05:00
David Lechner 6816795c6d activities: use blueprintjs tabs for keyboard a18y 2022-05-12 19:17:09 -05:00
David Lechner edd8ebfd64 Add Activities
This adds a new Activities tab list and view similar to VS code. The
Explorer and Settings are migrated to this view.
2022-05-12 12:33:21 -05:00
David Lechner 65623f801d update for breaking blueprintjs style changes
it is no longer feasible to build the blueprintjs css ourselves, so we
just use all of the default variable values and override things using
selectors instead.
2022-05-11 18:13:36 -05:00
David Lechner e0a6926d01 explorer: implement duplicate file feature 2022-04-08 18:11:09 -05:00
David Lechner 54a475cebc drop 'editor' saga context
This is no longer used.
2022-03-26 13:52:33 -05:00
David Lechner 79d5b06136 editor: move isReady state from app
This is a step towards getting rid of the 'editor' context.
2022-03-26 12:03:08 -05:00