Commit Graph

22 Commits

Author SHA1 Message Date
jvoisin fd8f25916b First steps towards trusted-types support
Refactor away some trival usages of `.innerHTML`. Unfortunately, there is no way to
enabled trusted-types in report-only mode via `<meta>` tags, see
https://github.com/w3c/webappsec-csp/issues/277
2024-03-10 20:14:30 -07:00
jvoisin 826e4d654f Replace DomHelper.findParent with .closest
See https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
2024-03-10 20:06:54 -07:00
jvoisin d9d17f0d69 Use a `Set` instead of an array in a KeyboardHandler's member
The variable `triggers` is only used to check if in contains a particular
value. Given that the number of keyboard shortcuts is starting to be
significant, let's future-proof the performances and use a `Set` instead of an
`Array` instead.
2024-03-10 19:41:13 -07:00
Frédéric Guillot abdd5876a1 Move search form to a dedicated page 2024-03-01 16:56:15 -08:00
Robert Lützner facf38955c Add 'Enter' key as a hotkey to open selected item
There are a few things that need to be done, to make this work.

First, we need to register `Enter` as another hotkey that opens the
selected item.

However, by default the `KeyboardHandler` will override all default
actions. That might make sense for any other key, but for the `Enter`
key, we want to keep the default behavior (i.e. follow a selected link
or press a button). So for this single key event, we do not call
`preventDefault()`.

I see this as unproblematic for the following reasons.

1. With the changes from #2348, when we're in a list of items (articles,
   categories, feeds), there is no link selected. This is what made the
   `Enter` key work _implicitly_ in the past. With nothing selected, the
   `Enter` key will do nothing by default.
2. If we have **any** link selected (including when we are in a view
   with a list of selectable items), we'll get the default action of
   `Enter` (i.e. follow a link), which is exactly what we had before.

Lastly, we need to update the list of keyboard shortcuts displayed when
pressing `?`.

This fixes #2366.
2024-02-21 20:02:58 -08:00
krvpb024 5c97771e61 fix macOS VoiceOver didn't announce details and summary expand 2024-02-14 20:11:23 -08:00
knrdl ccb9eed573 fix wrong label on save
when saving an entry the label was reset on complete
so the desired done label was never shown
2024-02-11 12:49:08 -08:00
Tân Î-sîn ea58bac548
Replace link has button role with button tag
# Change HTML tag to button

Replace the link tag with an HTML button to prevent some screen readers from having confusing announcements. By using the HTML button, users can use the Enter and Space keys to activate actions by default, instead of implementing them in JavaScript.

# Differentiate links and buttons visually

When activating the link element, the user may expect the web page to navigate to the URL and the page will refresh; when activating the button element, the user may expect the web page to still be on the same page, so that their current state, such as: input value, won't disappear.

Links and buttons should have different styles visually, so that users can't expect what will happen when they activate a link or a button.

I added the underline to the links, because that is the common pattern. Buttons have border and background color in a common pattern. But I think that will change the current layout drastically. So I added the focus, hover and active classes to the buttons instead.
2024-02-09 17:09:30 -08:00
krvpb024 27749a2877 change focus target on items when using keyboard navigation 2024-02-09 16:54:29 -08:00
krvpb024 6eac968083 add keyboard shortcut and aria attribute to menu button 2024-02-07 21:56:24 -08:00
Frédéric Guillot 9336891e67 Restore menu toggle when clicking on the logo
The caret icon is too small on smartphone to expand/collapse the menu
2024-02-05 21:18:06 -08:00
krvpb024 890a34e1bd remove code for debug and comment 2024-02-04 10:47:30 -08:00
krvpb024 7413e383a8 fix search and star function 2024-02-04 10:47:30 -08:00
krvpb024 84576f2c29 fix menu responsive layout 2024-02-04 10:47:30 -08:00
krvpb024 6a9a590c7f add search landmark and disclosure pattern to menu 2024-02-04 10:47:30 -08:00
Andrew Gunnerson 6648e0af38 Revert "touch_handler: Fix scroll up behavior on Firefox Android"
This reverts commit 344a237af8.

The previous behavior is more correct due to the use of preventDefault()
and the commit was introduced only as a workaround. As of [1], the
underlying issue in Firefox has been fixed and downward swipes to scroll
up are no longer ignored every other attempt.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1847305
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1853075
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1724755

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-01-23 19:33:08 -08:00
Frédéric Guillot 2b8342fcd5 Refactor WebAuthn Javascript code 2023-11-06 19:55:32 +01:00
Florian Rüchel 62ef8ed57a
Add WebAuthn / Passkey integration
This is a rebase of #1618 in which @dave-atx added WebAuthn support.

Closes #1618
2023-11-05 18:57:35 +01:00
Frédéric Guillot c60b3f52a5 Add new page for background feeds refresh 2023-10-18 20:26:33 -07:00
Frédéric Guillot d0377d5d9d Fix Javascript error when reading time option is disabled 2023-10-06 18:35:49 -07:00
Andrew Gunnerson 344a237af8 touch_handler: Fix scroll up behavior on Firefox Android
When the touchmove listener is registered with passive: false, scrolling
up on Firefox Android only works every other attempt. When scrolling
breaks, the touchmove callback is never invoked.

The passive flag was originally set to false as part of a fix to prevent
vertical scrolling while swiping: 3f31744911.
Setting passive to true doesn't seem to negatively affect that in both
Firefox and Chrome, but fixes the scoll up behavior on Firefox.

Fixes: #2053

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2023-09-08 15:59:57 -07:00
Frédéric Guillot 168a870c02 Move internal packages to an internal folder
For reference: https://go.dev/doc/go1.4#internalpackages
2023-08-10 20:29:34 -07:00