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

Fix EcoBraille and Lilly braille display drivers #17635

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

LeonarddeR
Copy link
Collaborator

@LeonarddeR LeonarddeR commented Jan 21, 2025

Link to issue number:

Fixes #17502

Summary of the issue:

In #15386, support was added for numRows and numCols on braille displays. Setting numCells explicitly would also set numCols.
In #17011, we're much more relying on numCols and numRows.

For the eco braille and Lilli drivers, numCells was implemented by overriding _get_numCells. However this way, the setter of numCells would never be called and therefore numCols would always be 0.

Description of user facing changes

Fix braille for Eco Braille and Lilli displays.

Description of development approach

  1. When calculating display dimensions on the braille handler, when display.numRows is 1, use display.numCells instead of display.numCols. This accounts for cases where numCells is implemented and numRows/numCols are not.
  2. Worked around the ZeroDevisionError when getting windowStartPost on a buffer
  3. Initialize _windowRowBufferOffsets to [(0, 0)] instead of [(0, 1)]. The latter suggests that the window contains one cell, which is not the case. @michaelDCurran you might want to check this.

Testing strategy:

@dreinn Could you test this?

Known issues with pull request:

I think we should consider a long term strategy for numCells vs. numRows/numCols. We still need to account for both now, which isn't ideal and could easily go wrong as proved.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

@LeonarddeR LeonarddeR requested a review from a team as a code owner January 21, 2025 16:02
@AppVeyorBot
Copy link

See test results for failed build of commit a1fe5402ce

Copy link
Member

@SaschaCowley SaschaCowley 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 this, @LeonarddeR. Just a docstring change while you're here. Plus we need to wait on real world testing.

source/braille.py Outdated Show resolved Hide resolved
@LeonarddeR
Copy link
Collaborator Author

I asked an additional review from @michaelDCurran since this touches his code. I'd like to make sure that he agrees with changing the initial state of _windowRowBufferOffsets to reflect that there's no window.

Co-authored-by: Sascha Cowley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Braille doesn't work on last snapshot
3 participants