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 style: Remove three dots; move logos into window bars

Kilian Lieretc33e5aeaba04
diff --git a/sweagent/frontend/src/components/MacBar.js b/sweagent/frontend/src/components/MacBar.js
index d55d85b9..6c426ada 100644
--- a/sweagent/frontend/src/components/MacBar.js
+++ b/sweagent/frontend/src/components/MacBar.js
@@ -1,75 +1,22 @@
import React from "react";
-import PropTypes from "prop-types"; // Import PropTypes for type checking
-import ExpandIcon from "./utils/icons/ExpandIcon";
import "../static/macbar.css";
-import Message from './AgentMessage';
const MacBar = ({
- setIsTyping,
- text,
- barStyle,
- messageStyle,
- setIsExpanded,
- expandFillColor,
- showIcons = true,
+ title,
+ logo,
+ dark=false
}) => {
- const messageStyleMerged = {
- backgroundColor: "transparent",
- boxShadow: "none",
- color: "black",
- left: "50%",
- fontSize: "smaller",
- margin: "0em",
- padding: "0em",
- position: 'absolute',
- transform: "translateX(-50%)",
- ...messageStyle,
- };
-
- const expandFillColorMerged = expandFillColor || "#ffffff";
-
+ const darkClass = dark ? 'dark' : '';
return (
- <div className="mac-window-top-bar" style={barStyle}>
- {showIcons && (
- <>
- <div className="mac-window-button close"></div>
- <div className="mac-window-button minimize"></div>
- <div className="mac-window-button expand"></div>
- </>
- )}
- {!!text && <Message
- animationType="type"
- id="title"
- onTypingEnd={() => {setIsTyping(false)}}
- onTypingStart={() => {setIsTyping(true)}}
- style={messageStyleMerged}
- text={text}
- />}
- {!!setIsExpanded && (
- <div
- style={{ position: "absolute", right: "0em" }}
- onClick={() => setIsExpanded((prev) => !prev)}
- >
- {/* <ExpandIcon
- fillColor={expandFillColorMerged}
- height="0.75em"
- style={{ marginRight: "0.75em", cursor: "pointer" }}
- /> */}
+ <div className={`mac-window-top-bar ${darkClass}`} >
+ <div id="label">
+ <img src={logo} alt="title" />
+ <span>{title}</span>
</div>
- )}
</div>
);
};
-// PropTypes for type checking
-MacBar.propTypes = {
- setIsTyping: PropTypes.func,
- text: PropTypes.string,
- barStyle: PropTypes.object,
- messageStyle: PropTypes.object,
- setIsExpanded: PropTypes.func,
-};
-
export default MacBar;
diff --git a/sweagent/frontend/src/components/panels/AgentFeed.js b/sweagent/frontend/src/components/panels/AgentFeed.js
index a46bfb6d..2c9b5478 100644
--- a/sweagent/frontend/src/components/panels/AgentFeed.js
+++ b/sweagent/frontend/src/components/panels/AgentFeed.js
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import Message from '../AgentMessage';
-
+import MacBar from '../MacBar';
import workspaceLogo from '../../assets/panel_icons/workspace.png';
import "../../static/agentFeed.css";
@@ -17,10 +17,10 @@ const AgentFeed = ({ feed, title, highlightedStep, handleMouseEnter, handleMouse
return (
<div id="agentFeed" className="agentFeed">
- <div id="label">
- <img src={workspaceLogo} alt="workspace" />
- <span>{title}</span>
- </div>
+ <MacBar
+ title="Agent"
+ logo={workspaceLogo}
+ />
<div className="scrollableDiv" ref={selfRef} >
<div className="innerDiv">
{feed.map((item, index) => (
diff --git a/sweagent/frontend/src/components/panels/EnvFeed.js b/sweagent/frontend/src/components/panels/EnvFeed.js
index cb793df1..a640660b 100644
--- a/sweagent/frontend/src/components/panels/EnvFeed.js
+++ b/sweagent/frontend/src/components/panels/EnvFeed.js
@@ -18,14 +18,9 @@ const EnvFeed = ({ feed, title, highlightedStep, handleMouseEnter, handleMouseL
return (
<div id="envFeed" className="envFeed">
- <div id="label">
- <img src={terminalLogo} alt="workspace" />
- <span>{title}</span>
- </div>
<MacBar
- barStyle={{ height: "2em" }}
- expandFillColor={"black"}
- setIsExpanded={setIsTerminalExpanded}
+ title="Terminal"
+ logo={terminalLogo}
/>
<div className="scrollableDiv" ref={selfRef} >
<div className="innerDiv">
diff --git a/sweagent/frontend/src/components/panels/LogPanel.js b/sweagent/frontend/src/components/panels/LogPanel.js
index 881901f0..b1bdc4ba 100644
--- a/sweagent/frontend/src/components/panels/LogPanel.js
+++ b/sweagent/frontend/src/components/panels/LogPanel.js
@@ -28,22 +28,10 @@ const LogPanel = ({ logs, logsRef, setIsTerminalExpanded}) => {
return (
<div id="logPanel" className="logPanel">
- <div id="label">
- <img src={editorLogo} alt="log panel" />
- <span>Logs</span>
- </div>
<MacBar
- barStyle={{
- background: "linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.9))",
- height: "2em",
- }}
- messageStyle={{
- color: "white",
- fontSize: "smaller",
- marginBottom: "0.1em",
- }}
- expandFillColor={"black"}
- setIsExpanded={setIsTerminalExpanded}
+ logo={editorLogo}
+ title="Log file"
+ dark={true}
/>
<div className="scrollableDiv" ref={logsRef} style={{ backgroundColor: "#1e1e1e" }}>
<div className="innerDiv">
diff --git a/sweagent/frontend/src/static/agentFeed.css b/sweagent/frontend/src/static/agentFeed.css
index f355b563..f726459a 100644
--- a/sweagent/frontend/src/static/agentFeed.css
+++ b/sweagent/frontend/src/static/agentFeed.css
@@ -1,3 +1,4 @@
-.agentFeed .scrollableDiv {
- border-radius: 0.5em !important;
+.agentFeed {
+ grid-column: 1 / 3;
+ grid-row: 1 / 5;
}
\ No newline at end of file
diff --git a/sweagent/frontend/src/static/macbar.css b/sweagent/frontend/src/static/macbar.css
index 57dc7fdf..3e0199d8 100644
--- a/sweagent/frontend/src/static/macbar.css
+++ b/sweagent/frontend/src/static/macbar.css
@@ -1,40 +1,37 @@
.mac-window-top-bar {
background-color: #f0f0f0;
- background-image: linear-gradient(to bottom, #f0f0f0, #e0e0e0); /* Gradient effect */
+ background-image: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
border-top-left-radius: 0.5em;
border-top-right-radius: 0.5em;
- height: 1.2em;
+ height: 2em;
position: relative;
display: flex;
align-items: center;
}
-.mac-window-button {
- width: 0.5em;
- height: 0.5em;
- border-radius: 50%;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- cursor: pointer;
- transition: background-color 0.3s ease;
-}
+.mac-window-top-bar.dark {
+ background-color: #f0f0f0;
+ background-image: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.9));
+ /* messageStyle={{
+ color: "white",
+ fontSize: "smaller",
+ marginBottom: "0.1em",
+ }} */
-.mac-window-button:hover {
- background-color: #c0c0c0;
}
-.mac-window-button.close {
- background-color: #FF605C;
- left: 0.5em;
-}
+#label {
+ align-items: center;
+ display: flex;
+ margin: 1em 1em 1em 0.5em;
-.mac-window-button.minimize {
- background-color: #FFBD44;
- left: 1.25em;
-}
+ img {
+ height: 1em;
+ margin-right: 0.4em;
+ }
-.mac-window-button.expand {
- background-color: #00CA4E;
- left: 2em;
+ span {
+ color: #888;
+ font-size: smaller;
+ }
}
\ No newline at end of file
diff --git a/sweagent/frontend/src/static/run.css b/sweagent/frontend/src/static/run.css
index c65baf4a..c067c041 100644
--- a/sweagent/frontend/src/static/run.css
+++ b/sweagent/frontend/src/static/run.css
@@ -85,30 +85,10 @@
margin: 0.2em;
overflow: auto;
- #label {
- align-items: center;
- display: flex;
- margin-bottom: 0.25em;
-
- img {
- height: 1em;
- margin-right: 0.25em;
- }
-
- span {
- color: #888;
- font-size: smaller;
- }
- }
- }
- .agentFeed {
- grid-column: 1 / 3;
- grid-row: 1 / 5;
- .scrollableDiv {
- background-color: #ebe6ea;
- }
}
+
+
.envFeed {
grid-column: 3 / 6;