Fix: Search functionality in the body tab#1335
Merged
Merged
Conversation
This commit fixes the search functionality in the body tab by: - Including all items in the search instead of filtering only body line items. - Correcting the index used for search and highlighting. - Clearing spans when the query string is not found. - Resetting highlight on all items. These changes ensure that the search works correctly and highlights the correct lines in the body tab.
Contributor
Author
A7ak
reviewed
Jan 3, 2025
| backgroundSpanColor, | ||
| foregroundSpanColor, | ||
| ) | ||
| println("listOfSearchQuery: $listOfSearchQuery") |
This commit removes a print statement that was used for debugging purposes. The print statement was located in the `TransactionPayloadFragment` class and was used to print the value of the `listOfSearchQuery` variable.
cortinico
reviewed
Jan 3, 2025
cortinico
left a comment
Member
There was a problem hiding this comment.
Thanks for sending this over
| foregroundColor: Int, | ||
| ): List<SearchItemBodyLine> { | ||
| val listOfSearchItems = arrayListOf<SearchItemBodyLine>() | ||
| items.filterIsInstance<TransactionPayloadItem.BodyLineItem>() |
Contributor
Author
There was a problem hiding this comment.
since TransactionPayloadItem have mutliple types, filtering the BodyLineItem subtype and then indexing them does't really give us the actual index of the item in the whole list. As a result wrong line with wrong search query gets highlighted, also the primary reason for the crash as well
Member
There was a problem hiding this comment.
Ahh I understand. Thanks for clarifying 👍
cortinico
approved these changes
Jan 3, 2025
| foregroundColor: Int, | ||
| ): List<SearchItemBodyLine> { | ||
| val listOfSearchItems = arrayListOf<SearchItemBodyLine>() | ||
| items.filterIsInstance<TransactionPayloadItem.BodyLineItem>() |
Member
There was a problem hiding this comment.
Ahh I understand. Thanks for clarifying 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit addresses and fixes the search functionality in the body (issue reference) tab by:
These changes ensure that the search works correctly and highlights the correct lines in the body tab.
📷 Screenshots
output.mp4
📄 Context
📝 Changes
📎 Related PR
🚫 Breaking
🛠️ How to test
⏱️ Next steps