From 26a3f6b8ec7bcf09ee1ea008f93dcf6e21c8fdfb Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Tue, 23 Jul 2024 21:07:03 -0500 Subject: [PATCH] [PM-8602-8603] Sticky search & filters (#9846) * add "above-scroll-area" to popup page so that content can be excluded from the scroll area * move filters and search above the scrollable area * move bottom border to popup-page component * fix duplicate scrollbar on popup page * update padding to match popup header * move all content of the popup page within the `main` element * update documentation for `above-scroll-area` slot * hide scrollable content when loading --- .../platform/popup/layout/popup-layout.mdx | 3 +++ .../popup/layout/popup-layout.stories.ts | 15 +++++++++++++ .../popup/layout/popup-page.component.html | 21 ++++++++++++++++--- .../popup/layout/popup-page.component.ts | 2 +- .../vault-list-filters.component.html | 2 +- .../components/vault/vault-v2.component.html | 7 +++++-- 6 files changed, 43 insertions(+), 7 deletions(-) diff --git a/apps/browser/src/platform/popup/layout/popup-layout.mdx b/apps/browser/src/platform/popup/layout/popup-layout.mdx index b805805ad1..49f76501ae 100644 --- a/apps/browser/src/platform/popup/layout/popup-layout.mdx +++ b/apps/browser/src/platform/popup/layout/popup-layout.mdx @@ -41,6 +41,9 @@ page looks nice when the extension is popped out. - `footer` - Use the `popup-footer` component. - Not every page will have a footer. +- `above-scroll-area` + - When the page content overflows, this content will be "stuck" to the top of the page upon + scrolling. - default - Whatever content you want in `main`. diff --git a/apps/browser/src/platform/popup/layout/popup-layout.stories.ts b/apps/browser/src/platform/popup/layout/popup-layout.stories.ts index f2208a8b8f..9857eeccc3 100644 --- a/apps/browser/src/platform/popup/layout/popup-layout.stories.ts +++ b/apps/browser/src/platform/popup/layout/popup-layout.stories.ts @@ -12,6 +12,7 @@ import { IconButtonModule, ItemModule, NoItemsModule, + SearchModule, } from "@bitwarden/components"; import { PopupFooterComponent } from "./popup-footer.component"; @@ -103,6 +104,18 @@ class MockPopoutButtonComponent {} }) class MockCurrentAccountComponent {} +@Component({ + selector: "mock-search", + template: ` +
+ +
+ `, + standalone: true, + imports: [SearchModule], +}) +class MockSearchComponent {} + @Component({ selector: "mock-vault-page", template: ` @@ -114,6 +127,7 @@ class MockCurrentAccountComponent {} + `, @@ -124,6 +138,7 @@ class MockCurrentAccountComponent {} MockAddButtonComponent, MockPopoutButtonComponent, MockCurrentAccountComponent, + MockSearchComponent, VaultComponent, ], }) diff --git a/apps/browser/src/platform/popup/layout/popup-page.component.html b/apps/browser/src/platform/popup/layout/popup-page.component.html index 87f91e781a..d53ef24803 100644 --- a/apps/browser/src/platform/popup/layout/popup-page.component.html +++ b/apps/browser/src/platform/popup/layout/popup-page.component.html @@ -1,10 +1,25 @@ -
+
+
+ +
- + + + + +
+
+
+ +
+ +
-
+ - + +
- +
+ +