discourse/spec/system
Jeff Wong d208396c5c
UX: improve touch, swipe, panning performance on mobile menus (#23775)
PERF: improve touch, swipe, panning performance on mobile menus
---

* stop event propagation on swipe events: other touch events were stealing a huge amount of time here. Stop event
propagation when handling pan events.
* animate with [web animations api](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API)
* prefer translate3d to hint for gpu rendering.
* query document for elements only on start move event, not on subsequent move
events
* remove unused calculations for directioned velocity and distance: all swipe/pan elements function in x/y direction only.
* re-implement scroll locking behavior.

re-implemented scroll lock behavior
---

With stop event propagation, we need to re-implement scroll locking on menu swipes.
Previously, this was using onTouchMove which was costly.

We may now use styling with overflow-y:hidden to lock scroll behavior.

overflow:hidden on html/body elements is now supported by iOS as of 2022
https://bugs.webkit.org/show_bug.cgi?id=153852
https://bugs.webkit.org/show_bug.cgi?id=220908

UX: improve swipe
---

Some improvements to get gestures and swipes feeling a little more polished.

This focuses on end gesture, and how we transfer it to a css animation to
complete a menu open/close action.

Multitouch: events may pan, scroll, and zoom - especially on iOS safari.
Cancelling the swipe event allows for a more pleasant zooming experience.

* ease-out on menus opening, linear on close
* calculate animation duration for opening and closing,
attempt to better transfer user swipe velocity to css animation.
* more timely close/open and cleanup from calculated animation timing.
* add animation to closing menus on cloak tap
* correctly animate menus with ease-in and ease-out
* add swipe cancel event on multitouch event

DEV
---

* lean on promises

js animations api gives us promises to listen to. Update test waiters
to use waitForPromise from @ember/test-waiters instead of reigster/unregister.

* convert swipe mixin to its own class.

Convert swipe callbacks to custom events on the element.
Move shared functions for max animation time and close logic to
new shared class.

swipe-events lib uses custom events to trigger callbacks, rather than assuming
implemented hard coded function from the mixin's base class. Custom events are
triggered from the bound element as swipestart, swipeend, swipe

Add shared convenience functions for swipe events so they can be more easily
shared.

A client receives an initial swipe event and can check some state to see if it
wants to handle the swipe event and if it doesn't, calling
`event.preventDefault();` will prevent `swipe` and `swipeend` events from firing
until another distinct swipestart event is fired. Swipe events will auto-cancel on multitouch.

The scroll lock has also exposed as its own utility class.
2023-10-16 11:27:00 -07:00
..
composer DEV: Prevent videos from preloading metadata (#23807) 2023-10-12 13:47:48 -06:00
emojis DEV: Skip flaky specs (#23523) 2023-09-12 08:01:30 +08:00
groups FIX: Correct error on add user modal (#23679) 2023-09-27 13:54:44 +08:00
helpers DEV: make sure we don't load all data into memory when exporting chat messages (#22276) 2023-07-12 18:52:18 +04:00
page_objects UX: improve touch, swipe, panning performance on mobile menus (#23775) 2023-10-16 11:27:00 -07:00
user_page DEV: Add UI for passkeys (3/3) (#23853) 2023-10-13 12:24:06 -04:00
admin_customize_form_templates_spec.rb UX: remove unsupported filterable attr from form template sample (#23535) 2023-09-12 12:20:55 -03:00
admin_customize_themes_spec.rb FIX: multiple delete themes spec fail in parallel (#23837) 2023-10-09 01:04:45 +00:00
bookmarks_spec.rb DEV: Fix bookmark system spec flaky (#22630) 2023-07-17 15:34:11 +10:00
category_edit_spec.rb DEV: Remove superfluous js: true metadata (#21960) 2023-06-07 09:26:58 +08:00
category_topics_spec.rb DEV: Fix flaky system test in system/category_topics_spec.rb (#22652) 2023-07-18 07:35:47 +08:00
change_owner_spec.rb DEV: convert change owner modal to glimmer component (#23668) 2023-09-29 11:46:31 +08:00
composer_uploads_spec.rb DEV: Fix flaky network-based upload spec (#23286) 2023-08-28 12:59:22 +08:00
csv_exports_spec.rb DEV: find_each in CSV exports (#22573) 2023-08-17 12:33:52 +10:00
custom_sidebar_sections_spec.rb FIX: Custom sidebar section link with / path leading to blank page (#23661) 2023-09-26 15:14:13 +08:00
discovery_breadcrumb_navigation_spec.rb DEV: Fix random typos (#22078) 2023-06-13 22:02:21 +02:00
dismissing_new_spec.rb DEV: Add system specs for dismiss new on tag routes (#23936) 2023-10-16 10:51:59 +01:00
editing_sidebar_categories_navigation_spec.rb UX: Remove section heading for community section (#22405) 2023-07-11 09:40:37 +08:00
editing_sidebar_community_section_spec.rb FIX: display customised community section button when no secondary links (#22948) 2023-08-03 12:53:34 +10:00
editing_sidebar_tags_navigation_spec.rb FIX: Loading more tags in edit nav menu tags modal not working (#22770) 2023-07-25 13:44:25 +08:00
ember_deprecation_test.rb DEV: Remove superfluous js: true metadata (#21960) 2023-06-07 09:26:58 +08:00
fast_edit_spec.rb DEV: Remove superfluous js: true metadata (#21960) 2023-06-07 09:26:58 +08:00
filtering_topics_spec.rb FIX: /filter route input field not updating on route change (#23119) 2023-08-17 09:04:48 +08:00
grant_badge_spec.rb DEV: convert grant badge modal to component API (#23378) 2023-09-11 13:56:31 +08:00
group_card_spec.rb FIX: Member Highlights on Group Cards (#22828) 2023-07-28 14:33:42 +00:00
hashtag_autocomplete_spec.rb FIX: Cook hashtags in small action posts (#23008) 2023-08-08 15:38:37 +10:00
keyboard_shortcuts_spec.rb FEATURE: Add a shortcut to archive PM 2023-09-05 09:44:05 +02:00
network_disconnected_spec.rb DEV: Fix flaky network-based upload spec (#23286) 2023-08-28 12:59:22 +08:00
new_topic_list_spec.rb DEV: Skip flaky specs (#23523) 2023-09-12 08:01:30 +08:00
reviewables_spec.rb FEATURE: Add Revise... option for queued post reviewable (#23454) 2023-10-13 11:28:31 +10:00
s3_secure_uploads_spec.rb FEATURE: Secure uploads in PMs only (#23398) 2023-09-06 09:39:09 +10:00
s3_uploads_spec.rb FEATURE: Secure uploads in PMs only (#23398) 2023-09-06 09:39:09 +10:00
scroll_manager_service_spec.rb DEV: Remove unused pageobject from scroll_manager_service_spec (#23501) 2023-09-11 10:28:25 +01:00
search_spec.rb DEV: Remove superfluous js: true metadata (#21960) 2023-06-07 09:26:58 +08:00
tag_notification_level_spec.rb DEV: Remove superfluous js: true metadata (#21960) 2023-06-07 09:26:58 +08:00
tag_synonyms_spec.rb DEV: Fix random typos (#22078) 2023-06-13 22:02:21 +02:00
tags_intersection_spec.rb FIX: Transitioning to tag-intersection route (#23931) 2023-10-13 16:23:04 +01:00
theme_qunit_spec.rb DEV: Stop building test assets in production under Embroider (#23388) 2023-09-11 09:12:37 +01:00
topic_list_focus_spec.rb A11Y: Fix selecting topic when navigation via keyboard (#22996) 2023-08-07 17:05:16 -04:00
topic_page_spec.rb FIX: Copy button JS test failures (#23687) 2023-09-27 13:05:27 -04:00
user_activation_spec.rb FIX: Pass email correctly when resending activation email (#23741) 2023-10-02 13:00:29 +01:00
user_selector_spec.rb DEV: Remove superfluous js: true metadata (#21960) 2023-06-07 09:26:58 +08:00
viewing_category_spec.rb DEV: Remove superfluous js: true metadata (#21960) 2023-06-07 09:26:58 +08:00
viewing_group_members_spec.rb FIX: Infinite loading broken on group members list (#23214) 2023-08-24 08:50:20 +08:00
viewing_navigation_menu_preferences_spec.rb UX: Use modals to edit categories and tags that appear in sidebar (#22295) 2023-06-28 07:20:31 +08:00
viewing_sidebar_as_anonymous_user_spec.rb UX: support links in tag descriptions (#22994) 2023-08-16 11:43:54 -04:00
viewing_sidebar_mobile_spec.rb UX: Remove section heading for community section (#22405) 2023-07-11 09:40:37 +08:00
viewing_sidebar_spec.rb FEATURE: Remove support for legacy navigation menu (#23752) 2023-10-09 07:24:10 +08:00
viewing_user_menu_spec.rb UX: Move group mentions notifications into the reply tab (#22562) 2023-07-13 06:52:03 +08:00
viewing_user_private_messages_spec.rb FIX: Broken group messages inboxes when group name is mixed case (#22183) 2023-06-19 17:36:04 +08:00