Copilot commented on code in PR #6263:
URL: https://github.com/apache/texera/pull/6263#discussion_r3540561662


##########
frontend/src/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.html:
##########
@@ -173,8 +173,9 @@ <h2 class="page-title">Computing Units</h2>
             *ngIf="showJvmMemorySlider"
             class="jvm-memory-slider"
             [nzMarks]="jvmMemoryMarks"
-            [nzMin]="jvmMemorySteps[0] || 2"
+            [nzMin]="0"
             [nzMax]="jvmMemoryMax"
+            [nzTipFormatter]="jvmMemoryTipFormatter"
             [nzStep]="null"
             [nzIncluded]="false"

Review Comment:
   [nzStep] is still set to null (continuous slider), but the model value is 
now treated as an array index. nz-slider can emit non-integer values when 
nzStep is null, which would make jvmMemorySteps[index] undefined and prevent 
selectedJvmMemorySize/tooltip from updating reliably. Set the slider step to 1 
(discrete indices) or otherwise snap/round the value before indexing.



##########
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.html:
##########
@@ -339,8 +339,9 @@
             *ngIf="showJvmMemorySlider"
             class="jvm-memory-slider"
             [nzMarks]="jvmMemoryMarks"
-            [nzMin]="jvmMemorySteps[0] || 2"
+            [nzMin]="0"
             [nzMax]="jvmMemoryMax"
+            [nzTipFormatter]="jvmMemoryTipFormatter"
             [nzStep]="null"
             [nzIncluded]="false"

Review Comment:
   [nzStep] is still set to null (continuous slider), but the model value is 
now treated as an array index. nz-slider can emit non-integer values when 
nzStep is null, which would make jvmMemorySteps[index] undefined and prevent 
selectedJvmMemorySize/tooltip from updating reliably. Set the slider step to 1 
(discrete indices) or otherwise snap/round the value before indexing.



##########
frontend/src/app/dashboard/component/user/user-computing-unit/user-computing-unit.component.ts:
##########
@@ -270,19 +270,27 @@ export class UserComputingUnitComponent implements OnInit 
{
     this.resetJvmMemorySlider();
   }
 
-  onJvmMemorySliderChange(value: number): void {
-    // Ensure the value is one of the valid steps
-    const validStep = findNearestValidStep(value, this.jvmMemorySteps);
-    this.jvmMemorySliderValue = validStep;
-    this.selectedJvmMemorySize = `${validStep}G`;
+  onJvmMemorySliderChange(index: number): void {
+    // The value is now the index in the steps array
+    const validStep = this.jvmMemorySteps[index];
+    if (validStep !== undefined) {
+      this.jvmMemorySliderValue = index;
+      this.selectedJvmMemorySize = `${validStep}G`;
+    }

Review Comment:
   This file still imports findNearestValidStep from computing-unit.util.ts, 
but the slider handler no longer uses it after switching to index-based values. 
Please remove the unused import to avoid TS/ESLint unused-import failures and 
keep the dependency list accurate.



##########
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts:
##########
@@ -661,18 +667,20 @@ export class ComputingUnitSelectionComponent implements 
OnInit {
     this.resetJvmMemorySlider();
   }
 
-  onJvmMemorySliderChange(value: number): void {
-    // Ensure the value is one of the valid steps
-    const validStep = findNearestValidStep(value, this.jvmMemorySteps);
-    this.jvmMemorySliderValue = validStep;
-    this.selectedJvmMemorySize = `${validStep}G`;
+  onJvmMemorySliderChange(index: number): void {
+    // The value is now the index in the steps array
+    const validStep = this.jvmMemorySteps[index];
+    if (validStep !== undefined) {
+      this.jvmMemorySliderValue = index;
+      this.selectedJvmMemorySize = `${validStep}G`;
+    }

Review Comment:
   This file still imports findNearestValidStep from computing-unit.util.ts, 
but the slider handler no longer uses it after switching to index-based values. 
Please remove the unused import to avoid TS/ESLint unused-import failures and 
keep the dependency list accurate.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to