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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
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>
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>
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>
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>
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>
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>
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>
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>
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>