pinafore/tests/spec
Stephane Zermatten c2bd2f306a feat: Add support for keyboard shortcuts (#870)
* Add support for keyboard shortcuts.

This change introduces a Shortcut component for defining global
keyboard shortcuts from whichever component makes more sense.

This change also adds an initial set of navigation shortcuts:
- Backspace to leave a modal dialog or to go back
- g t to go to the federated timeline
- g f to go to the favorite page
- g h to go to the home page
- g n to go to the notification page
- g c to go to the community page
- s to go to the search page

These shortcuts are loaded asynchronously from _layout.html

In modal dialogs, shortcuts are also modal, to avoid strange or
overly complex behavior. This is implemented by grouping
shortcuts into scopes, and activating a separate 'modal' scope
when entering a modal dialog, so a separate set of shortcuts can
be enabled in modal dialog. Modal dialogs can be exited by
pressing 'Backspace'.

* Navigate up/down lists using keyboard shortcuts.

This change introduces keyboard shortcuts for navigating in lists and
virtual lists. j or arrow up selects the next element, k or arrow down,
the previous element. Selecting an element scrolls the list up and down,
as necessary.

This change also allows directing keyboard shortcuts to the active
element and defines the following shortcuts, for the active status:
- f to favorite or unfavorite it
- b to boost or unboost it
- r to reply to it
- o to open its thread
- x to toggle the display of a CW
- y to toggle the display of sensitive medias

This works by defining a keyboard shortcut scope for each list element.
A new component, ScrollListShortcuts, keeps track of the active element,
based on list or virtual list elements and redirects shortcuts to the
active element's scope. ScrollListShortcuts keeps the active element in
the current realm of the store, so the active element is restored when
going back to the list.

* Typing h or ? displays the list of available keyboard shortcuts.

This change introduces a new modal dialog that documents the list of
available shortcuts.
2019-01-13 10:03:29 -08:00
..
001-basic-spec.js fix(scrolling): use body as scrolling container (#656) 2018-11-17 18:06:49 -08:00
002-login-spec.js fix: fix logging in and out with a refresh (#824) 2018-12-16 12:39:16 -08:00
003-basic-timeline-spec.js chore(travis): update to mastodon v2.6.1 (#630) 2018-11-12 12:59:47 -08:00
004-pinned-statuses.js Remove testcafe roles and run in parallel x4 (#334) 2018-05-26 13:51:41 -07:00
005-status-types.js fix(a11y): improved aria-label for status and notifications (#690) 2018-11-25 01:20:58 -08:00
006-tabindex.js Remove testcafe roles and run in parallel x4 (#334) 2018-05-26 13:51:41 -07:00
007-account-profile.js Remove testcafe roles and run in parallel x4 (#334) 2018-05-26 13:51:41 -07:00
008-status-media.js fix: update Sapper to latest (#775) 2018-12-11 07:31:48 -08:00
009-threads.js test: make tests less flaky (#678) 2018-11-21 22:08:37 -08:00
010-focus.js fix: update Sapper to latest (#775) 2018-12-11 07:31:48 -08:00
011-reblog-favorites-count.js add application (client) name to statuses (#497) 2018-08-26 15:38:45 -07:00
012-compose.js feat: add full emoji picker using emoji-mart (#836) 2018-12-18 00:43:51 -08:00
013-compose-media.js media uploads no longer add URLs to status text (#500) 2018-08-26 18:54:59 -07:00
014-compose-post-privacy.js Remove testcafe roles and run in parallel x4 (#334) 2018-05-26 13:51:41 -07:00
015-compose-content-warnings.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
016-external-links.js allow user display names to contain custom emoji (#448) 2018-08-19 15:23:40 -07:00
017-compose-reply.js fix: fix flaky test by clicking relative date (#790) 2018-12-12 23:45:42 -08:00
018-compose-autosuggest.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
019-mention.js feat(statuses): implement "Delete and redraft" (#719) 2018-12-03 23:23:29 -08:00
020-themes.js refactor(themes): use CSS specificity order for themes (#684) 2018-11-24 00:41:36 -08:00
021-followers-follows.js tests: remove more testcafe .find() calls (#376) 2018-06-08 21:54:21 -07:00
022-status-aria-label.js fix: update Sapper to latest (#775) 2018-12-11 07:31:48 -08:00
023-mark-media-as-sensitive.js fix: update Sapper to latest (#775) 2018-12-11 07:31:48 -08:00
024-shortcuts-navigation.js feat: Add support for keyboard shortcuts (#870) 2019-01-13 10:03:29 -08:00
025-shortcuts-status.js feat: Add support for keyboard shortcuts (#870) 2019-01-13 10:03:29 -08:00
100-favorite-unfavorite.js fix: update Sapper to latest (#775) 2018-12-11 07:31:48 -08:00
101-reblog-unreblog.js test: make tests less flaky (#678) 2018-11-21 22:08:37 -08:00
102-notifications.js fix: add better browser notification badges (#857) 2018-12-30 14:51:03 -08:00
103-compose.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
104-streaming.js test: make tests less flaky (#678) 2018-11-21 22:08:37 -08:00
105-deletes.js fix: add better browser notification badges (#857) 2018-12-30 14:51:03 -08:00
106-follow-requests.js Remove testcafe roles and run in parallel x4 (#334) 2018-05-26 13:51:41 -07:00
107-streaming-gap.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
108-compose-dialog.js feat: add full emoji picker using emoji-mart (#836) 2018-12-18 00:43:51 -08:00
109-compose-media.js media uploads no longer add URLs to status text (#500) 2018-08-26 18:54:59 -07:00
110-compose-content-warnings.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
111-focus.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
112-status-links.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
113-block-unblock.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
114-mute-unmute.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
115-follow-unfollow.js Remove testcafe roles and run in parallel x4 (#334) 2018-05-26 13:51:41 -07:00
116-follow-requests.js Update standard to the latest version 🚀 (#519) 2018-08-29 21:42:57 -07:00
117-pin-unpin.js test: make tests less flaky (#678) 2018-11-21 22:08:37 -08:00
118-display-name-custom-emoji.js fix(a11y): fix NVDA crash on long aria-label (#702) 2018-12-01 00:10:30 -08:00
119-status-counts-update.js update fav boost accounts for stale views (#510) 2018-08-28 06:45:15 -07:00
120-status-aria-label.js fix(a11y): fix NVDA crash on long aria-label (#702) 2018-12-01 00:10:30 -08:00
121-delete-and-redraft.js fix: preserve newlines correctly in delete-and-redraft (#845) 2018-12-19 00:57:56 -08:00
122-replies-in-thread.js fix: fix duplicate statuses in threads (#783) 2018-12-11 22:06:50 -08:00