Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Web: Place controls in accordion

Kilian Lieret0419f5379818
diff --git a/sweagent/frontend/src/components/controls/LRunControl.js b/sweagent/frontend/src/components/controls/LRunControl.js
index 91a98bb3..6c249bee 100644
--- a/sweagent/frontend/src/components/controls/LRunControl.js
+++ b/sweagent/frontend/src/components/controls/LRunControl.js
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+import Accordion from 'react-bootstrap/Accordion';
function LRunControl({isComputing, isConnected, handleStop, handleSubmit, setDataPath, setTestRun, dataPath, testRun, repoPath, setRepoPath}) {
const [psType, setPsType] = useState('gh');
@@ -32,26 +33,38 @@ function LRunControl({isComputing, isConnected, handleStop, handleSubmit, setDat
return (
<div>
- <div class="input-group mb-3">
- <span class="input-group-text" >Problem statement</span>
- <select class="form-select" aria-label="Select problem statement type" onChange={handlePsTypeChange} >
- <option value="gh" selected>GitHub issue URL</option>
- <option value="write">Write here</option>
- </select>
- {getPsInput()}
- </div>
- <div class="input-group mb-3">
- <span class="input-group-text" >Repository path</span>
- <input type="text" class="form-control" placeholder="Enter repository path (optional when using GitHub issue)" onChange={(e) => setRepoPath(e.target.value)} />
- </div>
- {/* <input type="text" value={dataPath} onChange={(e) => setDataPath(e.target.value)} required /> */}
- <label htmlFor="test_run">Test run (no LM queries)</label>
- <input type="checkbox" checked={testRun} onChange={(e) => setTestRun(e.target.checked)} />
- <div class="btn-group" role="group" aria-label="Basic example">
- <button type="submit" className="btn btn-primary" onClick={handleSubmit} disabled={isComputing || !isConnected}>Run</button>
- <button onClick={handleStop} disabled={!isComputing} className="btn btn-primary">Stop</button>
- </div>
+ <Accordion defaultActiveKey="0">
+ <Accordion.Item eventKey="0">
+ <Accordion.Header>Problem statement</Accordion.Header>
+ <Accordion.Body>
+ <div class="input-group mb-3">
+ <span class="input-group-text" >Problem statement</span>
+ <select class="form-select" aria-label="Select problem statement type" onChange={handlePsTypeChange} >
+ <option value="gh" selected>GitHub issue URL</option>
+ <option value="write">Write here</option>
+ </select>
+ {getPsInput()}
+ </div>
+ <div class="input-group mb-3">
+ <span class="input-group-text" >Repository path</span>
+ <input type="text" class="form-control" placeholder="Enter repository path (optional when using GitHub issue)" onChange={(e) => setRepoPath(e.target.value)} />
+ </div>
+ {/* <input type="text" value={dataPath} onChange={(e) => setDataPath(e.target.value)} required /> */}
+ </Accordion.Body>
+ </Accordion.Item>
+ <Accordion.Item eventKey="1">
+ <Accordion.Header>Extra settings</Accordion.Header>
+ <Accordion.Body>
+ <label htmlFor="test_run">Test run (no LM queries)</label>
+ <input type="checkbox" checked={testRun} onChange={(e) => setTestRun(e.target.checked)} />
+ </Accordion.Body>
+ </Accordion.Item>
+ </Accordion>
+ <div class="btn-group" role="group" aria-label="Basic example">
+ <button type="submit" className="btn btn-primary" onClick={handleSubmit} disabled={isComputing || !isConnected}>Run</button>
+ <button onClick={handleStop} disabled={!isComputing} className="btn btn-primary">Stop</button>
</div>
+ </div>
);
}