David Lechner
a92a989ded
app: useLocalStorage
...
This simplifies the code a bit by using the useLocalStorage hook.
2022-03-14 12:55:38 -05:00
David Lechner
6c55588d7a
app: fix layout
...
The explorer was getting pushed off of the screen when typing long lines
in the editor.
2022-03-14 12:39:42 -05:00
David Lechner
c75f3720f5
editor: drop EditorContext
...
We want to rely less on directly accessing the editor object.
2022-03-12 18:29:56 -06:00
David Lechner
ceeb34436f
monaco-extension: add types for internal methods
2022-03-12 18:18:17 -06:00
David Lechner
ecbcb09846
hub/ReplButton: convert to function component
2022-03-12 16:18:38 -06:00
David Lechner
8e4045449c
src: use prop unpacking pattern
...
This makes the code a bit shorter by not having to use `props.` all of
the time. Also make everything VoidFunctionComponent while we are
touching this.
2022-03-12 16:07:31 -06:00
David Lechner
228ba4ebb8
toolbar: change button order
...
The flash and bluetooth buttons are moved to the left. This way, the
run button is closer to the text editor.
2022-03-12 15:47:47 -06:00
David Lechner
cf8438c689
toolbar: drop open and saveAs buttons
...
These have been replace by the explorer.
2022-03-12 15:45:36 -06:00
David Lechner
a2ccd3afdb
utils/react: add pointerEventsNone helper
...
This should prevent some unnecessary rerendering by not creating a new
inline object.
2022-03-12 15:26:48 -06:00
David Lechner
c51669c357
fix deps in hotkeys memos
2022-03-12 15:19:50 -06:00
David Lechner
8d4b42875a
settings: fix use of deprecated Drawer.SIZE_*
2022-03-12 15:19:50 -06:00
David Lechner
de7e046d31
avoid lambda props
...
This fixes the simple cases of callback props using lambda functions.
This will prevent rerendering in some cases since a new callback
function is not created on each call.
2022-03-12 15:19:50 -06:00
David Lechner
c229d407cf
utils/react: add preventDefault helpers
...
These can be used instead of always having to add a comment explaining
what preventDefault does in a given context.
2022-03-12 14:57:30 -06:00
David Lechner
d8f958d18e
explorer: implement file renaming
2022-03-12 14:45:06 -06:00
David Lechner
33974c52b3
fileStorage: add rename file actions
2022-03-12 14:18:02 -06:00
David Lechner
7c0de33cfc
test: drop | END
...
END already matches AnyAction so doesn't need to be explicitly added.
2022-03-11 16:11:22 -06:00
David Lechner
31fb3b9e4c
test: drop state from AsyncSaga constructor params
...
This uses the real rootReducer to populate the initial state in the test
AsyncSaga. This way we don't have to populate default values. Since it
isn't used often, we can omit the parameter and just call the updateState()
method after creating the object if modifications are needed.
2022-03-11 16:04:09 -06:00
David Lechner
7b08d8a7bf
test: drop RecursivePartial type
...
There is an existing type we can use instead.
2022-03-11 15:42:42 -06:00
David Lechner
93111b6af4
explorer: implement import action
2022-03-11 15:41:16 -06:00
David Lechner
7b095765ac
pybricksMicropython/lib: add pythonFileExtensionRegex
...
This can be reused in code to work with file names.
2022-03-11 15:41:16 -06:00
David Lechner
e36a30de4c
pybricksMicropython/lib: add module
...
This creates a new module for dealing with stuff specific to Pybricks
MicroPython.
2022-03-11 15:41:16 -06:00
David Lechner
38b9bb6656
explorer: confirm file deletion
...
Since deleting files cannot be undone, we need to be extra sure before
actually deleting the file.
2022-03-10 13:48:57 -06:00
David Lechner
a995c52e04
notifications: add helper function to simplify tests
...
This reduces duplicate code and uses more of the real implementation.
2022-03-10 13:48:11 -06:00
David Lechner
63fc715f20
fileStorage: add didDeleteFile and didFailToDeleteFile actions
...
This will allow handling errors if removing a file from storage fails.
2022-03-10 13:45:10 -06:00
David Lechner
96f0dd16fd
explorer: create new file wizard
2022-03-10 02:22:29 -06:00
David Lechner
fd120bb5a6
fileStorage: fix incorrect suggested file name
2022-03-10 02:10:34 -06:00
David Lechner
ddbf3a20f4
explorer: add more UI tests
2022-03-10 02:02:20 -06:00
David Lechner
b37209683b
test: extend testRender to return spy on dispatch
2022-03-10 02:00:14 -06:00
David Lechner
41fc961661
fileStorage: implement delete action
2022-03-10 01:02:18 -06:00
David Lechner
03d12feb89
explorer: add basic file explorer
...
This is the beginnings of a file explorer. Most actions are not yet
implemented.
2022-03-09 20:54:04 -06:00
David Lechner
6afee4b6d6
test: add testRender()
...
This adds a testRender() helper function to simplify UI tests. Instead
of mocking the redux store, we use the real thing.
2022-03-09 17:24:46 -06:00
David Lechner
d0c84cbb9f
vscode: add debug config to attach to process
...
This is useful for debugging rouge tests.
2022-03-09 17:12:53 -06:00
David Lechner
1469d2146e
app: rework service worker registration
...
- registration is moved from top-level index to app/sagas.
- mock implementation is provided for tests
- actions are renamed to include "app" prefix
- actions are changed to not use non-serializable arguments
- reducers are changed to not use non-serializable state
2022-03-09 15:48:30 -06:00
David Lechner
8b75e3f1a3
npx browserslist@latest --update-db
...
automated changes
2022-03-09 11:57:22 -06:00
David Lechner
d8da424472
contributing: update serving locally
...
The self-signed certificate didn't work with the service worker, so
drop that and use a different method instead.
2022-03-08 14:47:27 -06:00
David Lechner
907826cf0e
app: rework BeforeInstallPromptEvent
...
This removed passing the BeforeInstallPromptEvent as an action argument
(action arguments should be serializable). Instead the saga just keeps
a reference to the event and actions are used only to resolve the state
of the UI.
2022-03-08 13:37:43 -06:00
David Lechner
7884f047b5
service-worker: rename actions
...
This adds a prefix to the actions so that we won't have to use aliases.
2022-03-07 17:46:26 -06:00
David Lechner
225ae0e0f2
vscode: automate headers
...
This uses the psi-header extension to automate the creation and
maintenance of source code file headers.
2022-03-07 16:38:47 -06:00
David Lechner
32d198f8e7
craco: drop esnext rules
...
Since 08e59d2 , shopify no longer published .esnext files for webpack
so we can drop these rules. However, when we do this, there is still
another .mjs issue that needs to be worked around.
2022-03-07 10:42:18 -06:00
David Lechner
ba92aa648f
Merge remote-tracking branch 'origin/master' into HEAD
2022-03-07 10:25:16 -06:00
dependabot[bot]
08e59d2be7
build(deps): bump @shopify/react-i18n from 6.3.10 to 6.3.11
...
Bumps [@shopify/react-i18n](https://github.com/Shopify/quilt/tree/HEAD/packages/react-i18n ) from 6.3.10 to 6.3.11.
- [Release notes](https://github.com/Shopify/quilt/releases )
- [Changelog](https://github.com/Shopify/quilt/blob/main/packages/react-i18n/CHANGELOG.md )
- [Commits](https://github.com/Shopify/quilt/commits/@shopify/react-i18n@6.3.11/packages/react-i18n )
---
updated-dependencies:
- dependency-name: "@shopify/react-i18n"
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-03-07 16:17:51 +00:00
David Lechner
d767ca0784
notifications/sagas: fix rename in comment
...
This was missed when actions were refactored to remove ActionType enums.
2022-03-05 12:39:30 -06:00
dependabot[bot]
6b104f8172
build(deps-dev): bump eslint-plugin-react from 7.29.2 to 7.29.3
...
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react ) from 7.29.2 to 7.29.3.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases )
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md )
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.29.2...v7.29.3 )
---
updated-dependencies:
- dependency-name: eslint-plugin-react
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-03-04 16:15:49 +00:00
David Lechner
569217d5dc
editor: don't put editor in redux store
...
The redux store should not have non-serializable objects like the editor
in it.
2022-03-02 18:56:47 -06:00
David Lechner
fca7d0f253
vscode: debug tests through craco
...
Changing react-scripts to craco in the debug config was missed in 2342023 .
2022-03-02 15:37:41 -06:00
David Lechner
a6f427351a
Merge remote-tracking branch 'origin/master' into dlech
2022-03-02 10:34:20 -06:00
David Lechner
bc7e9e2a20
fileStorage: add archive actions
...
This allows users to back up all files to their computer.
2022-03-02 10:33:21 -06:00
dependabot[bot]
618a2f0633
build(deps): bump @types/react-redux from 7.1.22 to 7.1.23
...
Bumps [@types/react-redux](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-redux ) from 7.1.22 to 7.1.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases )
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-redux )
---
updated-dependencies:
- dependency-name: "@types/react-redux"
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-03-02 16:23:39 +00:00
David Lechner
12f34eb210
utils: add new timestamp function
...
This will be used to create suggested file names that include a timestamp.
2022-03-01 14:42:45 -06:00
David Lechner
a87e2c664c
fileStorage: add export actions
...
These are largely copied from the editor saveAs actions and allow
exporting ("downloading") a file from the browser local storage to
the file system.
2022-03-01 13:44:08 -06:00