π OpenHands: AI-Driven Development
Revert "issue/4599-Add cursor position information on the bottom of the editor area" (#5440)
mamoodie4e3e4abb854
diff --git a/frontend/src/components/features/editor/code-editor-component.tsx b/frontend/src/components/features/editor/code-editor-component.tsxindex cc7e402480..673010b8b1 100644--- a/frontend/src/components/features/editor/code-editor-component.tsx+++ b/frontend/src/components/features/editor/code-editor-component.tsx@@ -9,13 +9,11 @@ import { useSaveFile } from "#/hooks/mutation/use-save-file";interface CodeEditorComponentProps {onMount: EditorProps["onMount"];isReadOnly: boolean;- cursorPosition: { line: number; column: number };}function CodeEditorComponent({onMount,isReadOnly,- cursorPosition,}: CodeEditorComponentProps) {const { t } = useTranslation();const {@@ -102,22 +100,15 @@ function CodeEditorComponent({}return (- <div className="flex flex-col h-full w-full">- <div className="flex-grow min-h-0 relative">- <Editor- data-testid="code-editor"- path={selectedPath ?? undefined}- defaultValue=""- value={selectedPath ? fileContent : undefined}- onMount={onMount}- onChange={handleEditorChange}- options={{ readOnly: isReadOnly }}- />- </div>- <div className="p-2 text-neutral-500 flex-shrink-0 absolute bottom-1">- Row: {cursorPosition.line}, Column: {cursorPosition.column}- </div>- </div>+ <Editor+ data-testid="code-editor"+ path={selectedPath ?? undefined}+ defaultValue=""+ value={selectedPath ? fileContent : undefined}+ onMount={onMount}+ onChange={handleEditorChange}+ options={{ readOnly: isReadOnly }}+ />);}diff --git a/frontend/src/routes/_oh.app._index/route.tsx b/frontend/src/routes/_oh.app._index/route.tsxindex cf2fdb59da..1a8528f61a 100644--- a/frontend/src/routes/_oh.app._index/route.tsx+++ b/frontend/src/routes/_oh.app._index/route.tsx@@ -1,4 +1,4 @@-import React, { useState } from "react";+import React from "react";import { useSelector } from "react-redux";import { useRouteError } from "react-router";import { editor } from "monaco-editor";@@ -32,7 +32,6 @@ function CodeEditor() {} = useFiles();const [fileExplorerIsOpen, setFileExplorerIsOpen] = React.useState(true);- const [cursorPosition, setCursorPosition] = useState({ line: 1, column: 1 });const editorRef = React.useRef<editor.IStandaloneCodeEditor | null>(null);const { mutate: saveFile } = useSaveFile();@@ -54,13 +53,6 @@ function CodeEditor() {},});monaco.editor.setTheme("oh-dark");-- e.onDidChangeCursorPosition((ee) => {- setCursorPosition({- line: ee.position.lineNumber,- column: ee.position.column,- });- });};const agentState = useSelector(@@ -111,7 +103,6 @@ function CodeEditor() {<CodeEditorComponentonMount={handleEditorDidMount}isReadOnly={!isEditingAllowed}- cursorPosition={cursorPosition}/></div></div>