1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[PM-17094] - Vault and Collection filters pop in after Vault content causing content to shift (#13165)

* add loading state service for vault list filters and apply to vault

* remove call to delay and requestAnimationFrame

* use shareReplay

* update loading state to also check for filters

* remove reassignment

* add sharereplay to vault list filters.
This commit is contained in:
Jordan Aasen
2025-02-20 14:18:43 -08:00
committed by GitHub
parent 598139d739
commit 63927d6ba1
3 changed files with 11 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
import { CommonModule } from "@angular/common"; import { CommonModule } from "@angular/common";
import { Component } from "@angular/core"; import { Component } from "@angular/core";
import { ReactiveFormsModule } from "@angular/forms"; import { ReactiveFormsModule } from "@angular/forms";
import { combineLatest, map } from "rxjs"; import { combineLatest, map, shareReplay } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module"; import { JslibModule } from "@bitwarden/angular/jslib.module";
import { ChipSelectComponent } from "@bitwarden/components"; import { ChipSelectComponent } from "@bitwarden/components";
@@ -34,6 +34,7 @@ export class VaultListFiltersComponent {
folders, folders,
}; };
}), }),
shareReplay({ bufferSize: 1, refCount: false }),
); );
constructor(private vaultPopupListFiltersService: VaultPopupListFiltersService) {} constructor(private vaultPopupListFiltersService: VaultPopupListFiltersService) {}

View File

@@ -86,7 +86,12 @@ export class VaultV2Component implements OnInit, AfterViewInit, OnDestroy {
protected favoriteCiphers$ = this.vaultPopupItemsService.favoriteCiphers$; protected favoriteCiphers$ = this.vaultPopupItemsService.favoriteCiphers$;
protected remainingCiphers$ = this.vaultPopupItemsService.remainingCiphers$; protected remainingCiphers$ = this.vaultPopupItemsService.remainingCiphers$;
protected loading$ = this.vaultPopupItemsService.loading$; protected allFilters$ = this.vaultPopupListFiltersService.allFilters$;
protected loading$ = combineLatest([this.vaultPopupItemsService.loading$, this.allFilters$]).pipe(
map(([itemsLoading, filters]) => itemsLoading || !filters),
shareReplay({ bufferSize: 1, refCount: true }),
);
protected newItemItemValues$: Observable<NewItemInitialValues> = protected newItemItemValues$: Observable<NewItemInitialValues> =
this.vaultPopupListFiltersService.filters$.pipe( this.vaultPopupListFiltersService.filters$.pipe(
@@ -111,8 +116,6 @@ export class VaultV2Component implements OnInit, AfterViewInit, OnDestroy {
protected VaultStateEnum = VaultState; protected VaultStateEnum = VaultState;
private allFilters$ = this.vaultPopupListFiltersService.allFilters$;
constructor( constructor(
private vaultPopupItemsService: VaultPopupItemsService, private vaultPopupItemsService: VaultPopupItemsService,
private vaultPopupListFiltersService: VaultPopupListFiltersService, private vaultPopupListFiltersService: VaultPopupListFiltersService,

View File

@@ -255,6 +255,7 @@ export class VaultPopupListFiltersService {
}), }),
]; ];
}), }),
shareReplay({ refCount: true, bufferSize: 1 }),
); );
/** /**
@@ -330,6 +331,7 @@ export class VaultPopupListFiltersService {
), ),
); );
}), }),
shareReplay({ refCount: true, bufferSize: 1 }),
); );
/** /**
@@ -366,6 +368,7 @@ export class VaultPopupListFiltersService {
map((collections) => map((collections) =>
collections.nestedList.map((c) => this.convertToChipSelectOption(c, "bwi-collection")), collections.nestedList.map((c) => this.convertToChipSelectOption(c, "bwi-collection")),
), ),
shareReplay({ refCount: true, bufferSize: 1 }),
); );
/** Organizations, collection, folders filters. */ /** Organizations, collection, folders filters. */