Added search function with previous and next result #14600
Closed
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.
Intent
This pull request addresses the enhancement request for the data viewer in RStudio. It introduces the ability to search for text within the viewer, allowing users to quickly navigate to specific occurrences of text within the data. This feature improves usability and productivity for users who need to find specific information within large datasets.
Approach
The approach taken involves adding a search box to the data viewer interface. When the user enters text into the search box and presses Enter, the viewer navigates to the first occurrence of the text, displaying some preceding and following rows for context. Additionally, "Next" and "Previous" buttons are provided to allow users to easily navigate between occurrences of the searched text.
Automated Tests
This change includes automated unit tests to ensure that the search functionality works as expected. Unit tests cover scenarios such as searching for text, navigating to the next and previous occurrences, and handling edge cases like reaching the end of the dataset.
QA Notes
To validate this change, QA should perform the following steps:
Open the data viewer by executing View(iris) in the R console.
Enter text into the search box and press Enter.
Verify that the viewer navigates to the first occurrence of the searched text and displays surrounding rows.
Click on the "Next" and "Previous" buttons to navigate between occurrences.
Test edge cases, such as searching for text that doesn't exist in the dataset.
This change has a moderate level of risk, as it involves modifying the behavior of a core feature in RStudio. QA should pay attention to any unexpected behavior or performance issues.
Documentation
Documentation has been added to the user guide to explain how to use the new search functionality in the data viewer. This information will help users understand how to leverage this feature to improve their data analysis workflows.
Checklist
NEWS.md