From 08c42a8a27262d1d1ebf06adc50831bb7cffae38 Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Tue, 28 Jan 2025 09:12:56 -0600 Subject: [PATCH] [PM-13388] Extension: Persist Scroll from Vault (#12325) * add service to track scroll position of the vault tab in the popup * add data attribute to individual vault items - Allows query selector to focus on the specific element * stop scroll service when a cipher is deleted * start scroll listener when the vault page is initialized * fix strict linting errors * remove focus reset when navigating back to the vault screen * skip recording the first scroll from the automatic scroll * combine filters into a single observable * do not start the scroll service until filters have loaded in * refactor allFilters to come from the vault popup list filters service * use assertion on scroll position * hide virtual scrolling element while scrolling is restored * update comments * fix failing tests to use different matcher * remove visibility trick for restoring scroll position after chatting with design --------- Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com> --- .../vault-list-filters.component.html | 7 +- .../vault-list-filters.component.ts | 16 ++ .../components/vault-v2/vault-v2.component.ts | 30 +++- .../view-v2/view-v2.component.spec.ts | 157 +++++++++++++++++- .../vault-v2/view-v2/view-v2.component.ts | 3 + .../vault-popup-list-filters.service.ts | 3 + ...ault-popup-scroll-position.service.spec.ts | 137 +++++++++++++++ .../vault-popup-scroll-position.service.ts | 81 +++++++++ 8 files changed, 421 insertions(+), 13 deletions(-) create mode 100644 apps/browser/src/vault/popup/services/vault-popup-scroll-position.service.spec.ts create mode 100644 apps/browser/src/vault/popup/services/vault-popup-scroll-position.service.ts diff --git a/apps/browser/src/vault/popup/components/vault-v2/vault-list-filters/vault-list-filters.component.html b/apps/browser/src/vault/popup/components/vault-v2/vault-list-filters/vault-list-filters.component.html index 56f35c41f6d..c61562f9f90 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/vault-list-filters/vault-list-filters.component.html +++ b/apps/browser/src/vault/popup/components/vault-v2/vault-list-filters/vault-list-filters.component.html @@ -2,8 +2,9 @@