Skip to content

feat: wire cluster endpoint to search-service with filters - #67

Merged
kelleyglenn merged 3 commits into
masterfrom
feature/60-filtered-cluster-endpoint
Feb 25, 2026
Merged

feat: wire cluster endpoint to search-service with filters#67
kelleyglenn merged 3 commits into
masterfrom
feature/60-filtered-cluster-endpoint

Conversation

@kelleyglenn

Copy link
Copy Markdown
Owner

Summary

  • Switch cluster fetching from location-service to search-service so clusters reflect video filters
  • Add searchClusters() function calling GET /search/cluster with amendment/participant filters
  • Update useLocationClusters hook to accept filters parameter and include filters in query key
  • Pass filters from MapContainer to useLocationClusters
  • Remove dead getClusters() function and related types from locations.ts
  • Update all affected tests

Semantic change

Cluster counts now represent video count instead of location count (e.g., "23 videos here" vs "23 locations here").

Files Changed

File Change
src/lib/api/search.ts New searchClusters() function with filter support
src/lib/api/locations.ts Remove getClusters() and cluster types (dead code)
src/hooks/useLocationClusters.ts Accept filters, call searchClusters, include filters in query key
src/components/map/MapContainer.tsx Pass filters to useLocationClusters
src/types/map.ts Add amendments? and participants? to ClusterParams
src/__tests__/lib/api/search.test.ts Add searchClusters tests
src/__tests__/lib/api/locations.test.ts Remove cluster tests
src/__tests__/hooks/useLocationClusters.test.tsx Update to mock search API, add filter tests

Test plan

  • All 408 web-app unit tests pass
  • npm run build succeeds (type check)
  • E2E cluster filter tests pass across Chromium, Firefox, and WebKit
  • Full integration test suite passes (no regressions)

Closes #60

🤖 Generated with Claude Code

kelleyglenn and others added 3 commits February 24, 2026 23:18
Switch cluster fetching from location-service to search-service,
passing amendment and participant filters so map clusters reflect
the same filters as the video list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap API call in try/catch and throw SearchError with status code context,
consistent with the existing searchVideos pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover both Axios error (wraps in SearchError with statusCode) and
non-Axios error (wraps with generic message) catch branches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Coverage after merging feature/60-filtered-cluster-endpoint into master will be

76.29%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/app/login
   page.tsx0%0%0%0%11, 114, 14–16, 16, 16, 18, 18, 18, 18, 18, 21–25, 28, 28–29, 3, 30, 33–36, 38–39, 4, 40, 42, 42, 42, 42, 42–44, 44, 44, 46, 49, 5–6, 61, 7, 75, 8, 86, 9
src/app/map
   page.tsx0%0%0%0%11, 23–26, 28, 28, 28–29, 29, 29, 3, 32, 32, 32, 32, 32, 36, 36, 4, 47, 5–6
src/app/profile
   page.tsx96.15%81.82%100%100%114, 129
src/app/register
   page.tsx0%0%0%0%101, 11, 112, 13–21, 24, 24–26, 29, 3, 30–31, 33, 33–35, 38, 38–39, 4, 40, 43, 45–47, 49, 49, 49, 49, 49, 5, 50–51, 51, 51, 53, 56, 6, 68, 7, 79, 8–9, 90
src/app/users/[id]
   page.tsx96.88%94.44%100%100%10
src/app/videos/[id]
   page.tsx0%0%0%0%11–13, 13, 13, 3–4, 7
src/app/videos/new
   page.tsx0%0%0%0%10–11, 16–18, 20–21, 21, 21, 21–22, 26, 26, 3, 34, 34, 4–6
src/components
   HeroMap.tsx100%100%100%100%
   NavBar.tsx100%100%100%100%
src/components/map
   AmendmentFilter.tsx100%100%100%100%
   BottomSheet.tsx0%0%0%0%108, 111, 20–21, 24, 3, 30–32, 36–37, 4, 41, 43–44, 44, 46, 48, 5, 50, 50, 50, 52, 56, 60–61, 61, 61, 63–66, 66, 66, 68–69, 69, 69, 73–74, 74, 74, 78, 8, 81, 85, 97
   ClusterMarker.tsx100%100%100%100%
   FilterBar.tsx97.30%95.24%100%100%96
   LocationSearch.tsx0%0%0%0%27–29, 3, 31, 33, 33–37, 39, 39, 39, 39, 4, 43–45, 5, 51, 51–52, 6
   MapContainer.tsx0%0%0%0%10, 102, 102, 104, 108, 108, 108, 11, 116, 12, 128, 128, 13, 135, 135, 138, 14, 147, 147, 15, 153, 16–18, 180, 180, 182, 186, 186, 188, 192, 192, 192, 200, 21–24, 27, 3, 33, 4, 40, 43–44, 44–45, 47, 47, 47, 47, 47, 47, 47, 47, 47, 5, 59, 6, 60, 60–61, 63, 63, 63, 63, 63, 7, 71–72, 72, 72, 72–73, 73, 73, 76–77, 8, 81, 81, 9, 90, 90, 96, 96, 98
   MapView.tsx0%0%0%0%11, 17–18, 27, 3, 30–32, 32, 34–35, 35, 37, 43, 47, 49, 59–60, 64–65, 69, 7, 70, 70, 70, 70, 72, 74, 74, 78, 8, 82–83, 83, 83, 83, 85, 9, 90, 93, 93
   ParticipantFilter.tsx100%100%100%100%
   SidePanel.tsx0%0%0%0%15–17, 20–21, 21, 21, 21, 23, 27, 27–28, 3–4, 40, 42, 42, 5, 53, 53, 56, 6, 67, 67, 86
   VideoInfoCard.tsx95.74%83.33%100%100%67, 75
   VideoListItem.tsx96.36%90.48%100%100%40, 48
   VideoMarker.tsx97.22%92.86%100%100%37
src/components/profile
   AvatarPicker.tsx86.67%66.67%80%93.10%115, 91, 94, 94
   MySubmissions.tsx100%100%100%100%
   PrivacySettingsForm.tsx79.17%25%75%93.75%47, 62, 64, 64
   ProfileInfoForm.tsx100%100%100%100%
   SocialLinksForm.tsx100%100%100%100%
src/components/ui
   Button.tsx100%100%100%100%
   Card.tsx100%100%100%100%
   Chip.tsx100%100%100%100%
   Input.tsx100%100%100%100%
   Toast.tsx100%100%100%100%
src/components/video
   LocationPicker.tsx76.19%66.67%83.33%77.78%174, 56–57, 77–78, 81, 93, 93–99
   MiniMap.tsx100%100%100%100%
   ModerationControls.tsx100%100%100%100%
   VideoDetail.tsx84%75%83.33%95%156, 160, 163, 176, 178, 178, 212, 34, 58, 68, 70, 73, 77, 82
   VideoSubmitForm.tsx85.49%75.36%84%90.06%101, 104, 106, 108, 147, 151, 164, 185, 188, 243, 245–246, 250, 252, 252, 252–254, 254–255, 257, 262, 262, 262, 268, 290, 290–292, 361, 71–72, 86
   YouTubePreview.tsx100%100%100%100%
src/config
   mapbox.ts100%100%100%100%
src/hooks
   useLocationClusters.ts100%100%100%100%
   useResponsive.ts100%100%100%100%
   useVideoSearch.ts92.31%80%100%100%30
src/lib/api
   auth.ts81.25%100%75%83.33%25–26
   client.ts100%100%100%100%
   locations.ts

@sonarqubecloud

Copy link
Copy Markdown

@kelleyglenn
kelleyglenn merged commit 821de93 into master Feb 25, 2026
3 checks passed
@kelleyglenn
kelleyglenn deleted the feature/60-filtered-cluster-endpoint branch February 25, 2026 09:08
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.

Consider if list filters should influence map

1 participant