Feature Spec: Leadership / Committee Role Filters for U.S. Congress Directory
Recommendation
Add this feature.
For national issues, contacting committee chairs, ranking members, and chamber leadership can be more impactful than contacting random members because these roles control hearings, agendas, and investigations. This should complement, not replace, contacting a user’s own representatives.
Goal
Allow users to filter members by:
- chamber
- state
- district
- party
- leadership role
- committee
- committee role
Scope
In Scope
- Current Congress only
- Current House and Senate leadership roles
- Current committee chairs and ranking members
- Combined filtering with existing member filters
- Display official contact details on results
Out of Scope
- Historical roles
- Influence scoring
- Issue recommendations
- Non-official contact info
User Stories
- As a user, I can filter by
leadership_role. - As a user, I can filter by
committeeandcommittee_role. - As a user, I can combine those filters with state, district, party, and chamber.
- As a user, I can view official contact details for matching members.
Data Model
Copy
type Member = { bioguideId: string congress: number chamber: 'house' | 'senate' fullName: string party: string state: string district?: string | null officePhone?: string | null contactFormUrl?: string | null leadershipRoles: LeadershipRole[] committeeRoles: CommitteeRole[] }
type LeadershipRole = { roleType: LeadershipRoleType label: string isCurrent: boolean }
type CommitteeRole = { committeeCode: string committeeName: string roleType: CommitteeRoleType isCurrent: boolean }
type LeadershipRoleType = | 'speaker' | 'house_majority_leader' | 'house_minority_leader' | 'house_majority_whip' | 'house_minority_whip' | 'senate_majority_leader' | 'senate_minority_leader' | 'senate_majority_whip' | 'senate_minority_whip' | 'president_pro_tempore'
type CommitteeRoleType = | 'chair' | 'ranking_member' | 'member'
Data Rules
- Store only roles for the current Congress.
- Normalize source values into canonical enums before saving.
- A member may have multiple roles.
- Committee role filters must support at least:
chairranking_membermember
Data Sources
Use free official government sources:
- House Clerk member data
- Senate XML availability
- Senate current member XML
- House leadership source
- Senate leadership source
- Congress.gov API as optional enrichment/fallback
Backend Requirements
Filters
Support:
Copy
GET /members?party=Democrat GET /members?leadership_role=house_minority_leader GET /members?committee_role=ranking_member GET /members?committee_code=HSJU&committee_role=ranking_member GET /members?state=WA&party=Democrat&committee_role=chair
Behavior
- Filters use AND logic across categories.
- Results are paginated.
- Only current members and current roles are returned.
- If a member has multiple matching roles, return the member once.
UI Requirements
Filters
Add:
- Leadership Role dropdown
- Committee dropdown
- Committee Role dropdown
Member Card
Show:
- name
- chamber
- party
- state / district
- office phone
- contact form link
- role badges, such as:
- House Democratic Leader
- Chair, Senate Judiciary
- Ranking Member, House Oversight
Acceptance Criteria
- User can filter by leadership role.
- User can filter by committee and committee role.
- User can combine new filters with state, district, party, and chamber.
- Chairs and ranking members are correctly identified.
- Only current Congress role data is shown.
- Official contact details appear on each result.
- Data refreshes on a scheduled sync and can be manually refreshed.
Edge Cases
- Members with multiple committee roles
- Members with both leadership and committee roles
- Vacancies
- House members with no district value where applicable
- Missing role data from a source
Implementation Order
- Add role enums and schema changes
- Ingest House roles
- Ingest Senate roles
- Add leadership ingest
- Add API filters
- Add UI filters and badges
- Add tests
Source Strategy
- House Clerk member data
- Senate official XML
- Official House and Senate leadership sources
- Congress.gov API only if needed for enrichment or fallback