Skip to content

Refactor search into a stateful class #3285

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

Merged
merged 2 commits into from
Dec 29, 2022

Conversation

srawlins
Copy link
Member

@srawlins srawlins commented Dec 28, 2022

Fixes #3272 by changing initialize into a stateful class. Really helps with readability, promotion, etc.

This PR has a few little changes as well:

  • rename 3 distinct variables named input which each represent something totally different
  • add support for pressing 'Escape' in the search box
  • fix result collection on search.html page
  • selectedElement was a nullable int, with null meaning "nothing is selected." I found a nullable hint very awkward to work with, seeing lots of expressions like selectedElement! - 1. I was able to make this a non-nullable int, with -1 meaning "nothing is selected," and some helper functions like an extension on int called isBlurred.

@srawlins srawlins requested a review from keertip December 28, 2022 05:53
Copy link
Collaborator

@keertip keertip left a comment

Choose a reason for hiding this comment

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

👍

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.

Refactor search into class with fields maintaining state.
2 participants