shabados / presenter

Desktop app for presenting the Shabad OS Database on projectors, TVs, and live streams
https://shabados.com
MIT License
19 stars 15 forks source link

fix(frontend/controller): highlight full words in search #536

Closed Jujhaar closed 4 years ago

Jujhaar commented 4 years ago

Summary

Closes https://github.com/ShabadOS/desktop/issues/170. Does not change the functionality of the firstLetter search highlighting, but modifies the fullWord highlighting to include all words.

Before

Screen Shot 2020-05-15 at 11 45 09 PM

After

Screen Shot 2020-05-18 at 10 14 55 AM Screen Shot 2020-05-18 at 12 38 39 PM

First letter search still works

Screen Shot 2020-05-18 at 6 13 22 PM

How was this tested?

I tried the following test cases:

  1. The word is at the beginning of the line.
  2. The word comes after a special character.
  3. Trailing space after the word.
  4. Ensured the first letter search still worked. Happy to write unit tests once those exist (if they exist).

Other odds and ends

I didn't have permission to push to ShabadOS/desktop, and the instructions said to fork so that's what I did - not as well versed with the workflow so let me know if I need to change things.

I was surprised at some of the eslint rules, especially the extraneous semicolon being enforced.

Reviewers

@saihaj @Harjot1Singh

Jujhaar commented 4 years ago

@Harjot1Singh PTAL

Jujhaar commented 4 years ago

@Harjot1Singh ready for another look!