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

Add support for Swiftkey Android keyboard #25

Merged
merged 11 commits into from
May 21, 2024

Conversation

QADavidCalvo
Copy link
Contributor

Add support for Swiftkey Android keyboard

πŸ”οΈ Description

Added Swiftkey to the available Android keyboards and the Xpaths needed to map the keys and suggestions.

🧐 Context

Only for Android devices (emulators and real devices)

⚠️ Side-effects / Shortcomings

  • The numbers layout is not mapped

βœ… How this was tested ?

  • To map the keys run kebbie show_layout -K swiftkey
  • To evaluate the keyboard run kebbie evaluate -K swiftkey

🌱 Checklist

  • Perform self-review of my own code
  • Comment the code, particularly in hard-to-understand areas
  • Update the documentation accordingly to the new code
  • Lint / format the code
  • Update existing tests / Add new tests
  • Tests are passing locally

@QADavidCalvo QADavidCalvo requested a review from astariul May 16, 2024 07:26
@QADavidCalvo QADavidCalvo self-assigned this May 16, 2024
@astariul
Copy link
Collaborator

astariul commented May 16, 2024

Lint is not passing because the Emulator constructor is too complex. I think it's okay to just put # noqa: C901, similarly to here :

def type_characters(self, characters: str): # noqa: C901

Then you can fix the other issues with :

pip install ruff
ruff . --fix
ruff format . --fix

For the tests, they are all passing, but since you added some line of code, the coverage decreased from 78% to 77%. The job is failing because the coverage badge wasn't updated.

You can update it with :

pip install -e .[test]
pytest
coverage-badge -o .github/badges/coverage.svg -f

(I should really find a better way, if the badge could update automatically that would be great...)

@QADavidCalvo
Copy link
Contributor Author

Fixed

@astariul
Copy link
Collaborator

@QADavidCalvo I took the liberty to push code in your PR. Summary of my changes :

  • Fix key detections for Swiftkey (some key were misnamed in the XML document, had to rename them to match our other keyboards)
  • Some swiftkey-specific behavior
  • Add documentation on how to install swiftkey and set it up

Copy link
Collaborator

@astariul astariul left a comment

Choose a reason for hiding this comment

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

LGTM !

Feel free to merge this PR :)

On my side, I'll run the tests on swiftkey, and I'll upload the results in the leaderboard (in another PR)

@QADavidCalvo QADavidCalvo merged commit 386f9e5 into main May 21, 2024
2 checks passed
@QADavidCalvo QADavidCalvo deleted the android-swiftkey-support branch May 21, 2024 07:40
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.

2 participants