Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move cursor with new characters in Scribe commands #286

Closed
2 tasks done
andrewtavis opened this issue Jan 1, 2025 · 10 comments
Closed
2 tasks done

Move cursor with new characters in Scribe commands #286

andrewtavis opened this issue Jan 1, 2025 · 10 comments
Assignees
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@andrewtavis
Copy link
Member

Terms

Description

In the current state of Scribe-Android the cursor for the command bar appears after the prompt for the command and before the placeholder text. When the user starts typing the placeholder text disappears as it should, but the cursor is behind the new text. Ideally the command bar cursor should function like a normal cursor and should be the right most character within the command bar text input. See the video below for how it works in Scribe-iOS:

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-01-02.at.00.20.41.mp4

Contribution

Happy to assist with work on this and review it once it's finished! 😊

@andrewtavis andrewtavis added feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 1, 2025
@smalik2811
Copy link
Contributor

Hey @andrewtavis I would like to work on this issue 😊

@angrezichatterbox
Copy link
Member

Thanks for taking it up @smalik2811

Feel free to ask any queries you might have here :)

@andrewtavis
Copy link
Member Author

Thanks for your vested interest in the project, @smalik2811! :)

@smalik2811
Copy link
Contributor

Hi @andrewtavis ,

Thanks for your kind words! I'm really enjoying contributing to this project. It's been a fantastic learning experience, and I'm grateful for the support and guidance I've received from the community.

I'm excited to continue contributing and see where this project goes!

Best regards,

@andrewtavis
Copy link
Member Author

Feel free to start this one at your convenience, @smalik2811! Looking forward to getting this up and running so the command UX can start taking the next level :)

Here's the function that we use in iOS, btw:

func insertPriorToCursor(char: String) -> String {
    return substring(toIdx: count - 1) + char + commandCursor
  }

Let us know if there are any questions!

@smalik2811
Copy link
Contributor

Thanks for sharing the iOS code snippet. It's helpful to see how that's being handled. I'll use this as a starting point and let you know, if I run into any questions.

@smalik2811
Copy link
Contributor

Hi @andrewtavis I have been working on the bug and the desired functionality has been achieved.

Draft.Cursor.webm

However I am facing 2 issues related to the UI.

  1. I am using the same UTF symbol "\u2502" for the commandCursor variable as in the iOS App. However there is an unexpected gap between the last letter and the cursor in the android app.

Gap indicated using a red highlighter

  1. The command bar before the placeholder text is an actual view with a width of 1.5dp. When the text is inserted, it is hidden and a cursor symbol is displayed at the end of the text. Currently, the view and the cursor seems slightly different, but the difference might become more noticiable if the user increases the font size of their device.

Image

Could you please guide about on how to deal with these issues?

@angrezichatterbox
Copy link
Member

angrezichatterbox commented Jan 22, 2025

Would it be helpful to adjust the padding of the text dynamically according to whether the user types content or not ? If I am thinking right the space is coming from the text padding that is being continuously extended as we type more.

@andrewtavis
Copy link
Member Author

Would be great if @angrezichatterbox's suggestion can work! Let us know and we can go from there. Great work, @smalik2811!

@smalik2811
Copy link
Contributor

Would it be helpful to adjust the padding of the text dynamically according to whether the user types content or not ? If I am thinking right the space is coming from the text padding that is being continuously extended as we type more.

Hi @angrezichatterbox, Thankyou for the help. However I tried typing the command character in the notepad it turns out, it is the character "\u2502" that contains the space as part of it. I explored some other characters to replace it and found the new character "\u239C" which seems to better fit the situation. Here is a screenshot of usage of both the characters.

Line 1 is the old character.
Line 2 is the new character.

Image

Here is the latest preview:

Fix.Presentation.mp4

@github-project-automation github-project-automation bot moved this from Todo to Done in Scribe Board Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Archived in project
Development

No branches or pull requests

3 participants