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

boxes: Disable cycling using arrow keys if recipient is invalid. #864

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Jul 4, 2021

  1. refactor: boxes: Extract footer notification for invalid stream/email.

    This commit refactors code for footer notification in case of invalid
    recipients (stream/email) in the WriteBox to separate helper function.
    This prevents duplication of code and allows reusability.
    
    This function can now be called with a custom error message that will
    be displayed in the footer after appending it with a common typeahead
    suggestion.
    
    Tests amended.
    zee-bit committed Jul 4, 2021
    Configuration menu
    Copy the full SHA
    b6cb5a5 View commit details
    Browse the repository at this point in the history
  2. boxes: Disable cycling using arrow keys if recipient is invalid.

    This commit disables cycling from the recipient box (Stream/To) using
    arrow keys if recipient is invalid, similar to Tab. Cycling through the
    MessageBox now looks for arrow key events and checks for recipient
    name's validity when losing focus from the recipient box. This should
    prevent sending of messages to incorrect recipients.
    
    Currently, only RIGHT and DOWN keypress is monitored since these are the
    only keys that can cycle focus from the recipients box to some other box,
    according to our current MessageBox layout.
    
    Tests amended.
    
    Fixes zulip#779.
    zee-bit committed Jul 4, 2021
    Configuration menu
    Copy the full SHA
    6fca74f View commit details
    Browse the repository at this point in the history