Skip to content

feat(soccer-app): add clear-filters action and active-filter count - #28

Open
ayushtr-aws wants to merge 3 commits into
bgagent/01KZP2AXYVA232PWBC37ECM5BS/shared-orchestration-context-the-parent-epic-severfrom
bgagent/01KZP34B939B9MRW20KF0XAQCX/shared-orchestration-context-the-parent-epic-sever
Open

feat(soccer-app): add clear-filters action and active-filter count#28
ayushtr-aws wants to merge 3 commits into
bgagent/01KZP2AXYVA232PWBC37ECM5BS/shared-orchestration-context-the-parent-epic-severfrom
bgagent/01KZP34B939B9MRW20KF0XAQCX/shared-orchestration-context-the-parent-epic-sever

Conversation

@ayushtr-aws

Copy link
Copy Markdown
Owner

Summary

Implements TG-8: Add clear-filters action from the "improve soccer team browsing filters" epic.

  • Adds a filter summary bar above the team list showing the number of active filters (e.g. "2 active filters", "1 active filter", or "No active filters").
  • Adds a "Clear filters" button that restores the controls to their defaults: empty search, all countries (ALL_COUNTRIES), and points sorting. The existing URL-sync effect automatically clears the query string once the state resets.
  • The Clear filters button is disabled when there are no active filters.
  • Adds a countActiveFilters helper in urlState.ts that counts how many of the three controls differ from DEFAULT_CONTROLS, reusing the existing shared defaults so counting, clearing and URL persistence stay consistent.
  • Styles the new elements to match the existing dark sidebar theme.

Files changed

  • soccer-app/src/App.tsx — clear handler, active filter count, summary bar UI
  • soccer-app/src/App.css.filter-summary, .active-filter-count, .clear-filters-btn styles
  • soccer-app/src/utils/urlState.ts — new countActiveFilters helper

Build and test results

  • mise run buildPASS (tsc -b && vite build, built in ~154ms; note: npm install was required first because tsc/oxlint binaries were not present).
  • mise run lintPASS (oxlint, no warnings/errors).
  • No test suite exists in this project; validated via the build/type-check and lint above.

Decisions made

  • Reused the existing DEFAULT_CONTROLS constant for both clearing and counting so the definition of "cleared" state stays aligned with the URL persistence logic (introduced by TG's sibling URL-state work).
  • Sort key is counted as an active filter when it is not the default points, matching the epic's spec that clearing restores "points sorting".
  • Placed the summary bar between the sidebar controls and the team list ("above the team list") to keep it visible and scoped to the list.

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

Agent notes

  • What went well: The codebase was already well-factored — teamQuery.ts and urlState.ts cleanly separate query/URL logic, so the change was small and additive. Reusing DEFAULT_CONTROLS made "clear" trivially correct and self-synchronizing with the URL effect.
  • What was difficult: The initial mise run build/lint failed with tsc: not found / oxlint: not found; running npm install in soccer-app first resolved it. Worth noting for future tasks in this repo.
  • Conventions discovered: Conventional commits with soccer-app scope; dark-theme CSS with slate/blue palette (#0f172a/#1e293b/#334155/#3b82f6); URL state uses short param names (q, country, sort) and omits default values.
  • Suggestions: Consider adding a unit test harness (none exists) to cover teamQuery/urlState helpers, and configuring the blueprint's build/lint commands so gating is active.

bgagent added 3 commits August 10, 2026 15:04
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Task-Id: 01KZP34B939B9MRW20KF0XAQCX
Prompt-Version: 1c9c10e027a2
…BS/shared-orchestration-context-the-parent-epic-sever' into bgagent/01KZP34B939B9MRW20KF0XAQCX/shared-orchestration-context-the-parent-epic-sever
…n-context branch

Scope .clear-filters-btn CSS to its parent container to resolve a styling
collision introduced when the predecessor branch's active-filters feature
(with its own .clear-filters-btn) was merged in alongside this PR's
.filter-summary clear-filters button.

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

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

Copy link
Copy Markdown
Owner Author

Re-stack update

Absorbed the updated predecessor branch (01KZP2AXYVA23…, which now includes the sibling 01KZP2732VZZ… active-filter summary + a11y work). The git-level merge was clean, but it introduced a semantic CSS collision: the predecessor added an .active-filters block with its own .clear-filters-btn (borderless "Clear all" text link), while this PR added a .filter-summary with its own .clear-filters-btn (solid button). Because this PR's rules came later in App.css, they were globally overriding the predecessor's button styling.

Resolution: scoped both rule sets to their parent containers (.active-filters .clear-filters-btn and .filter-summary .clear-filters-btn) so each feature keeps its intended styling. No .tsx/logic changes were needed — both features coexist.

Build/test:

  • npm run build (tsc -b && vite build) → PASS (built in ~108ms)
  • oxlintPASS (exit 0, no warnings/errors)
  • No test suite exists in this project.

@ayushtr-aws

ayushtr-aws commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

Background agent — COMPLETED

Field Value
Task 01KZP3SFAG2XV8YE4GN0BK9308
Repo ayushtr-aws/abca-testing
Status COMPLETED
Last event task_completed @ 2026-08-10T15:16:42.775Z
Pull request link
Duration 144.6s
Cost $0.5761

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