[MBL-19179][Parent] - Implement search in Grades page#3363
[MBL-19179][Parent] - Implement search in Grades page#3363kdeakinstructure merged 6 commits intomasterfrom
Conversation
Add a real-time search feature to the Parent app Grades page that allows filtering assignments by name. Changes: - Added search icon next to filter icon in Grades card - Implemented collapsible search field below "Based on graded assignments" section - Search filters assignments automatically when query reaches 3 characters - Added real-time filtering as user types (no need to press enter) - Enhanced SearchBar component with onQueryChange callback for instant text updates - Added search state management in GradesUiState and GradesViewModel - Filter logic removes empty assignment groups from results Technical details: - SearchBar now supports onQueryChange callback that fires on every keystroke - ViewModel caches unfiltered items and applies filtering based on search query - Case-insensitive search across assignment names - Toggling search restores full unfiltered list refs: MBL-19179 affects: Parent release note: Added search functionality to Grades page 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Review Summary
This PR adds search functionality to the Grades screen, which is a valuable feature addition. The implementation follows the project's MVVM architecture and Compose patterns well. Here are my findings:
✅ Strengths
- Clean separation of concerns with proper action handling
- Good use of existing
SearchBarcomponent with an appropriate extension - Proper state management through
UiState - Accessibility considerations (touch target sizes, content descriptions)
- Test tags added for UI testing
🔍 Key Recommendations
Performance: Consider debouncing the search input to avoid filtering on every keystroke, especially for large assignment lists.
Code Quality: Extract the magic number 3 (minimum search length) into a named constant.
UX Enhancement: Consider auto-focusing the search field when expanded to improve user experience.
State Management: The allItems field could be moved into UiState for better encapsulation, though the current approach works.
📋 Testing Considerations
- Verify search works correctly with special characters and various locales
- Test performance with large assignment lists (100+ items)
- Ensure state is properly restored on configuration changes
- Verify search behaves correctly when combined with sorting/filtering options
Overall, this is solid work! The inline comments provide specific suggestions for improvement. Nice job maintaining consistency with the project's architecture and patterns.
libs/pandautils/src/main/java/com/instructure/pandautils/compose/composables/SearchBar.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesViewModel.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesViewModel.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesScreen.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesScreen.kt
Outdated
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesViewModel.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesViewModel.kt
Show resolved
Hide resolved
📊 Code Coverage Report✅ Student
|
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesScreen.kt
Outdated
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesScreen.kt
Outdated
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesViewModel.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesScreen.kt
Outdated
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/features/grades/GradesViewModel.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I checked the search functionality in another app as well, and I’d suggest two improvements:
- After orientation change, if the keyboard wasn’t open before, it shouldn’t open automatically.
- After orientation change, the cursor jumps to the beginning of the search bar, but it should stay at the end.
See attached video.

Summary
This PR implements a real-time search feature for the Parent app Grades page, allowing users to filter assignments by name. The search functionality includes automatic filtering as the user types (with a minimum of 3 characters) and provides instant visual feedback.
Test plan
refs: MBL-19179
affects: Parent
release note: Added search functionality to Grades page
Changes
UI Components
Search Behavior
Technical Implementation
onQueryChangecallback for keystroke-level updatessearchQuery,isSearchExpanded)ToggleSearch,SearchQueryChanged)Screenshots
Note: Screenshots should be added showing the search icon, expanded search field, and filtered results
Checklist
🤖 Generated with Claude Code