Commit Graph
53 Commits
Author SHA1 Message Date
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 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 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 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 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 0715ce3de1 drop settingsToggleShowDocs
We can change the event handler in App.tsx do we no longer need the
settingsToggleShowDocs action or related sagas.
2022-03-25 18:05:03 -05:00
David Lechner f36e774d1e coverage: ignore useI18n 2022-03-25 15:54:04 -05:00
David Lechner 5dd61fa4c3 toolbar/buttons: consolidate buttons 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 c3c9a8fd7c improve dialog accessability 2022-03-17 11:08:31 -05:00
David Lechner 46faff981d toolbar: add label to buttons
This improves accessability by letting us get buttons by the label.
2022-03-16 15:24:48 -05:00
David Lechner f17e32af61 settings/SettingsDrawer: work around tooltip bug 2022-03-16 13:07:10 -05:00
David Lechner cb3f22fc9b settings/SettingsDrawer: do not focus hub name label 2022-03-15 21:49:34 -05:00
David Lechner a4660e979c settings: switch to useTernaryDarkMode
useDarkMode kept reverting back to the system default during development
2022-03-15 17:40:46 -05:00
David Lechner 7726dbe01d settings: convert hubName to react hook 2022-03-15 17:25:20 -05:00
David Lechner 861ea34d86 settings: convert flashCurrentProgram to react hook 2022-03-15 16:54:49 -05:00
David Lechner d18ad41e39 settings: add about dialog button test 2022-03-15 15:53:03 -05:00
David Lechner 6cfc37b947 settings: use react hook for showDocs setting
The moves the setting from redux state to a react hook.
2022-03-15 15:35:45 -05:00
David Lechner 9518a21241 settings: replace darkMode with useDarkMode hook
This is a minor breaking change for users that don't have dark mode
set to the default value since the localStorage key has changed (hard-
coded in 3rd party library).
2022-03-14 16:39:17 -05: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 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 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 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 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 9641898a75 actions: refactor actions
The pattern we were using for actions required actions to be defined in
three places, an enum member containing the type string, an type
definition and a function. This combines all three of these into one by
using a helper function based on the ideas from [1].

[1]: https://phryneas.de/redux-typescript-no-discriminating-union
2022-02-25 17:58:30 -06:00
David Lechner cf8744a6cd actions: drop typed dispatch
This doesn't provide much benefit and is just one more rule to remember,
so we can do without it.
2022-02-24 17:16:52 -06:00
David Lechner 54ec447061 actions: added typed useDispatch() hook 2021-12-27 18:01:51 -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 9be6ba3640 update to Tooltip2
Tooltip has been deprecated so trying out the new Tooltip2.
2021-12-27 12:38:50 -06:00
David Lechner e8a3026c43 settings: convert SettingsButton to function 2021-12-27 12:36:38 -06:00
David Lechner a1db455a66 settings: convert SettingsDrawer to function
This reduces boilerplate code.
2021-12-27 12:36:38 -06:00
David Lechner 97c5a3bfb8 settings: add hub name tooltip 2021-11-19 20:48:06 -06:00
David Lechner 86c0e933f3 settings: add new hubName setting
This setting will be used to customize the hub name when flashing
firmware. This commit just implements the setting.

Some changes needed to be made to the existing settings infrastructure
since previously it only allowed boolean settings.
2021-11-19 20:48:06 -06:00
David Lechner e7d44ea9a9 src/utils: add ensureError() function
Typescript v4.4 no longer assumes that the error in catch is an Error
object [1]. This adds a helper function to ensure that caught errors
at least match the Error interface. If not, it creates a new Error
object with the value as the message.

[1]: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta/#using-unknown-in-catch-variables
2021-08-30 13:06:01 -05:00
David Lechner 6c692a7e95 fix wrapping on external link buttons 2021-06-08 14:52:44 -05: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 ad6e2b73cc make settings open/close local 2021-02-01 10:26:05 -06:00
David Lechner dd951bd4fc make about dialog open/close local 2021-02-01 10:26:05 -06:00
David Lechner e5073399a0 drop explicit state interfaces
This could cause subtle bugs like the one fixed here where license
was renamed to licenses.
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
David Lechner 0333fa51c0 add developer settings with pseudolocalization
This is currently broken due to https://github.com/Shopify/quilt/pull/1725
2021-01-21 12:37:29 -06:00
Laurens Valk 8246bad1e8 add link to example projects 2021-01-18 15:10:02 +01:00
David Lechner b15d00f797 add help links 2021-01-15 16:07:11 -06:00
David Lechner dcb432583c add basic about dialog 2021-01-15 12:51:52 -06:00
David Lechner f54beab97f use consistent tooltip delay 2021-01-15 11:08:04 -06:00