Skip to content

feat(soccer-app): add country filter to team sidebar - #26

Open
ayushtr-aws wants to merge 2 commits into
bgagent/01KZP23QXZP7SGBY0ZRGZF4EKY/shared-orchestration-context-the-parent-epic-severfrom
bgagent/01KZP2732VZZ0ZXPECPMY2TXAH/shared-orchestration-context-the-parent-epic-sever
Open

feat(soccer-app): add country filter to team sidebar#26
ayushtr-aws wants to merge 2 commits into
bgagent/01KZP23QXZP7SGBY0ZRGZF4EKY/shared-orchestration-context-the-parent-epic-severfrom
bgagent/01KZP2732VZZ0ZXPECPMY2TXAH/shared-orchestration-context-the-parent-epic-sever

Conversation

@ayushtr-aws

Copy link
Copy Markdown
Owner

Summary

Implements TG-5: Add country filter from the "improve soccer team browsing filters" epic.

  • Adds an accessible country dropdown (<select> with an associated <label htmlFor>) to the soccer team sidebar.
  • Includes an "All countries" option (default) represented by the shared ALL_COUNTRIES sentinel.
  • Derives the available countries from the team data via a new getCountries() helper (de-duplicated, alphabetically sorted).
  • Combines the country filter with the existing search and sort behavior — queryTeams() now accepts an optional country argument and applies matchesSearch + matchesCountry before sorting.
  • Updates the empty-state message to be accurate when no results come from filters rather than only the search query.

Files changed

  • soccer-app/src/utils/teamQuery.ts — added ALL_COUNTRIES, getCountries(), matchesCountry(), and an optional country parameter to queryTeams().
  • soccer-app/src/App.tsx — added country state, rendered the labeled country <select>, wired it into queryTeams.
  • soccer-app/src/App.css — styling for .filter-controls, .filter-label, .country-filter matching the existing sidebar look.

Accessibility

  • The <select> has an explicit id linked to a <label htmlFor="country-filter">, so it is announced correctly by screen readers.
  • A native <select> is used, which is keyboard-operable and accessible by default.

Build & test results

Dependencies were installed with npm install (the soccer-app node_modules were not present).

  • mise run buildPASS (tsc -b && vite build, built in ~113ms, no type errors).
  • mise run lintPASS (oxlint, no warnings/errors).

The repo has no automated test suite; changes were validated via the type-checked build and lint.

Decisions made

  • Used a native <select> dropdown (rather than a custom button group like the sort control) for accessibility and to scale gracefully as more countries are added.
  • Kept the shared naming from the orchestration context by using an explicit ALL_COUNTRIES sentinel and an "All countries" label; queryTeams's new country parameter is optional and defaults to all countries, preserving backward compatibility with existing callers.

Agent notes

  • What went well: The existing teamQuery.ts utility already cleanly separated matching/sorting logic, so extending it for country filtering was straightforward and testable.
  • What was difficult: The initial mise run build/mise run lint failed because soccer-app/node_modules was not installed (tsc/oxlint not found); running npm install in soccer-app resolved it.
  • Conventions discovered: Conventional commits scoped to soccer-app; styling uses a dark slate palette (#0f172a, #334155, #3b82f6 accents); query/filter logic lives in src/utils/teamQuery.ts.
  • Suggestions: Consider adding unit tests for teamQuery.ts (pure functions, easy to cover) and enabling pipeline.buildCommand/pipeline.lintCommand in the blueprint so build/lint gating is active.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

🤖 Generated with Claude Code

bgagent added 2 commits August 10, 2026 14:47
Add a labeled country dropdown with an 'All countries' option to the
soccer team sidebar. Countries are derived from the team data and
combined with the existing search and sorting behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Task-Id: 01KZP2732VZZ0ZXPECPMY2TXAH
Prompt-Version: 1c9c10e027a2
- Add compact active-filter summary with live result count and removable
  chips for the active country/search filters, plus a "Clear all" button
- Improve keyboard accessibility: aria-label on the country select, Escape
  to reset it, and visible focus rings on interactive filter controls
- Document filtering behavior and accessibility in soccer-app/README.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Task-Id: 01KZP3HT7ZZW1G3XTV6BTFFCJW
Prompt-Version: 1c9c10e027a2
@ayushtr-aws

Copy link
Copy Markdown
Owner Author

Follow-up changes (commit 5fcb41e)

Addressed the requested follow-ups on the country filter work:

Compact active-filter summary

  • Added an .active-filters bar below the sidebar controls that appears only when a search and/or country filter is active.
  • Shows a live result count (e.g. "3 teams" / "1 team") with role="status" + aria-live="polite" so screen readers are notified.
  • Renders removable chips for the active country and search filters (each with an accessible label and a × clear button), plus a Clear all button.

Improved keyboard accessibility for the country filter

  • Added an explicit aria-label="Filter teams by country" on the <select> (in addition to the existing linked <label>).
  • Pressing Escape while the dropdown is focused resets it to "All countries".
  • Added visible :focus-visible rings on the country select, chip remove buttons, and the "Clear all" button.

README

  • Rewrote soccer-app/README.md to document the app, the search/country/sort filters, the active-filter summary, keyboard accessibility, and the teamQuery.ts helper API.

Build & test results

  • mise run buildPASS (tsc -b && vite build, built in ~150ms, no type errors). soccer-app/node_modules had to be reinstalled via npm install first (tsc/oxlint were not present).
  • mise run lintPASS (oxlint, no warnings/errors).
  • The repo has no automated test suite; validation was via the type-checked build and lint.

No open review comment threads were present on the PR, so there were no individual threads to reply to.

@ayushtr-aws

ayushtr-aws commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

Background agent — COMPLETED

Field Value
Task 01KZP3HT7ZZW1G3XTV6BTFFCJW
Repo ayushtr-aws/abca-testing
Status COMPLETED
Last event task_completed @ 2026-08-10T15:12:37.509Z
Pull request link
Duration 118.3s
Cost $0.5762

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.

1 participant