OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

issue/4599-Add cursor position information on the bottom of the editor area

Open STF-Zero opened this issue 1 year ago • 2 comments

End-user friendly description of the problem this fixes or functionality that this introduces

  • [ ] Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions

This PR add information of where the cursor is inside the editor area. The information goes like:

Row: 4, Column: 15

Here's the implementation: image

I've made this change by only modifying

frontend/src/routes/_oh.app._index/route.tsx

  1. Added a variable cursorPosition to record the position of the cursor. image

  2. Dynamically change cursorPosition in handleEditorDidMount and pass it as a parameter to the sub-component code-editor-component. image

frontend/src/components/features/editor/code-editor-component.tsx

  1. Add the cursorPosition member variable to the component definition. image

  2. Add a div element to the return statement to display the cursorPosition information. image


Link of any specific issues this addresses、 source issue issue#4599

STF-Zero avatar Dec 03 '24 11:12 STF-Zero

This PR is renewable version of the previous PR 4626 which had been admitted by maintainers while there was some conflicts when some new changes were added into the project. I didn't work on those conflicts but made a new fork of the up-to-date project to devote my change. Hope this message can help you!

STF-Zero avatar Dec 03 '24 11:12 STF-Zero

@amanape has this on his list to take a look.

mamoodi avatar Dec 05 '24 17:12 mamoodi

Just need to take care of those linting errors and we're all set to merge

amanape avatar Dec 06 '24 05:12 amanape

I've solved linting errors by adapting my code to a prettier style ~

STF-Zero avatar Dec 06 '24 07:12 STF-Zero

@STF-Zero minor issue with this PR. The display actually overlays on top of the file. https://github.com/All-Hands-AI/OpenHands/issues/5438

mamoodi avatar Dec 06 '24 17:12 mamoodi

I may revert this PR because the display makes the file a little hard to see. And I want to get a release out.

mamoodi avatar Dec 06 '24 17:12 mamoodi

Sorry @STF-Zero we had to revert this, because of this https://github.com/All-Hands-AI/OpenHands/issues/5438

Happy to take it back in when it's fixed!

enyst avatar Dec 06 '24 18:12 enyst

All right, I'll try to fix it soon~

STF-Zero avatar Dec 07 '24 08:12 STF-Zero