Commit Graph

2474 Commits

Author SHA1 Message Date
Gergely Nagy
b5f15ba9b6 components/Toast: When display an error, strongly suggest reporting it
When Toast displays an error notification, display a "Report the problem" button
alongside it, which navigates to the "Report a problem" screen upon click.

Fixes #1024.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-31 14:15:47 +02:00
Jesse Vincent
aa3c15b70c Merge pull request #1028 from keyboardio/keymapdb/with-modifiers-fix
api/focus/keymap: withModifiers() should not apply mods to non-standard keys
2022-07-30 14:41:41 -04:00
Gergely Nagy
f1e916e67f api/focus/keymap: withModifiers() should not apply mods to non-standard keys
Originally, `withModifiers()` was only called internally by the keymap db, so it
could safely assume that the list of keys it receives will fall within the
standard HID range, and can have modifiers applied safely.

However, with 62f6ba5034, that is no longer the
case, and `withModifiers()` will be called with a keylist that can potentially
include already augmented keys.

It should only augment keycodes in the base HID range, and if it encounters a
keycode in the source list that is an augmented key, that should be ignored in
favour of the newly augmented ones.

Fixes #1026.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 20:24:30 +02:00
Jesse Vincent
caa6e939dc Merge pull request #1025 from keyboardio/diet
Reduce the packaged size of Chrysalis
2022-07-30 13:24:15 -04:00
Gergely Nagy
15eeff1b58 Move xml2js to devDependencies as well
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:39:22 +02:00
Gergely Nagy
da18eb96bd Move unraw to devDependencies
It is only used during the build, to generate the CLDR data, no reason to
include it among the runtime dependencies.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:29:19 +02:00
Gergely Nagy
9a520ec55f Drop the react-localization dependency
We're using react-18next, rather than react-localization. Drop the latter, since
it is unused.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:24:54 +02:00
Gergely Nagy
29222b32c1 package.json: Only include the dfu-util binaries for the current platform
There's no need to include `dfu-util` for every platform in a platform-specific
build, so include only those that match the platform. If the platform has
multiple architectures, we'll include `dfu-util` for all of them, in every build
for the platform.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:17:10 +02:00
Gergely Nagy
05c60df247 Do not include static/cldr in packaged builds
We only use `static/cldr` during the build, to pregenerate CLDR data. Do not
include it in packaged builds.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 13:04:30 +02:00
Gergely Nagy
c981d7fd29 Move cldr to devDependencies
The `cldr` package is only used at compile time, to pre-generate the CLDR
keyboard layout data. There is no reason to include it among the dependencies.

Moving it to `devDependencies` shaves about 20Mb off of the packages built, and
a whole lot more when uncompressed: the cldr package is over 200mb uncompressed.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-30 12:51:37 +02:00
Jesse Vincent
9bd3b25ca5 Merge pull request #1022 from keyboardio/ci/workflow-merge
CI: Merge the snapshot & release workflows
2022-07-29 22:56:07 -04:00
Gergely Nagy
fbda727f31 CI: Merge the snapshot & release workflows
Having two workflows that do mostly the same thing, and the major difference
between them is whether they create a new release, or reuse an existing one,
when they should be sharing the vast majority of code, is rather pointless, and
leads to bugs.

Bugs like forgetting to add the settings required for Windows code signing to
the release workflow.

With the workflows merged, we have a single build workflow to maintain, share
the vast majority of code between snapshot and production builds, and thus, we
can avoid such mishaps in the future.

It also makes the release process slightly more reliable, because the snapshot
and release builds will not trip over each other, as there will be only one.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-29 12:42:17 +02:00
Jesse Vincent
ff2ee9cfe0 Merge pull request #1018 from keyboardio/layout-selection/preview
Preferences: Add a preview of the selected keyboard layout
2022-07-28 12:50:48 -04:00
Gergely Nagy
a3578c87cd Bump version to 0.11.1-snapshot
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 15:05:16 +02:00
Gergely Nagy
e11174d892 Update static/build-info.yml
Unfortunately, the firmware-update script was broken before, and did not add
this file. Lets do that now.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
v0.11.0
2022-07-28 12:23:06 +02:00
Gergely Nagy
0ea2ad2027 tools/firmware-update: We do need static/build-info.yml
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 12:13:22 +02:00
Gergely Nagy
3537255a98 Preparations for Chrysalis 0.11.0
Bump the version, and finalize the release date.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 09:29:10 +02:00
Gergely Nagy
aa48798549 Update the firmware files we ship with
Artifacts downloaded from keyboardio/Chrysalis-Firmware-Bundle@v0.11.0.

## Build Information

| Architecture | Core                                                                               |
|:-------------|:-----------------------------------------------------------------------------------|
| AVR          | keyboardio/Kaleidoscope-Bundle-Keyboardio@a9165613d1 |
| GD32         | keyboardio/ArduinoCore-GD32-Keyboardio@1e5db7e472    |

### Libraries

| Library                   | Link                                                                          |
|:--------------------------|:------------------------------------------------------------------------------|
| KeyboardioHID (avr)       | keyboardio/KeyboardioHID@b274575c3f             |
| KeyboardioHID (gd32)      | keyboardio/KeyboardioHID@35cb0a704f             |
| Kaleidoscope              | keyboardio/Kaleidoscope@8f3fab579b              |
| Chrysalis-Firmware-Bundle | keyboardio/Chrysalis-Firmware-Bundle@5cd869a05f |

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 09:29:06 +02:00
Gergely Nagy
2ef02e05c0 tools/firmware-update: Update to use tar.gz, rather than .tar
The firmware bundle switched to tar.gz artifacts a while ago, lets follow suit.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 09:28:07 +02:00
Gergely Nagy
f1bde7118c NEWS.md: Add a small note about updated firmware
Firmware is not updated (yet), that'll be done as part of the release process.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-28 09:25:41 +02:00
Bruno Chevalier
77d328bc6b Translated using Weblate (Dutch)
Currently translated at 100.0% (269 of 269 strings)

Translation: Chrysalis/master
Translate-URL: https://hosted.weblate.org/projects/chrysalis/master/nl/
v0.11.0-snapshot
2022-07-28 03:58:21 +02:00
Gergely Nagy
13463523a2 Bump the version to 0.11.0-snapshot
We have enough major changes that the next version will be 0.11, rather than
0.10.5.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
v0.10.5-snapshot
2022-07-27 22:12:54 +02:00
Gergely Nagy
9407dd3d8d NEWS.md: Add more news items
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 22:11:09 +02:00
Jesse Vincent
472f001f00 Merge pull request #1017 from keyboardio/cldr/parsing-fixes
Assorted CLDR parsing fixes
2022-07-27 12:46:14 -07:00
Jesse Vincent
df5233c4d1 Merge pull request #1020 from keyboardio/layoutcard/do-not-print-headers
Hide the Header when printing Layout Cards
2022-07-27 12:45:55 -07:00
Gergely Nagy
3d857ba1ce cldr: When loading from an OSX keymap, swap E00 and B00
macOS has the E00 (left of `1`) and B00 (between `shift` and `z`) keys swapped.
Our layout display code, the floating 104-key picker assumes a different layout.
So for display purposes, when reading from macOS layouts, swap E00 and B00.

Together with the previous commit, this fixes #1014, and makes the Croatian
layout *almost* correct on Windows and Linux too, with only one symbol
mis-mapped. There's nothing we can do about that at the moment.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 20:55:52 +02:00
Gergely Nagy
3b19a76be8 Hide the Header when printing Layout Cards
When printing layout cards, the header does not add any useful information, but
takes up space - and colors - on the first page. Lets not show the header when
printing the layout card screen.

We do show it for everything else.

Fixes #943.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 20:38:38 +02:00
Jesse Vincent
e75717ed27 Merge pull request #1019 from keyboardio/layout-selection/group-sorting
api/focus/keymap: Sort supported languages the same way we group them
2022-07-27 11:32:12 -07:00
Jesse Vincent
6924e3d2a1 Merge pull request #1021 from keyboardio/layoutcard/no-direct-async-in-useffect
LayoutCard: Don't use an async function directly with useEffectOnce
2022-07-27 11:29:09 -07:00
Gergely Nagy
46f0798dbe LayoutCard: Don't use an async function directly with useEffectOnce
`useEffectOnce`, just like `useEffect` itself, needs a plain, non-async
function. So instead of using doing initialization directly in the effect, push
it into an async function called _from_ the effect. The same pattern we use
elsewhere.

This gets rid of an error printed on the dev console when leaving the Layout
Cards screen.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 20:02:14 +02:00
Gergely Nagy
96aefe31be api/focus/keymap: Sort supported languages the same way we group them
We want to present the list of supported layouts grouped by their language (or
if that is unavailable, the language code, or group), and the groups should be
alphabetically sorted too.

To achieve this, we need to sort the list the same way we group them.

Addresses another issue identified in #649.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 12:21:04 +02:00
Gergely Nagy
a135d31ae2 Preferences: Add a preview of the selected keyboard layout
This addresses a part of #649.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 11:53:27 +02:00
Gergely Nagy
007e0ba67d cldr: Add support for shift+optional-mods modifiers
Similarly how we treat `altR+caps?` as valid altR mapping, we need to treat
`shift+caps?`, `shift+cmd?`, and other combinations of `shift` and optional
modifiers as shift.

This addresses one part of #1014.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 11:23:05 +02:00
Gergely Nagy
8263674c55 Add some more 0.10.5 news
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 02:27:28 +02:00
Gergely Nagy
687b14ddf4 Merge pull request #1002 from keyboardio/api/flash/reboot-guard
Flash process overhaul
2022-07-27 01:43:15 +02:00
Gergely Nagy
954d1c9027 api/hardware: Fix a few display names that were wrong
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 01:37:17 +02:00
Gergely Nagy
ae4be22da4 api/flash: Clear EEPROM before flashing
When flashing new firmware, the storage layout may change, and parts of it may
change owners. While we restore the previous contents in a structured manner, if
previously used space changes owner to a plugin that is new in the updated
firmware, it would start with random garbage in its storage slice.

To avoid this situation, clear the EEPROM before flashing, so when we restore,
we restore onto a fresh, empty state.

Fixes #934.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 01:37:17 +02:00
Gergely Nagy
ec8c30867a Overhaul of the flashing process
Our old flashing process suffered from a few shortcomings, biggest of which was
its reliance on timing, and retries being woefully incomplete. In practice, this
meant that if the key to help trigger bootloader mode was not pressed soon
enough, or was released too late, we ended up in a state Chrysalis could not
recover from, because it never tried the reset again.

The new process does away with the separate "bootloaderTrigger" and
"bootloaderWait" steps, and combines them into a single "bootloader" step, which
will take care of retrying the reboot too, whether from normal mode to
bootloader, or the other way around. This also moves the retry logic into the
flasher, out of `@api/focus`.

With the logic in the flasher, it can properly notify the renderer when the
keyboard is in an unexpected state, and the renderer can - and with this patch,
does - display an appropriate message the user can act on.

With retries in place, the flashing process should be more robust, and more
forgiving, and far less reliant on timing.

Fixes #941, and likely a whole lot of other, flashing related issues.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 01:37:17 +02:00
Gergely Nagy
38e81131dc api/flash: Remove support for external flasher
The option to support an external flasher when there's an internal default was
introduced as a workaround for a bug we have fixed long since. It was only
available on Windows, for two devices, and had to be opted into.

As the bug it was meant to work around is no more, lets drop this unnecessary
complexity, along with the win32 avrdude shipped with Chrysalis.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-27 00:26:38 +02:00
Jesse Vincent
e8284915a5 Merge pull request #1011 from keyboardio/bootloader/ui-fixes
Small UI fixes when connected to a keyboard in bootloader mode
2022-07-26 14:58:09 -07:00
Jesse Vincent
3add70fa97 Merge pull request #1012 from keyboardio/firmware-update/bootloader-fixes
Fix flashing when starting from bootloader mode
2022-07-26 14:57:49 -07:00
Jesse Vincent
8f4df64d93 Merge pull request #1013 from keyboardio/focus/waitForDFUBootloader-fix
api/focus: Make waitForDFUBootloader actually perform a check
2022-07-26 14:57:38 -07:00
Gergely Nagy
bf1fbae399 api/focus: Make waitForDFUBootloader actually perform a check
As long as this function existed, it was practically a no-op, it succeeded as
long as there was at least one USB device connected, of any kind. It did not
perform adequate checks to see if the requested VID/PID pair is among them.

This worked, because the flashing process rebooted the keyboard before checking
for the presence of a bootloader, so by the time we went to check, it was always
there anyway.

Things fell apart as soon as the function was supposed to do a real check. This
patch makes it do what it was always supposed to do: iterate over the devices
found, and only return success if the desired one is among them.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-26 11:06:57 +02:00
Gergely Nagy
4f1d569555 FirmwareUpdate: move defaultFirmwareFilename() back here
We need a `focusDeviceDescriptor` for this function, which we were pulling out
of `activeDevice.focus` previously. However, for keyboards already in bootloader
mode, there is no `activeDevice` to pull from.

FirmwareUpdate itself already has the descriptor via props, and doesn't need to
pull it from anywhere else, so move `defaultFirmwareFilename` back there, where
we have all the information we need at hand anyway.

This, along with the previous commit, fixes flashing when starting from
bootloader mode.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-26 10:40:55 +02:00
Gergely Nagy
1fc5623cf9 Don't try to disconnect from the keyboard if there is no activeDevice
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-26 10:40:45 +02:00
Gergely Nagy
b22b529b4a MainMenu: Don't display Layout Cards when we have no active device
If we're "connected" to a keyboard, but do not have an `activeDevice`, then do
not make the Layout Cards screen available. This can happen if we're connected
to a device in bootloader mode, where layout cards do not make sense.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-26 09:58:11 +02:00
Gergely Nagy
6476fbb55a FirmwareUpdate: If we don't have an active device, don't try to query it
We can land on the FirmwareUpdate page without having an `activeDevice` (such as
when the keyboard is in bootloader mode), don't try to query the active device,
but report the firmware version as unavailable.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-26 09:54:31 +02:00
Gergely Nagy
47ad8e2d90 NEWS.md: Add some more 0.10.5 news items
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-07-26 00:08:18 +02:00
Jesse Vincent
999bdebceb Merge pull request #1001 from keyboardio/printing/notification
After printing, display some kind of feedback
2022-07-25 10:05:09 -07:00
Jesse Vincent
1fb95a0976 Merge pull request #997 from keyboardio/b/keymap-db/host-layout-fixes
api/focus/keymap: Update modifier-augmented key labels too when switching layouts
2022-07-25 10:03:23 -07:00