Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-6825] Browser Refresh - Initial List Items #9199

Merged
merged 41 commits into from
May 21, 2024

Conversation

shane-melton
Copy link
Member

@shane-melton shane-melton commented May 15, 2024

Type of change

- [ ] Bug fix
- [X] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Introduce the new vault list item components and services to be used in the new combined vault view.

Code changes

New Components

  • VaultListItemContainer
    • A presentational container to list VaultListItems with a section header
  • AutofillVaultListItems
    • A smart component that wraps a VaultListItemContainer for auto fill items. It also includes the necessary logic to hide/show the autofill tooltip message when no autofill items are available.

New VaultPopupItemsService

This service is responsible for determining which ciphers should be visible on the new vault page. It provides observables for each of the cipher list sections (autofill, favorites, all items) and applies the necessary logic to sort ciphers and ensure none repeat between the sections. Eventually, we should be able to apply filtering/searching logic to the base cipher list and then our new filter/search components will be able to influence what is shown via this service.

It also has a few helpers:

  • emptyVault$ - Used to help determine if the vault is empty and the empty screen should be shown
  • autofillAllowed$ - Checks if the popup is not in a popout and a current tab is available for autofill.
  • hasFilterApplied$ - Placeholder value for now. Is used to show the autofill tip when no filters are applied and no autofill suggestions are present.
  • noFilteredResults$ - Placeholder value for now. Is used to show the No Search Results screen. Will need to be updated when filtering logic is added.

Known Issues / Pending Work

  • Empty and No Results pages are not vertically centered. This appears to be a limitation of the popout page. The popup-page > main > div element doesn't fill the parent's height and so I can't get the no items icon to fill and center. cc: @willmartian
  • The No Results icon will need to be updated at the CL level to match the Figma. Unless we want to introduce the new icon separately? cc: @willmartian
  • The Empty Vault icon colors are not available to be themed by Tailwind yet.
  • Section headers are placeholders and will need to be updated to the component in [PM-7878] PopupSectionHeader component #9107
  • Vault page header is a placeholder and will need to be removed/resolved with [PM-6823] Vault Header Refresh #9197

Screenshots

No autofill suggestions with tip/helper

image

Autofill suggestions and favorites and all items

image

Hidden autofill suggestions when in Popout

image

Empty Vault

image

No Results

image

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
  • Ensure that all UI additions follow WCAG AA requirements

@shane-melton shane-melton marked this pull request as ready for review May 15, 2024 19:23
@shane-melton shane-melton requested review from a team as code owners May 15, 2024 19:23
Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 47.31183% with 49 lines in your changes are missing coverage. Please review.

Project coverage is 28.14%. Comparing base (983a82c) to head (2b7c697).
Report is 1 commits behind head on main.

Files Patch % Lines
...vault/popup/components/vault/vault-v2.component.ts 0.00% 18 Missing ⚠️
...-list-items/autofill-vault-list-items.component.ts 0.00% 13 Missing ⚠️
...-container/vault-list-items-container.component.ts 0.00% 7 Missing ⚠️
libs/common/src/vault/services/cipher.service.ts 20.00% 4 Missing ⚠️
...owser/src/vault/popup/components/vault-v2/index.ts 0.00% 2 Missing ⚠️
.../vault/popup/services/vault-popup-items.service.ts 95.55% 1 Missing and 1 partial ⚠️
libs/components/src/icon/icons/vault.ts 0.00% 2 Missing ⚠️
libs/components/src/icon/icons/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9199      +/-   ##
==========================================
+ Coverage   28.11%   28.14%   +0.02%     
==========================================
  Files        2363     2368       +5     
  Lines       69922    70011      +89     
  Branches    13149    13158       +9     
==========================================
+ Hits        19661    19704      +43     
- Misses      48703    48748      +45     
- Partials     1558     1559       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented May 15, 2024

Logo
Checkmarx One – Scan Summary & Details3b0282d9-0536-44d1-92b8-2894e10e7b5e

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Angular_Improper_Type_Pipe_Usage /apps/browser/src/vault/popup/components/vault/vault-v2.component.html: 37 Attack Vector
MEDIUM Angular_Improper_Type_Pipe_Usage /apps/browser/src/vault/popup/components/vault/vault-v2.component.html: 27 Attack Vector
MEDIUM Angular_Improper_Type_Pipe_Usage /apps/browser/src/vault/popup/components/vault/vault-v2.component.html: 24 Attack Vector
MEDIUM Angular_Improper_Type_Pipe_Usage /apps/browser/src/vault/popup/components/vault/vault-v2.component.html: 14 Attack Vector

@willmartian
Copy link
Contributor

willmartian commented May 15, 2024

The No Results icon will need to be updated at the CL level to match the Figma. Unless we want to introduce the new icon separately?

Passing this on to @danielleflinn , do we plan to still use the current no-items icon anywhere? https://components.bitwarden.com/?path=/docs/component-library-no-items--docs

Or should all instances of it be updated to the icon introduced here?

@willmartian
Copy link
Contributor

willmartian commented May 15, 2024

Empty and No Results pages are not vertically centered. This appears to be a limitation of the popout page. The popup-page > main > div element doesn't fill the parent's height and so I can't get the no items icon to fill and center.

@shane-melton Taking a look! 👀
edit: tomorrow

Comment on lines 17 to 20
<button type="button" bitIconButton="bwi-clone" size="small"></button>
</bit-item-action>
<bit-item-action>
<button type="button" bitIconButton="bwi-ellipsis-v" size="small"></button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These icon buttons should have aria labels

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 0a72374

<bit-item-group>
<bit-item *ngFor="let cipher of ciphers">
<a bit-item-content [routerLink]="['/view-cipher']" [queryParams]="{ cipherId: cipher.id }">
<app-vault-icon slot="start" [cipher]="cipher"></app-vault-icon>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it needs to part of the CL--components can be used across clients without being part of the CL lib. The CL is for low level domain-agnostic UI components, whereas this is tied into the domain-specific idea of a vault cipher.

Instead, I would move these global styles into app-vault-icon's template with Tailwind. This will make the component portable. (Also a good opportunity to make it standalone.)

@willmartian
Copy link
Contributor

Empty and No Results pages are not vertically centered. This appears to be a limitation of the popout page. The popup-page > main > div element doesn't fill the parent's height and so I can't get the no items icon to fill and center.

Should be fixed when #9237 is merged. See story.

Jingo88
Jingo88 previously approved these changes May 21, 2024
Comment on lines 18 to 26
import {
AvatarModule,
ButtonModule,
IconButtonModule,
NoItemsModule,
SectionComponent,
ToastModule,
TypographyModule,
} from "@bitwarden/components";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only blocking item, everything else is a nit pick:

Do these need to be in the AppModule? Could we instead make VaultV2Component standalone? (I think that is why they were brought in.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, at the time I originally started, the CurrentAccountComponent and PopOutComponent where not standalone and I couldn't import them into a standalone VaultV2Component. However, now that they're both standalone I can do that.

Doing so also removes the need for a VaultV2Module as everything it exported for the AppModule can now be imported directly in VaultV2Component.

Addressed in f332778

apps/desktop/src/scss/misc.scss Show resolved Hide resolved
<bit-item-group>
<bit-item *ngFor="let cipher of ciphers">
<a bit-item-content [routerLink]="['/view-cipher']" [queryParams]="{ cipherId: cipher.id }">
<app-vault-icon slot="start" [cipher]="cipher"></app-vault-icon>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to remove the global styles mentioned above in this thread? Are they still needed after your latest changes?

Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for iterating with me :)

@shane-melton shane-melton enabled auto-merge (squash) May 21, 2024 21:00
@shane-melton shane-melton merged commit 3d0e0d2 into main May 21, 2024
60 checks passed
@shane-melton shane-melton deleted the vault/pm-6825/list-item-containers branch May 21, 2024 21:05
cagonzalezcs pushed a commit that referenced this pull request May 21, 2024
* [PM-6825] Add temporary vault page header

* [PM-6825] Expose cipherViews$ observable

* [PM-6825] Refactor getAllDecryptedForUrl to expose filter functionality for reuse

* [PM-6825] Introduce VaultPopupItemsService

* [PM-6825] Introduce initial VaultListItem and VaultListItemsContainer components

* [PM-6825] Add VaultListItems to VaultV2 component

* [PM-6825] Introduce autofill-vault-list-items.component to encapsulate autofill logic

* [PM-6825] Add temporary Vault icon

* [PM-6825] Add empty and no results states to Vault tab

* [PM-6825] Add unit tests for vault popup items service

* [PM-6825] Negate noFilteredResults placeholder

* [PM-6825] Cleanup new Vault components

* [PM-6825] Move new components into its own module

* [PM-6825] Fix missing button type

* [PM-6825] Add booleanAttribute to showAutofill input

* [PM-6825] Replace empty refresh BehaviorSubject with Subject

* [PM-6825] Combine *ngIfs for vault list items container

* [PM-6825] Use popup-section-header component

* [PM-6825] Use small variant for icon buttons

* [PM-6825] Use anchor tag for vault items

* [PM-6825] Consolidate vault-list-items-container to include list item component functionality directly

* [PM-6825] Add Tailwind classes to new Vault icon

* [PM-6825] Remove temporary header comment

* [PM-6825] Fix auto fill suggestion font size and padding

* [PM-6825] Use tailwind for vault icon styling

* [PM-6825] Add libs/angular to tailwind.config content

* [PM-6825] Cleanup missing i18n

* [PM-6825] Make VaultV2 standalone and cleanup Browser App module

* [PM-6825] Use explicit type annotation

* [PM-6825] Use property binding instead of interpolation
quexten pushed a commit that referenced this pull request May 22, 2024
* [PM-6825] Add temporary vault page header

* [PM-6825] Expose cipherViews$ observable

* [PM-6825] Refactor getAllDecryptedForUrl to expose filter functionality for reuse

* [PM-6825] Introduce VaultPopupItemsService

* [PM-6825] Introduce initial VaultListItem and VaultListItemsContainer components

* [PM-6825] Add VaultListItems to VaultV2 component

* [PM-6825] Introduce autofill-vault-list-items.component to encapsulate autofill logic

* [PM-6825] Add temporary Vault icon

* [PM-6825] Add empty and no results states to Vault tab

* [PM-6825] Add unit tests for vault popup items service

* [PM-6825] Negate noFilteredResults placeholder

* [PM-6825] Cleanup new Vault components

* [PM-6825] Move new components into its own module

* [PM-6825] Fix missing button type

* [PM-6825] Add booleanAttribute to showAutofill input

* [PM-6825] Replace empty refresh BehaviorSubject with Subject

* [PM-6825] Combine *ngIfs for vault list items container

* [PM-6825] Use popup-section-header component

* [PM-6825] Use small variant for icon buttons

* [PM-6825] Use anchor tag for vault items

* [PM-6825] Consolidate vault-list-items-container to include list item component functionality directly

* [PM-6825] Add Tailwind classes to new Vault icon

* [PM-6825] Remove temporary header comment

* [PM-6825] Fix auto fill suggestion font size and padding

* [PM-6825] Use tailwind for vault icon styling

* [PM-6825] Add libs/angular to tailwind.config content

* [PM-6825] Cleanup missing i18n

* [PM-6825] Make VaultV2 standalone and cleanup Browser App module

* [PM-6825] Use explicit type annotation

* [PM-6825] Use property binding instead of interpolation
cagonzalezcs added a commit that referenced this pull request May 29, 2024
… Switching Tabs (#9300)

* [PM-8322] Firefox Inline Autofill Menu Not Propagation Correctly When Switching Tabs

* [PM-8322] Firefox Inline Autofill Menu Not Propagation Correctly When Switching Tabs

* Add missing RouterModule to the CurrentAccountComponent (#9295)

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>

* [PM-6825] Browser Refresh - Initial List Items (#9199)

* [PM-6825] Add temporary vault page header

* [PM-6825] Expose cipherViews$ observable

* [PM-6825] Refactor getAllDecryptedForUrl to expose filter functionality for reuse

* [PM-6825] Introduce VaultPopupItemsService

* [PM-6825] Introduce initial VaultListItem and VaultListItemsContainer components

* [PM-6825] Add VaultListItems to VaultV2 component

* [PM-6825] Introduce autofill-vault-list-items.component to encapsulate autofill logic

* [PM-6825] Add temporary Vault icon

* [PM-6825] Add empty and no results states to Vault tab

* [PM-6825] Add unit tests for vault popup items service

* [PM-6825] Negate noFilteredResults placeholder

* [PM-6825] Cleanup new Vault components

* [PM-6825] Move new components into its own module

* [PM-6825] Fix missing button type

* [PM-6825] Add booleanAttribute to showAutofill input

* [PM-6825] Replace empty refresh BehaviorSubject with Subject

* [PM-6825] Combine *ngIfs for vault list items container

* [PM-6825] Use popup-section-header component

* [PM-6825] Use small variant for icon buttons

* [PM-6825] Use anchor tag for vault items

* [PM-6825] Consolidate vault-list-items-container to include list item component functionality directly

* [PM-6825] Add Tailwind classes to new Vault icon

* [PM-6825] Remove temporary header comment

* [PM-6825] Fix auto fill suggestion font size and padding

* [PM-6825] Use tailwind for vault icon styling

* [PM-6825] Add libs/angular to tailwind.config content

* [PM-6825] Cleanup missing i18n

* [PM-6825] Make VaultV2 standalone and cleanup Browser App module

* [PM-6825] Use explicit type annotation

* [PM-6825] Use property binding instead of interpolation

* [PM-7076] Create settings-v2.component (#9213)

* Create settings-v2.component

Create new settings page
Add routing based on extension refresh flag

* Wrap anchors around the icons

* Add account-switcher to settings page

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>

* [PM-8289] Inline menu content script does not update when user updates setting (#9279)

* [PM-8289] Inline menu content script does not update whne user updates setting

* [PM-8289] Fixing issue present within Jest tests

* [PM-8289] Triggering a reload of autofill scripts when a user logs into their account

---------

Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Shane Melton <smelton@bitwarden.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants