Skip to content

Conversation

@joaquimds
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for displaying clusters in the inspector panel. When multiple markers are selected on the map, the inspector now shows a "Cluster" view that displays all selected markers in a list format, rather than showing individual marker details.

Changes:

  • Added LayerType.Cluster enum value to support the cluster inspector type
  • Modified inspector logic to detect when multiple records are selected and return cluster-specific content
  • Implemented UI changes to show only the "Markers" tab for clusters (hiding "Data" and "Config" tabs)

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types.ts Added Cluster to LayerType enum
src/app/map/[id]/hooks/useInspector.ts Added cluster detection logic for multi-record selection and updated dependency array
src/app/map/[id]/components/inspector/InspectorPanel.tsx Added safeActiveTab logic and conditional rendering for cluster-specific tabs
src/app/map/[id]/components/inspector/InspectorMarkersTab.tsx Added ClusterMarkersList component rendering for cluster type
src/app/map/[id]/components/inspector/ClusterMarkersList.tsx New component to display markers within a cluster
src/app/map/[id]/components/inspector/MarkersLists.tsx Extended areaType to include "cluster" option

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +31
return {
type: "Feature",
geometry: {
// [0, 0] should never happen because these records are in a cluster on the map
coordinates: [r.geocodePoint?.lng || 0, r.geocodePoint?.lat || 0],
type: "Point",
},
properties: {
id: r.id,
name: r.name,
dataSourceId: r.dataSourceId,
matched: true,
},
};
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Records without valid geocodePoints should be filtered out rather than creating markers with coordinates [0, 0]. Consider adding a null check for r.geocodePoint and returning null for records that don't have valid coordinates, or check if both lng and lat exist and are not 0 before creating the feature.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
};
})
.filter((r) => r !== null);
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter method doesn't properly narrow the TypeScript type from (MarkerFeature | null)[] to MarkerFeature[]. TypeScript's built-in filter doesn't use a type predicate, so markerFeatures will still have type (MarkerFeature | null)[] instead of MarkerFeature[]. This could cause type errors when passing markerFeatures to MembersList or MarkersList components. Consider using a type predicate or type assertion: .filter((r): r is MarkerFeature => r !== null)

Suggested change
.filter((r) => r !== null);
.filter((r): r is MarkerFeature => r !== null);

Copilot uses AI. Check for mistakes.
@joaquimds joaquimds merged commit fc2cbbf into main Jan 22, 2026
7 checks passed
@joaquimds joaquimds deleted the feat/inspect-cluster branch January 22, 2026 14:45
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.

2 participants