From 214c916911f54dea278e2b3ce51be47f9185858f Mon Sep 17 00:00:00 2001 From: Raja-Hamid Date: Mon, 10 Aug 2026 18:57:47 +0500 Subject: [PATCH] refactor(frontend): remove two pieces of unreachable code Both branches were shown by mutation testing to have no observable effect: each mutation survived while the surrounding behaviour was under test. - hugging-face-image-upload: the "Selected image" fallback rendered inside *ngIf="previewSrc", which is non-empty only when hasImage is true, and displayFileName already returns "Uploaded image" in exactly that case, so the right-hand side of the || could never be evaluated. - drag-drop: the !jointLink guard was subsumed by the !linkView guard that follows it, since paper.findViewByModel(undefined) returns undefined rather than throwing. Regression tests pin both behaviours -- the rendered preview label, and skipping a link that exists in the Texera graph but has no model in the JointJS paper -- and stay green across the removals. Closes #7459 --- .../hugging-face-image-upload.component.html | 2 +- ...ugging-face-image-upload.component.spec.ts | 28 +++++++++++++++++++ .../drag-drop/drag-drop.service.spec.ts | 24 ++++++++++++++++ .../service/drag-drop/drag-drop.service.ts | 4 --- 4 files changed, 53 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/workspace/component/hugging-face-image-upload/hugging-face-image-upload.component.html b/frontend/src/app/workspace/component/hugging-face-image-upload/hugging-face-image-upload.component.html index 441c71f9c93..dbaa931295b 100644 --- a/frontend/src/app/workspace/component/hugging-face-image-upload/hugging-face-image-upload.component.html +++ b/frontend/src/app/workspace/component/hugging-face-image-upload/hugging-face-image-upload.component.html @@ -32,7 +32,7 @@ [src]="previewSrc" alt="Uploaded Hugging Face task input" />
- {{ displayFileName || "Selected image" }} + {{ displayFileName }}