You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/08/30 03:36:02 UTC

(texera) branch gh-readonly-queue/main/pr-8121-c91af99646ce3e57e6a9eb06bf4d707941292957 created (now 8a33b689e0)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-8121-c91af99646ce3e57e6a9eb06bf4d707941292957
in repository https://gitbox.apache.org/repos/asf/texera.git


      at 8a33b689e0 refactor(frontend): remove unused computing unit code (#8121)

This branch includes the following new commits:

     new 8a33b689e0 refactor(frontend): remove unused computing unit code (#8121)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(texera) 01/01: refactor(frontend): remove unused computing unit code (#8121)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-8121-c91af99646ce3e57e6a9eb06bf4d707941292957
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 8a33b689e08eabf0c14b95cd06c0dc255fe78b81
Author: Eugene Gu <eu...@outlook.com>
AuthorDate: Sun Aug 30 03:35:48 2026 +0000

    refactor(frontend): remove unused computing unit code (#8121)
    
    ### What changes were proposed in this PR?
    
    Remove unreachable code from the computing-unit selection component
    without changing user-facing behavior:
    
    - remove `getButtonText`; the template already renders the selected unit
    name or `Connect` directly;
    - remove `getCpuUnit` and `getMemoryUnit`; the live metrics template
    uses `getCpuLimitUnit` and `getMemoryLimitUnit`;
    - remove the test case and assertions that only preserved those unused
    helpers; and
    - remove `.button-content i.ant-dropdown-trigger`, which cannot match
    because ng-zorro attaches `ant-dropdown-trigger` to the outer dropdown
    button, not the inner icon.
    
    Existing DOM tests continue to cover both trigger-button states. No
    screenshots are included because the removed methods and selector were
    not part of the rendered behavior, so there is no visible UI change.
    
    ### Any related issues, documentation, discussions?
    
    Closes #8119
    
    ### How was this PR tested?
    
    The targeted component suite passed before the refactor (109 tests) and
    after it (108 tests). The removed test was the dedicated test for the
    unused `getButtonText` helper; live DOM coverage remains unchanged.
    
    ```shell
    NODE_OPTIONS="--localstorage-file=/private/tmp/texera-vitest-localstorage-root" \
      yarn test --include \
      src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts
    
    yarn prettier --check \
      src/app/workspace/component/power-button/computing-unit-selection.component.ts \
      src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts \
      src/app/workspace/component/power-button/computing-unit-selection.component.scss
    
    yarn eslint \
      src/app/workspace/component/power-button/computing-unit-selection.component.ts \
      src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts
    
    git diff --check
    ```
    
    Results:
    
    - targeted component tests: 108/108 passed;
    - Prettier check: passed;
    - ESLint check: passed; and
    - `git diff --check`: passed.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    Co-authored by: OpenAI Codex (GPT-5.6-Sol)
---
 .../power-button/computing-unit-selection.component.scss |  4 ----
 .../computing-unit-selection.component.spec.ts           |  9 ---------
 .../power-button/computing-unit-selection.component.ts   | 16 ----------------
 3 files changed, 29 deletions(-)

diff --git a/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.scss b/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.scss
index 1213a861a5..1bae9769d7 100644
--- a/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.scss
+++ b/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.scss
@@ -164,10 +164,6 @@
   i {
     flex-shrink: 0;
   }
-
-  i.ant-dropdown-trigger {
-    margin-left: auto;
-  }
 }
 
 .unit-name-text,
diff --git a/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts b/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts
index ef8b4f02a6..715c776827 100644
--- a/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts
+++ b/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts
@@ -1112,13 +1112,6 @@ describe("PowerButtonComponent", () => {
   });
 
   describe("status helpers", () => {
-    it("getButtonText returns 'Connect' with no selection and the unit name otherwise", () => {
-      component.selectedComputingUnit = null;
-      expect(component.getButtonText()).toBe("Connect");
-      component.selectedComputingUnit = makeComputingUnit({ name: "My Unit" });
-      expect(component.getButtonText()).toBe("My Unit");
-    });
-
     it("computeStatus maps selection + status onto badge states", () => {
       component.selectedComputingUnit = null;
       expect(component.computeStatus()).toBe("processing");
@@ -1480,8 +1473,6 @@ describe("PowerButtonComponent", () => {
       expect(component.getSharedMemorySize()).toBe("64Mi");
       expect(component.getCpuLimitUnit()).toBe("CPU");
       expect(component.getMemoryLimitUnit()).toBe("Gi");
-      expect(component.getCpuUnit()).toBe("Cores");
-      expect(component.getMemoryUnit()).toBe("Gi");
     });
 
     it("returns zero usage values and percentages when metrics are unavailable", () => {
diff --git a/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts b/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts
index b633e6eca3..06da3e69ab 100644
--- a/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts
+++ b/frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts
@@ -301,14 +301,6 @@ export class ComputingUnitSelectionComponent implements OnInit {
     return this.selectedComputingUnit != null && this.selectedComputingUnit.status === "Running";
   }
 
-  getButtonText(): string {
-    if (!this.selectedComputingUnit) {
-      return "Connect";
-    } else {
-      return this.selectedComputingUnit.computingUnit.name;
-    }
-  }
-
   computeStatus(): string {
     if (!this.selectedComputingUnit) {
       return "processing";
@@ -565,14 +557,6 @@ export class ComputingUnitSelectionComponent implements OnInit {
     return getComputingUnitMemoryStatus(this.getMemoryPercentage());
   }
 
-  getCpuUnit(): string {
-    return this.getCpuLimitUnit() === "CPU" ? "Cores" : this.getCpuLimitUnit();
-  }
-
-  getMemoryUnit(): string {
-    return this.getMemoryLimitUnit() === "" ? "B" : this.getMemoryLimitUnit();
-  }
-
   /**
    * Returns a descriptive tooltip for a specific unit's status
    */