Skip to content

Conversation

@Manav12052005
Copy link

Fixes #13054

Outline of Solution

Implemented a minimal substring search functionality for recipient dropdowns in feedback question submission forms to improve user experience when selecting recipients from long lists.

Changes Made:

  1. Enhanced HTML Template (question-submission-form.component.html):

    • Added a search input field above the existing select dropdown
    • Search input filters the dropdown options in real-time
    • Maintained the original select dropdown functionality for familiarity
  2. Added Search Logic (question-submission-form.component.ts):

    • getSearchTerm(): Retrieves current search term for a given form index
    • updateSearch(): Updates the search filter when user types
    • getFilteredOptions(): Returns filtered recipient list based on substring matching
    • Added searchFilters Map to track search state per form
  3. Comprehensive Testing (question-submission-form.component.spec.ts):

    • Added 4 test cases covering search functionality
    • Tests for empty search terms, search updates, and filtering behavior
    • Verified case-insensitive substring matching

Key Features:

  • Substring Matching: Users can search by any part of the recipient's name, section, or team
  • Real-time Filtering: Dropdown options update instantly as user types
  • Minimal Implementation: Simple search input + filtered select dropdown
  • Backwards Compatible: Maintains existing select dropdown behavior

Example Usage:

  • Before: Had to scroll through entire dropdown to find "CS1101S Alpha Team / John Smith"
  • After: Can type "John", "Smith", "Alpha", or "CS1101S" in search box to filter the dropdown

This minimal solution addresses the core issue where users couldn't efficiently search for recipients when names were prefixed with section/team information, significantly improving the submission user experience without major UI changes.

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.

Make substrings of the name in dropdown selections of recipient to be searchable

2 participants