Commit Graph
595 Commits
Author SHA1 Message Date
Bert ac86a829e7 Bump copyright year to 2022 in constants.ts (#935) 2022-06-26 09:59:57 -05:00
David Lechner 096eea7077 editor: add basic intellisense
This adds basic intellisense for code completion and function signatures
using the Python `jedi` package running in a Pyodide environment.
2022-06-24 19:15:32 -05:00
David Lechner 2686e0e5d3 use redux toolkit
Using redux directly has been deprecated. Using redux toolkit offers
some more safety checks (and could potientially replace some use of
sagas).
2022-06-15 12:03:29 -05:00
David Lechner c2e38664dc index: fix missing HotkeysProvider 2022-06-15 12:03:29 -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 b6525ea95e activities: don't render hidden activity panels
This improves performance by not rendering hidden tabs.
2022-06-15 12:03:29 -05:00
David Lechner a835934028 explorer: render file toolbar on hover
This improves performance by only rendering the toolbar for each file
when it is actually shown.
2022-06-15 12:03:29 -05:00
David Lechner d891d349f6 licenses: convert tree to list
This migrates the list of packages from using react-complex-tree to
react-aria since it is a list rather than a tree.
2022-06-15 12:03:29 -05:00
David Lechner fc6d20f5e3 fix breaking change in react-complex-tree 2022-06-03 12:08:23 -05:00
David Lechner 48bd65c5b8 fix breaking changes for typescript 4.7 2022-06-03 11:32:36 -05:00
David Lechner 883807b4b4 fix breaking changes for user-event v14 2022-06-02 18:45:28 -05:00
dependabot[bot]andDavid Lechner 0149842803 build(deps): bump react-dropzone from 12.0.4 to 14.2.1 (#843)
* build(deps): bump react-dropzone from 12.0.4 to 14.2.1

Bumps [react-dropzone](https://github.com/react-dropzone/react-dropzone) from 12.0.4 to 14.2.1.
- [Release notes](https://github.com/react-dropzone/react-dropzone/releases)
- [Commits](https://github.com/react-dropzone/react-dropzone/compare/v12.0.4...v14.2.1)

---
updated-dependencies:
- dependency-name: react-dropzone
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* toolbar: update for breaking changes in ReactDropZone

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Lechner <david@pybricks.com>
2022-06-02 19:58:06 +00:00
David Lechner 1403dbb2f5 fix codeql recommendations
https://github.com/pybricks/pybricks-code/pull/823/checks?check_run_id=6695406302
2022-06-01 13:27:32 -05:00
David Lechner c26a83f126 explorer/fileNameFormGroup: add "fix it" button
This adds a button on some errors to automatically fix the error.
2022-06-01 12:54:51 -05:00
David Lechner 41e826d73b editor: save view state on change
Instead of trying to save the view state when a window "closes", which
is unreliable, we just save the state on every change.
2022-05-31 17:43:54 -05:00
David Lechner 818865462e editor: handle files by uuid
This changes things up a bit so that files are handled by uuid instead
of path. The allows for files to be renamed without breaking things.

Also some improvements with persistence of the view state for each
file is made.
2022-05-31 17:21:29 -05:00
David Lechner 012d6b029e explorer: fix toolbar buttons wrapping
This fixes the toolbar buttons wrapping when the text overflows.
2022-05-31 12:51:55 -05:00
David Lechner 56e1505f14 Revert "explorer: drop rename feature"
This reverts commit 30741b13ef.
2022-05-30 11:26:35 -05:00
David Lechner e300aa7d64 explorer: explain how to fix error 2022-05-30 11:03:26 -05:00
David Lechner d42b72f1a3 explorer: fix text input not getting focus when clicked
All user controls should stop propagation of events that are handled.
2022-05-30 11:01:29 -05:00
David Lechner 69ca51fbbb explorer: fix broken layout
Applying this control tweak globally broke the explorer layout. So we
now apply it to settings only.
2022-05-30 10:15:10 -05:00
David Lechner 0a89198f5c activities: fix potential control overflow 2022-05-21 14:16:55 -05:00
David Lechner a3e55c828a move useI18n to i18n.ts
Since we are using the react-i18n babel loader plugin, useI18n can only
be used once per file. Also we have to remember to add the istanbul
ignore next comment each time we use it. By moving this to a common
file, it can be easily copied and pasted when a new submodule is
created and we don't have to remember the rules when calling it.
2022-05-21 13:57:58 -05:00
David Lechner e7366c8afd rework alerts
This starts moving alerts to the same subsystem where they are relevant
instead of putting everything in notifications.

So far, only the explorer file in use error is handled like this.
2022-05-20 19:25:18 -05:00
David Lechner 4e88605b16 utils/customError: narrow type of name property
The name property is inherited from Error and has a type of string.
But our CustomError ensures that the name is restricted to the type
of T. This causes compiler errors, so we had to enable a babel plugin
to support it.
2022-05-20 16:46:17 -05:00
David Lechner 348d6e90d9 add CustomError class
This will be used for throwing errors that can be caught and handled without having to parse the message.
2022-05-20 11:13:55 -05:00
David Lechner 8b6939a983 utils: extract acquireLock function from fileStorage 2022-05-19 12:03:10 -05:00
David Lechner 3dc03f3879 editor: save file to correct path
previously, all files were being saved as main.py
2022-05-19 10:44:31 -05:00
David Lechner 057ba4bab9 spelling 2022-05-18 18:21:01 -05:00
David Lechner d02e38795b editor/sagas: fix error creating model on hot reload 2022-05-18 17:47:29 -05:00
David Lechner 325562996b replace useUniqueId() with useId()
there should only be one way to do a thing...
2022-05-18 17:16:32 -05:00
David Lechner a005992a21 fileStorage: use dexie-react-hooks
This lets the dexie-react-hooks library do more of the work for us
instead of having to make redux-sagas wrappers for everything.
2022-05-18 17:06:08 -05:00
David Lechner 4580869e6f editor: don't keep file open when editing
Since open takes a lock on the file, it prevented other file operations.
2022-05-18 13:11:06 -05:00
David Lechner c4c8da967c components/toolbar: types is a types-only file 2022-05-18 11:15:50 -05:00
David Lechner 76475cc79b fix lint errors 2022-05-18 11:12:52 -05:00
David Lechner 133b52029f automatic formatting 2022-05-18 11:11:50 -05:00
David Lechner 0e1a6c47a5 app: fix terminal padding for focus within outline 2022-05-18 10:57:42 -05:00
David Lechner 4384f80f9b terminal: move handleKeyDown inside of useEffect()
This will avoid extra renders triggered by a new handleKeyDown function.
2022-05-18 10:26:48 -05:00
David Lechner df6e93407e terminal: remove questionable tabindex
Not sure if this has a purpose I don't know about but removing it gives
better behavior when using keyboard navigation.
2022-05-18 10:13:31 -05:00
David Lechner 0839392183 rework roving tab index to use react-aria 2022-05-17 23:20:09 -05:00
David Lechner f7dcf8b0f7 components/toolbar: move from utils
This is a better home.
2022-05-17 11:28:21 -05:00
David Lechner ef7f6d15c4 improve focus styles 2022-05-16 21:59:58 -05:00
David Lechner 9e092ca469 explorer: fix tree item button translations not updating 2022-05-16 01:11:10 -05:00
David Lechner 8ba4d49e3b components: add new component to fix a11y issues 2022-05-15 23:27:55 -05:00
David Lechner 728e7c3b26 settings: change tooltips to help buttons
This is more friendly for touch screen users.
2022-05-14 11:09:41 -05:00
David Lechner fb681e06ec explorer/fileNameFormGroup: hide tag
screen readers don't need to read the file extension tag
2022-05-13 23:52:21 -05:00
David Lechner 404818bcdf toolbar: use roving focus 2022-05-13 23:28:12 -05:00
David Lechner f0dcb281de utils: add Toolbar component
This adds a generic toolbar component that follow aria guidelines.
2022-05-13 22:36:01 -05:00
David Lechner a185457067 explorer: don't disable archive button
disabled buttons are bad for accessability
2022-05-13 16:48:32 -05:00
David Lechner dc2daf2fe4 toolbar: hide icons from a11y tools
There are already ARIA labels, so the icons should be hidden.
2022-05-13 14:44:26 -05:00