From 5ebacb032106541268e51036c7736f51ebf1579d Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 18:29:28 +0000 Subject: [PATCH] Remove CDR workaround since SendSearchComponent is now OnPush With SendSearchComponent migrated to OnPush change detection, the workaround that forced change detection via ChangeDetectorRef is no longer needed. This commit removes: - ChangeDetectorRef import and injection - The effect() in constructor that called markForCheck() - The detectChanges() call in addSend() Co-authored-by: Will Martin --- .../app/tools/send-v2/send-v2.component.ts | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/apps/desktop/src/app/tools/send-v2/send-v2.component.ts b/apps/desktop/src/app/tools/send-v2/send-v2.component.ts index 0df71a78412..271418ae5b2 100644 --- a/apps/desktop/src/app/tools/send-v2/send-v2.component.ts +++ b/apps/desktop/src/app/tools/send-v2/send-v2.component.ts @@ -1,14 +1,6 @@ // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore -import { - ChangeDetectorRef, - Component, - computed, - effect, - inject, - signal, - viewChild, -} from "@angular/core"; +import { Component, computed, inject, signal, viewChild } from "@angular/core"; import { toSignal } from "@angular/core/rxjs-interop"; import { combineLatest, map, switchMap, lastValueFrom } from "rxjs"; @@ -92,7 +84,6 @@ export class SendV2Component { private dialogService = inject(DialogService); private toastService = inject(ToastService); private logService = inject(LogService); - private cdr = inject(ChangeDetectorRef); protected readonly useDrawerEditMode = toSignal( this.configService.getFeatureFlag$(FeatureFlag.DesktopUiMigrationMilestone2), @@ -137,17 +128,6 @@ export class SendV2Component { { initialValue: null }, ); - constructor() { - // WORKAROUND: Force change detection when data updates - // This is needed because SendSearchComponent (shared lib) hasn't migrated to OnPush yet - // and doesn't trigger CD properly when search/add operations complete - // TODO: Remove this once SendSearchComponent migrates to OnPush (tracked in CL-764) - effect(() => { - this.filteredSends(); - this.cdr.markForCheck(); - }); - } - protected readonly selectedSendType = computed(() => { const action = this.action(); @@ -171,8 +151,6 @@ export class SendV2Component { } else { this.action.set(Action.Add); this.sendId.set(null); - - this.cdr.detectChanges(); void this.addEditComponent()?.resetAndLoad(); } }