Skip to content

Conversation

@bhanu-dev82
Copy link
Collaborator

Contributor checklist


Description

This PR addresses issue #480 by extracting the complex backspace and deletion logic from GeneralKeyboardIME into a dedicated BackspaceHandler class

Changes:

  • Created BackspaceHandler.kt to encapsulate:
      Single character deletion.
      Word-by-word deletion logic.
      Command bar specific deletion.
      Repeating delete state management.
    
  • Refactored GeneralKeyboardIME.kt to delegate deletion tasks to the new handler.
    
  • Updated visibility of necessary internal IME properties to allow access by the handler.
    

Benefits:

  • Reduces GeneralKeyboardIME file size by ~200 lines.
    
  • Improves readability by separating deletion logic from service lifecycle.
    
  • Makes deletion logic easier to unit test in isolation.
    

Testing:

  • Verified standard backspace works.
    
  • Verified "word-by-word" deletion setting works.
    
  • Verified backspace behavior inside the Scribe Command Bar (Translate/Conjugate modes).
    
  • Verified long-press repeating deletion.
    

Related issue

Closes #480

@github-actions
Copy link

Thank you for the pull request! 💙

The Scribe-Android team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest that you use the Element client as well as Element X for a mobile app, and definitely join the General and Android rooms once you're in. Also consider attending our bi-weekly Saturday dev syncs. It'd be great to meet you 😊

Note

Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

@github-actions
Copy link

github-actions bot commented Jan 21, 2026

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • Tests for changes have been written and the unit test, linting and formatting workflows within the PR checks do not indicate new errors in the files changed

    • Tests may need to be reran as they're at times not deterministic
  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

Copy link
Member

@angrezichatterbox angrezichatterbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @bhanu-dev82

Everything looks good to me. Great work

@angrezichatterbox
Copy link
Member

@andrewtavis I will merge this in :)

@angrezichatterbox angrezichatterbox merged commit b2220dc into scribe-org:main Jan 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move backspace handling from GeneralKeyboardIME to dedicated BackspaceHandler

2 participants