Signal-Android
Signal-Android copied to clipboard
Highlight all the message search matches
It is expected that when a user search for a message, that all the matches within the same messages are highlighted (if there are more than one match) not just the first match. This is also consistent with how the search in the desktop app is implemented
First time contributor checklist
- [X] I have read how to contribute to this project
- [X] I have signed the Contributor License Agreement
Contributor checklist
- [X] I am following the Code Style Guidelines
- [X] I have tested my contribution on these devices:
- Pixel 2, API 35
- Pixel tablet
- [X] My contribution is fully baked and ready to be merged as is
- [X] I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the
Fixes #1234syntax
Description
This commit changes the highlight strategy for message search from STRICT to MATCH_ALL. As a user, it is expected that if a message contains more than one occurrence of the key I am searching for, that all the found keys be highlighted not only the first one (which is indeed the behavior of the signal desktop app)
Hey @greyson-signal :) is there any thing I could do to move the merging of this PR forward?
I am curious about the value add of this feature for mobile. The search feature is to surface a text message. Once the search finds the first result search has fulfilled its job. By adding the Match all option, would it increase search result's memory footprint? Cell phones have an average of less than 4gb of RAM, and a foreground app has an expectation (As of May 2025) to use 200-500mb of RAM.
I forgot that I opened this one line PR 😅
@gabefair I am not sure that highlighting multiple words in a single message as opposed to highlighting one word in a single message puts that much pressure on memory. Even for mobile devices. Why do you think this additional highlights will consume that much memory?
The reason I added this change is that this is how other Apps like whatsapp and telegram do it (and I would assume if this produces memory problems and was insignificant UX change they wouldn't have done it :thinking:
But aside from the other Apps, this is also how signal on the desktop does it and this change will make it consistent with how it is on the desktop app
I was surprised it didn't work this way when trying to find/jump to something specific... While I found what was looking for, this pull request would have spead that up...
My apologies, PR's sometimes get lost as we triage a lot of feedback on a daily basis. This looks reasonable to me, and it'll go into 7.49. Thanks!