diff --git a/frontend/src/App.css b/frontend/src/App.css index 1a7e57d1af98..629e85a77833 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -3,16 +3,4 @@ @tailwind components; @tailwind utilities; -.tab { - padding: 10px 20px; - cursor: pointer; - color: #ffffffb3; - font-weight: light; - position: relative; -} - -.tab.active { - color: #fff; - font-weight: bolder; -} diff --git a/frontend/src/assets/assistant-avatar.png b/frontend/src/assets/assistant-avatar.png deleted file mode 100644 index a2dbbb2c784e..000000000000 Binary files a/frontend/src/assets/assistant-avatar.png and /dev/null differ diff --git a/frontend/src/assets/logo.png b/frontend/src/assets/logo.png new file mode 100644 index 000000000000..985f6d981466 Binary files /dev/null and b/frontend/src/assets/logo.png differ diff --git a/frontend/src/assets/user-avatar.png b/frontend/src/assets/user-avatar.png deleted file mode 100644 index 07e555464ebf..000000000000 Binary files a/frontend/src/assets/user-avatar.png and /dev/null differ diff --git a/frontend/src/components/Browser.test.tsx b/frontend/src/components/Browser.test.tsx index 83d094e18a25..d22656b4876c 100644 --- a/frontend/src/components/Browser.test.tsx +++ b/frontend/src/components/Browser.test.tsx @@ -4,7 +4,7 @@ import { renderWithProviders } from "../../test-utils"; describe("Browser", () => { it("renders a message if no screenshotSrc is provided", () => { - const { getByText } = renderWithProviders(, { + const { getByText, getByAltText } = renderWithProviders(, { preloadedState: { browser: { url: "https://example.com", @@ -13,7 +13,8 @@ describe("Browser", () => { }, }); - expect(getByText(/no screenshot available/i)).toBeInTheDocument(); + expect(getByText(/OpenDevin: Code Less, Make More./i)).toBeInTheDocument(); + expect(getByAltText(/Blank Page/i)).toBeInTheDocument(); }); it("renders the url and a screenshot", () => { diff --git a/frontend/src/components/Browser.tsx b/frontend/src/components/Browser.tsx index f8eed0e190c3..f56f7b4d2614 100644 --- a/frontend/src/components/Browser.tsx +++ b/frontend/src/components/Browser.tsx @@ -1,7 +1,24 @@ import React from "react"; import { useSelector } from "react-redux"; +import { HiOutlineMagnifyingGlass } from "react-icons/hi2"; +import { HiCursorClick } from "react-icons/hi"; import { RootState } from "#/store"; +import logo from "../assets/logo.png"; + +function BlankPage(): JSX.Element { + return ( +
+ Blank Page +
+ + OpenDevin: Code Less, Make More. + +
+
+ ); +} + function Browser(): JSX.Element { const { url, screenshotSrc } = useSelector( (state: RootState) => state.browser, @@ -13,19 +30,17 @@ function Browser(): JSX.Element { : `data:image/png;base64,${screenshotSrc || ""}`; return ( -
-
-
{url}
+
+
+ {url} +
+
+ {screenshotSrc ? ( + Browser Screenshot + ) : ( + + )}
- {screenshotSrc ? ( - Browser Screenshot - ) : ( -
No screenshot available.
- )}
); } diff --git a/frontend/src/index.css b/frontend/src/index.css index f2342c5c2483..072a974ea97a 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -25,22 +25,3 @@ code { font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } - -.editor-accordion h2 > button{ - padding: 0; -} - -.editor-accordion-title { - color: var(--bg-neutral-400) !important; -} - -.editor-accordion-content { - padding-top: 0 !important; - padding-bottom: 0 !important; -} - -.editor-accordion-content ul { - display: flex; - flex-direction: column; - justify-content: center; -} diff --git a/frontend/src/state/browserSlice.ts b/frontend/src/state/browserSlice.ts index 80cebb0c16fc..618802b7a751 100644 --- a/frontend/src/state/browserSlice.ts +++ b/frontend/src/state/browserSlice.ts @@ -4,8 +4,7 @@ export const initialState = { // URL of browser window (placeholder for now, will be replaced with the actual URL later) url: "https://github.com/OpenDevin/OpenDevin", // Base64-encoded screenshot of browser window (placeholder for now, will be replaced with the actual screenshot later) - screenshotSrc: - "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN0uGvyHwAFCAJS091fQwAAAABJRU5ErkJggg==", + screenshotSrc: "", }; export const browserSlice = createSlice({ diff --git a/opendevin/action/browse.py b/opendevin/action/browse.py index 9f99ef16ba01..58639e984e47 100644 --- a/opendevin/action/browse.py +++ b/opendevin/action/browse.py @@ -26,6 +26,13 @@ async def run(self, controller: 'AgentController') -> BrowserOutputObservation: browser = await p.chromium.launch() page = await browser.new_page() response = await page.goto(asked_url) + try: + # domcontentloaded: Wait for the DOMContentLoaded event to be fired. + # load: Wait for the load event to be fired. + # networkidle: Wait until there are no more network connections + await page.wait_for_load_state('networkidle', timeout=3000) + except TimeoutError: + pass # content = await page.content() inner_text = await page.evaluate('() => document.body.innerText') screenshot_bytes = await page.screenshot(full_page=True) @@ -40,10 +47,7 @@ async def run(self, controller: 'AgentController') -> BrowserOutputObservation: ) except Exception as e: return BrowserOutputObservation( - content=str(e), - screenshot='', - error=True, - url=asked_url + content=str(e), screenshot='', error=True, url=asked_url ) @property