Skip to content

Conversation

@kdeakinstructure
Copy link
Contributor

@kdeakinstructure kdeakinstructure commented Nov 3, 2025

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

  1. Open the Parent app and navigate to the Grades page
  2. Verify a magnifying glass icon appears next to the filter icon in the Grades card
  3. Click the magnifying glass icon and verify the search field appears below the "Based on graded assignments" section
  4. Type 1-2 characters and verify no filtering occurs (all assignments remain visible)
  5. Type 3 or more characters and verify:
    • Assignments are filtered in real-time as you type
    • Only assignments matching the search query are displayed (case-insensitive)
    • Empty assignment groups are hidden
    • No need to press enter for filtering to apply
  6. Clear the search (delete characters to <3) and verify all assignments are restored
  7. Click the magnifying glass icon again to collapse the search field
  8. Verify the full assignment list is restored when search is closed

refs: MBL-19179
affects: Parent
release note: Added search functionality to Grades page

Changes

UI Components

  • Added search icon next to filter icon in Grades card
  • Implemented collapsible search field that appears below "Based on graded assignments" section
  • Search field uses existing SearchBar component with enhanced functionality

Search Behavior

  • Real-time filtering activates when search query reaches 3 characters
  • Case-insensitive search across assignment names
  • Empty assignment groups automatically hidden from filtered results
  • Toggling search icon restores full unfiltered list

Technical Implementation

  • Enhanced SearchBar component with new onQueryChange callback for keystroke-level updates
  • Added search state management in GradesUiState (searchQuery, isSearchExpanded)
  • Added search actions in GradesAction (ToggleSearch, SearchQueryChanged)
  • ViewModel caches unfiltered items and applies filtering dynamically
  • Filter logic in ViewModel removes empty groups after filtering

Screenshots

BeforeAfter
No search functionality available Search icon and collapsible search field with real-time filtering

Note: Screenshots should be added showing the search icon, expanded search field, and filtered results

Checklist

  • Follow-up e2e test ticket created or not needed
  • Run E2E test suite
  • Tested in dark mode
  • Tested in light mode
  • Test in landscape mode and/or tablet
  • A11y checked
  • Approve from product

🤖 Generated with Claude Code

kdeakinstructure and others added 2 commits November 3, 2025 12:07
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]>
Copy link

@claude claude bot left a 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 SearchBar component 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.

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

📊 Code Coverage Report

✅ Student

  • PR Coverage: 43.53%
  • Master Coverage: 43.53%
  • Delta: +0.00%

⚠️ Teacher

  • PR Coverage: 25.52%
  • Master Coverage: 25.52%
  • Delta: -0.00%

⚠️ Pandautils

  • PR Coverage: 22.40%
  • Master Coverage: 22.44%
  • Delta: -0.03%

📈 Overall Average

  • PR Coverage: 30.49%
  • Master Coverage: 30.50%
  • Delta: -0.01%

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

Copy link
Contributor

@adamNagy56 adamNagy56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA +1

@tamaskozmer tamaskozmer self-requested a review November 4, 2025 10:13
Copy link
Contributor

@tamaskozmer tamaskozmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I would add a better animation for the search view, already described it in an other comment.
  • Consider modifying the empty message when the search query is not empty, currently it just says we have no assignments. See the screenshot:
Screenshot 2025-11-04 at 11 12 44

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

Copy link
Contributor

@adamNagy56 adamNagy56 left a 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

@inst-danger
Copy link
Contributor

Parent Install Page

@inst-danger
Copy link
Contributor

Teacher Install Page

@inst-danger
Copy link
Contributor

Student Install Page

Copy link
Contributor

@adamNagy56 adamNagy56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA +1

@kdeakinstructure kdeakinstructure merged commit 473c4fb into master Nov 11, 2025
24 of 26 checks passed
@kdeakinstructure kdeakinstructure deleted the MBL-19179-implement-search-in-parent-grades-page branch November 11, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants