Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit fb7a32e

Browse files
authored
Merge pull request #302 from transformerlab/fix/remove-auto-append-functionality
remove all mentions of auto-append semi-colon
2 parents d8fc212 + 3ef4638 commit fb7a32e

File tree

7 files changed

+18
-133
lines changed

7 files changed

+18
-133
lines changed

frontend/src/components/modals/AzureClusterLauncher.tsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { useAuth } from "../../context/AuthContext";
2626
import { useNotification } from "../NotificationSystem";
2727
import CostCreditsDisplay from "../widgets/CostCreditsDisplay";
2828
import YamlConfigurationSection from "./YamlConfigurationSection";
29-
import { appendSemicolons } from "../../utils/commandUtils";
3029

3130
interface AzureClusterLauncherProps {
3231
open: boolean;
@@ -130,7 +129,6 @@ const AzureClusterLauncher: React.FC<AzureClusterLauncherProps> = ({
130129
const { addNotification } = useNotification();
131130
const [availableCredits, setAvailableCredits] = useState<number | null>(null);
132131
const [estimatedCost, setEstimatedCost] = useState<number>(0);
133-
const [autoAppendSemicolons, setAutoAppendSemicolons] = useState(false);
134132

135133
// Storage bucket state
136134
const [storageBuckets, setStorageBuckets] = useState<StorageBucket[]>([]);
@@ -462,14 +460,8 @@ const AzureClusterLauncher: React.FC<AzureClusterLauncherProps> = ({
462460
} else {
463461
// Form mode: use regular form data
464462
formData.append("cluster_name", clusterName);
465-
const finalCommand = autoAppendSemicolons
466-
? appendSemicolons(command)
467-
: command;
468-
const finalSetup = autoAppendSemicolons
469-
? appendSemicolons(setup)
470-
: setup;
471-
formData.append("command", finalCommand);
472-
if (finalSetup) formData.append("setup", finalSetup);
463+
formData.append("command", command);
464+
if (setup) formData.append("setup", setup);
473465
formData.append("cloud", "azure");
474466

475467
// Handle instance_type, region, zone, and disk_space based on template selection
@@ -651,18 +643,9 @@ disk_space: 100`}
651643
/>
652644
<Typography level="body-xs" sx={{ mt: 0.5 }}>
653645
Use <code>;</code> at the end of each line for
654-
separate commands, or enable auto-append.
646+
separate commands
655647
</Typography>
656648
</FormControl>
657-
<FormControl>
658-
<Checkbox
659-
label="Auto-append ; to each non-empty line"
660-
checked={autoAppendSemicolons}
661-
onChange={(e) =>
662-
setAutoAppendSemicolons(e.target.checked)
663-
}
664-
/>
665-
</FormControl>
666649

667650
{/* Docker Image (moved out of Advanced) */}
668651
<FormControl>

frontend/src/components/modals/InstanceLauncher.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { Rocket } from "lucide-react";
2727
import { buildApiUrl, apiFetch } from "../../utils/api";
2828
import { useNotification } from "../NotificationSystem";
2929
import YamlConfigurationSection from "./YamlConfigurationSection";
30-
import { appendSemicolons } from "../../utils/commandUtils";
3130

3231
interface InstanceLauncherProps {
3332
open: boolean;
@@ -50,7 +49,6 @@ const InstanceLauncher: React.FC<InstanceLauncherProps> = ({
5049
const [loading, setLoading] = useState(false);
5150
const [error, setError] = useState("");
5251
const { addNotification } = useNotification();
53-
const [autoAppendSemicolons, setAutoAppendSemicolons] = useState(false);
5452

5553
// Template-related state
5654
const [templates, setTemplates] = useState<any[]>([]);
@@ -208,11 +206,8 @@ const InstanceLauncher: React.FC<InstanceLauncherProps> = ({
208206
formData.append("cluster_name", clusterName);
209207
formData.append("command", "echo 'Instance launched successfully'");
210208

211-
const finalSetup = autoAppendSemicolons
212-
? appendSemicolons(setupCommand)
213-
: setupCommand;
214-
if (finalSetup) {
215-
formData.append("setup", finalSetup);
209+
if (setupCommand) {
210+
formData.append("setup", setupCommand);
216211
}
217212

218213
if (latestUploadedDirPath) {

frontend/src/components/modals/JobLauncher.tsx

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { Rocket } from "lucide-react";
2727
import { buildApiUrl, apiFetch } from "../../utils/api";
2828
import { useNotification } from "../NotificationSystem";
2929
import YamlConfigurationSection from "./YamlConfigurationSection";
30-
import { appendSemicolons } from "../../utils/commandUtils";
3130

3231
interface JobLauncherProps {
3332
open: boolean;
@@ -55,7 +54,6 @@ const JobLauncher: React.FC<JobLauncherProps> = ({
5554
const [loading, setLoading] = useState(false);
5655
const [error, setError] = useState("");
5756
const { addNotification } = useNotification();
58-
const [autoAppendSemicolons, setAutoAppendSemicolons] = useState(false);
5957

6058
// Template-related state
6159
const [templates, setTemplates] = useState<any[]>([]);
@@ -217,16 +215,10 @@ const JobLauncher: React.FC<JobLauncherProps> = ({
217215
} else {
218216
// Form mode: use regular form data
219217
formData.append("cluster_name", clusterName);
220-
const finalCommand = autoAppendSemicolons
221-
? appendSemicolons(command)
222-
: command;
223-
const finalSetup = autoAppendSemicolons
224-
? appendSemicolons(setupCommand)
225-
: setupCommand;
226-
formData.append("command", finalCommand);
227-
228-
if (finalSetup) {
229-
formData.append("setup", finalSetup);
218+
formData.append("command", command);
219+
220+
if (setupCommand) {
221+
formData.append("setup", setupCommand);
230222
}
231223

232224
if (uploadedDirPath) {
@@ -392,14 +384,6 @@ const JobLauncher: React.FC<JobLauncherProps> = ({
392384
</Typography>
393385
</FormControl>
394386

395-
{/* <FormControl sx={{ mb: 2 }}>
396-
<Checkbox
397-
label="Auto-append ; to each non-empty line"
398-
checked={autoAppendSemicolons}
399-
onChange={(e) => setAutoAppendSemicolons(e.target.checked)}
400-
/>
401-
</FormControl> */}
402-
403387
{/* Number of Nodes - always visible since templates don't include this */}
404388
<FormControl sx={{ mb: 2 }}>
405389
<FormLabel>Number of Nodes</FormLabel>

frontend/src/components/modals/ReserveNodeModal.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { useNotification } from "../NotificationSystem";
2424
import { useAuth } from "../../context/AuthContext";
2525
import CostCreditsDisplay from "../widgets/CostCreditsDisplay";
2626
import YamlConfigurationSection from "./YamlConfigurationSection";
27-
import { appendSemicolons } from "../../utils/commandUtils";
2827

2928
interface DockerImage {
3029
id: string;
@@ -71,7 +70,6 @@ const ReserveNodeModal: React.FC<ReserveNodeModalProps> = ({
7170
const [templates, setTemplates] = useState<any[]>([]);
7271
const [selectedTemplateId, setSelectedTemplateId] = useState<string>("");
7372
const [showAdvanced, setShowAdvanced] = useState(false);
74-
const [autoAppendSemicolons, setAutoAppendSemicolons] = useState(false);
7573
const selectedTemplate = React.useMemo(
7674
() => templates.find((t) => t.id === selectedTemplateId),
7775
[templates, selectedTemplateId],
@@ -248,10 +246,7 @@ const ReserveNodeModal: React.FC<ReserveNodeModalProps> = ({
248246
formData.append("cluster_name", finalClusterName);
249247
formData.append("node_pool_name", clusterName); // Pass the node pool name separately
250248
formData.append("command", command);
251-
const finalSetup = autoAppendSemicolons
252-
? appendSemicolons(setup)
253-
: setup;
254-
if (finalSetup) formData.append("setup", finalSetup);
249+
if (setup) formData.append("setup", setup);
255250
formData.append("cloud", "ssh"); // Always use SSH mode
256251
if (cpus) formData.append("cpus", cpus);
257252
if (memory) formData.append("memory", memory);
@@ -424,18 +419,10 @@ const ReserveNodeModal: React.FC<ReserveNodeModalProps> = ({
424419
/>
425420
<Typography level="body-xs" sx={{ mt: 0.5 }}>
426421
Use <code>;</code> at the end of each line for separate
427-
commands, or enable auto-append.
422+
commands
428423
</Typography>
429424
</FormControl>
430425

431-
<FormControl sx={{ mb: 2 }}>
432-
<Checkbox
433-
label="Auto-append ; to each non-empty line"
434-
checked={autoAppendSemicolons}
435-
onChange={(e) => setAutoAppendSemicolons(e.target.checked)}
436-
/>
437-
</FormControl>
438-
439426
<FormControl sx={{ mb: 2 }}>
440427
<FormLabel>Docker Image (optional)</FormLabel>
441428
{loadingImages ? (

frontend/src/components/modals/RunPodClusterLauncher.tsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { useAuth } from "../../context/AuthContext";
2525
import { useNotification } from "../NotificationSystem";
2626
import CostCreditsDisplay from "../widgets/CostCreditsDisplay";
2727
import YamlConfigurationSection from "./YamlConfigurationSection";
28-
import { appendSemicolons } from "../../utils/commandUtils";
2928

3029
interface RunPodConfig {
3130
api_key: string;
@@ -116,7 +115,6 @@ const RunPodClusterLauncher: React.FC<RunPodClusterLauncherProps> = ({
116115
const [isLoadingGpuTypes, setIsLoadingGpuTypes] = useState(false);
117116
const [availableCredits, setAvailableCredits] = useState<number | null>(null);
118117
const [estimatedCost, setEstimatedCost] = useState<number>(0);
119-
const [autoAppendSemicolons, setAutoAppendSemicolons] = useState(false);
120118

121119
// Docker image state
122120
const [dockerImages, setDockerImages] = useState<DockerImage[]>([]);
@@ -294,14 +292,8 @@ const RunPodClusterLauncher: React.FC<RunPodClusterLauncherProps> = ({
294292
} else {
295293
// Form mode: use regular form data
296294
formData.append("cluster_name", clusterName);
297-
const finalCommand = autoAppendSemicolons
298-
? appendSemicolons(command)
299-
: command;
300-
const finalSetup = autoAppendSemicolons
301-
? appendSemicolons(setup)
302-
: setup;
303-
formData.append("command", finalCommand);
304-
if (finalSetup) formData.append("setup", finalSetup);
295+
formData.append("command", command);
296+
if (setup) formData.append("setup", setup);
305297
formData.append("cloud", "runpod");
306298
if (selectedGpuFullString)
307299
formData.append("accelerators", selectedGpuFullString);
@@ -402,17 +394,9 @@ disk_space: 100`}
402394
minRows={2}
403395
/>
404396
<Typography level="body-xs" sx={{ mt: 0.5 }}>
405-
Use <code>;</code> at the end of each line for separate
406-
commands, or enable auto-append.
397+
Use <code>;</code> at the end of each line for separate commands
407398
</Typography>
408399
</FormControl>
409-
<FormControl>
410-
<Checkbox
411-
label="Auto-append ; to each non-empty line"
412-
checked={autoAppendSemicolons}
413-
onChange={(e) => setAutoAppendSemicolons(e.target.checked)}
414-
/>
415-
</FormControl>
416400

417401
{/* Docker Image (moved out of Advanced) */}
418402
<Card variant="outlined">

frontend/src/components/modals/SubmitJobModal.tsx

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
import { buildApiUrl, apiFetch } from "../../utils/api";
2222
import { useNotification } from "../NotificationSystem";
2323
import { parseResourcesString } from "../../utils/resourceParser";
24-
import { appendSemicolons } from "../../utils/commandUtils";
2524

2625
interface SubmitJobModalProps {
2726
open: boolean;
@@ -53,7 +52,6 @@ const SubmitJobModal: React.FC<SubmitJobModalProps> = ({
5352
const [numNodes, setNumNodes] = useState<string>("1");
5453
const [loading, setLoading] = useState(false);
5554
const { addNotification } = useNotification();
56-
const [autoAppendSemicolons, setAutoAppendSemicolons] = useState(false);
5755

5856
// Template-related state
5957
const [templates, setTemplates] = useState<any[]>([]);
@@ -220,13 +218,8 @@ const SubmitJobModal: React.FC<SubmitJobModalProps> = ({
220218
// Step 2: Submit job with uploaded directory path
221219
const formData = new FormData();
222220

223-
const finalCommand = autoAppendSemicolons
224-
? appendSemicolons(command)
225-
: command;
226-
const finalSetup = autoAppendSemicolons ? appendSemicolons(setup) : setup;
227-
228-
formData.append("command", finalCommand);
229-
if (finalSetup) formData.append("setup", finalSetup);
221+
formData.append("command", command);
222+
if (setup) formData.append("setup", setup);
230223

231224
// Apply template values if selected, otherwise use form values
232225
const finalCpus = cpus || tpl.cpus;
@@ -373,8 +366,7 @@ const SubmitJobModal: React.FC<SubmitJobModalProps> = ({
373366
disabled={isClusterLaunching}
374367
/>
375368
<Typography level="body-xs" sx={{ mt: 0.5 }}>
376-
Multiple commands supported. End each line with <code>;</code>{" "}
377-
or enable the option below.
369+
Multiple commands supported. End each line with <code>;</code>
378370
</Typography>
379371
</FormControl>
380372

@@ -389,19 +381,10 @@ const SubmitJobModal: React.FC<SubmitJobModalProps> = ({
389381
/>
390382
<Typography level="body-xs" sx={{ mt: 0.5 }}>
391383
Use <code>;</code> at the end of each line for separate
392-
commands, or enable auto-append.
384+
commands
393385
</Typography>
394386
</FormControl>
395387

396-
<FormControl sx={{ mb: 2 }}>
397-
<Checkbox
398-
label="Auto-append ; to each non-empty line"
399-
checked={autoAppendSemicolons}
400-
onChange={(e) => setAutoAppendSemicolons(e.target.checked)}
401-
disabled={isClusterLaunching}
402-
/>
403-
</FormControl>
404-
405388
<FormControl sx={{ mb: 2 }}>
406389
<FormLabel>Attach project directory (optional)</FormLabel>
407390
<input

frontend/src/utils/commandUtils.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)