David Lechner
d6df128860
i18n: use automatic type inference of translation keys
...
Finally figured out a way to make typescript strongly type translation
keys so we can avoid the tedium of creating enums of translation keys.
2022-07-22 13:48:50 -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
883807b4b4
fix breaking changes for user-event v14
2022-06-02 18:45:28 -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
5dc6b2e4cb
util: drop preventBrowserNativeContextMenu
...
This is done once at the top-level app, so is no longer needed.
2022-05-12 19:20:46 -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
f36e774d1e
coverage: ignore useI18n
2022-03-25 15:54:04 -05:00
David Lechner
9f254f035f
i18n: use babel-loader plugin
2022-03-25 15:54:04 -05:00
David Lechner
675d01013d
utils/react: drop preventFocusOnClick
...
We can fix this better with css tweaks.
2022-03-15 21:39:24 -05: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
b37209683b
test: extend testRender to return spy on dispatch
2022-03-10 02:00:14 -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
a0da9f7111
Improve code coverage
2022-02-22 12:32:20 -06:00
David Lechner
b3ed75f02b
status-bar: add titles
...
This adds titles to interactive elements. This causes a small (browser-
native) tooltip to display when hovering.
2022-02-22 12:32:20 -06:00
David Lechner
8d26f768bf
reducers: use typed useSelector hook
...
This refactors the code to use a typed useSelector() hook.
2021-12-27 17:48:41 -06:00
David Lechner
42051ba924
status-bar: add basic battery indicator
...
This adds a basic battery indicator that just shows green for OK and red
for low battery warning. This is all we can do for now since that is
the only information that the hub sends currently.
Fixes: https://github.com/pybricks/support/issues/559
2021-12-27 17:05:40 -06:00
David Lechner
8d4680ba82
status-bar: add connected hub indicator
...
This adds an indicator to the status bar that shows the hub name. When
clicked, a popover will be displayed that lists more detailed information
about the connected hub.
2021-12-27 13:04:13 -06:00
David Lechner
5d201e61ae
status-bar: convert StatusBar to function
2021-12-27 12:38:50 -06:00
David Lechner
ec6753c314
yarn lint
...
rules seem to have changed a bit after upgrading packages
2021-05-11 12:45:43 -05:00
David Lechner
af964c04b4
use fake redux store in component tests
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
334668bdfb
rework mobile view height
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