-
Notifications
You must be signed in to change notification settings - Fork 107
[MBL-19179][Parent] - Implement search in Grades page #3363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MBL-19179][Parent] - Implement search in Grades page #3363
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
adamNagy56
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA +1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Screen_Recording_20251111_112137_Canvas.Parent.mp4
adamNagy56
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA +1

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