User Interface medium complexity Shared Component mobile
0
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

Search and select widget that lets a coordinator pick one or more peer mentors from their chapter's roster. Supports typeahead search by name and displays key identifiers to prevent selection errors.

Feature: Proxy & Bulk Activity Registration

proxy-peer-mentor-selector

Summaries

The Proxy Peer Mentor Selector is a shared UI component that prevents one of the most common data quality failures in proxy registration workflows: selecting the wrong peer mentor. By displaying name, chapter affiliation, and status badge alongside typeahead search results, it gives coordinators the context needed to confirm identity before attributing an activity to someone. This directly protects the accuracy of activity records used in Bufdir compliance reports, reducing the risk of misattributed data that could distort program evaluation outcomes. As a shared component used across both individual proxy registration and bulk group registration, it delivers this quality safeguard consistently without duplicating implementation effort.

This is a medium-complexity shared widget with no declared external dependencies, making it an ideal early deliverable that unblocks both the proxy-registration-screen and the bulk-registration-screen. Because both consuming screens depend on this selector, any delay in its delivery directly delays integration testing for the entire proxy registration feature track. The dual-mode interface — single-select for individual proxy workflows and multi-select for bulk registration — must be explicitly tested in both configurations to ensure mode switching does not leave stale selection state. Typeahead performance against a large chapter roster should be validated on lower-end Android devices typical of field coordinators, as debounce tuning may be required to prevent excessive query load.

This Flutter widget exposes a unified build method with a multiSelect boolean flag that switches between single-select and multi-select emission modes — onSingleSelected emits a String mentorId while onMultiSelected emits a List. The typeahead search should debounce onSearchQueryChanged calls (recommended 300ms) and filter results to the coordinator's chapter by passing the chapter constraint as a query parameter to the peer-mentor data source, not by fetching the full roster and filtering client-side. Each result row should display name, chapter identifier, and a status badge derived from the peer-mentor model's active/inactive/suspended state. Internal selection state is managed as a Set regardless of mode to simplify add/remove logic, with getSelectedIds() exposing a snapshot for parent consumption.

clearSelection() must reset both the internal Set and the search query field. Because this is a shared component, avoid embedding navigation or Scaffold-level side effects — keep it a pure stateful widget.

Responsibilities

  • Provide typeahead search filtered to coordinator's chapter
  • Display peer mentor name, chapter, and status badge
  • Support single-select mode (individual proxy) and multi-select mode (bulk)
  • Emit selected mentor IDs to parent screen

Interfaces

build(BuildContext context, {bool multiSelect})
onSingleSelected(String mentorId)
onMultiSelected(List<String> mentorIds)
onSearchQueryChanged(String query)
clearSelection()
getSelectedIds()

Relationships

Dependents (1)

Components that depend on this component