Skip to content

Filter event types in map visualization#150

Merged
tarekio merged 23 commits intomainfrom
BYNT-1393-Filter-life-events-in-map-visualization
Aug 27, 2025
Merged

Filter event types in map visualization#150
tarekio merged 23 commits intomainfrom
BYNT-1393-Filter-life-events-in-map-visualization

Conversation

@apodacaduron
Copy link
Contributor

@apodacaduron apodacaduron commented Aug 5, 2025

Jira Issue

  1. BYNT-1393

Description

Add a menu with all actor events. By default, let’s show all event types. We can allow the user to exclude event types as needed, and when they are removed, the visualization should be updated to remove events with those types from view.

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • New strings prepared for translations

API Changes (if applicable)

  • Permissions checked
  • Endpoint tests added

Additional Notes

[Any other relevant information]

@apodacaduron apodacaduron requested a review from tarekio August 5, 2025 21:20
@apodacaduron apodacaduron self-assigned this Aug 5, 2025
Copy link
Contributor

@tarekio tarekio left a comment

Choose a reason for hiding this comment

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

Let's move the three dots to right next to the "Events", and add a tooltip "Show or hide event types".

@tarekio tarekio requested a review from level09 August 8, 2025 12:49
@apodacaduron
Copy link
Contributor Author

@tarekio button repositioned and tooltip added 😅

Copy link
Collaborator

@level09 level09 left a comment

Choose a reason for hiding this comment

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

There is a bug in Popup lifecycle management, scenario below,

CleanShot.2025-08-09.at.19.37.24.mp4

I think this is what's happening :

  1. Initial State: Markers are created with popups bound to them using marker.bindPopup()
  2. User Interaction: User opens a popup by clicking on a marker
  3. Filter Applied: User changes event type filter via the new dropdown menu
  4. Problem: The selectedLocations watcher triggers fitMarkers(), which calls this.markerGroup.clearLayers() (line 151)
  5. Critical Issue: This removes all markers from the map, including the marker that has an open popup
  6. Leaflet State Corruption: The popup remains open but its parent marker no longer exists on the map
  7. Animation Trigger: When user double-clicks or zooms, Leaflet tries to animate the popup position
  8. Error: Popup animation code tries to access _latLngToNewLayerPoint() on a null map reference because the popup's parent marker was removed

Another UX issue is that when filtering is applied, markers are recreated and their colors change which is confusing.

@apodacaduron
Copy link
Contributor Author

There is a bug in Popup lifecycle management, scenario below,

CleanShot.2025-08-09.at.19.37.24.mp4
I think this is what's happening :

  1. Initial State: Markers are created with popups bound to them using marker.bindPopup()
  2. User Interaction: User opens a popup by clicking on a marker
  3. Filter Applied: User changes event type filter via the new dropdown menu
  4. Problem: The selectedLocations watcher triggers fitMarkers(), which calls this.markerGroup.clearLayers() (line 151)
  5. Critical Issue: This removes all markers from the map, including the marker that has an open popup
  6. Leaflet State Corruption: The popup remains open but its parent marker no longer exists on the map
  7. Animation Trigger: When user double-clicks or zooms, Leaflet tries to animate the popup position
  8. Error: Popup animation code tries to access _latLngToNewLayerPoint() on a null map reference because the popup's parent marker was removed

Another UX issue is that when filtering is applied, markers are recreated and their colors change which is confusing.

@level09 i reverted some changes and it should work better now

@apodacaduron
Copy link
Contributor Author

apodacaduron commented Aug 13, 2025

Note: need to make a few more updates

EDIT: Made an update to prevent line arrows from getting stuck

Copy link
Contributor

@tarekio tarekio left a comment

Choose a reason for hiding this comment

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

This works well. @level09 please review.

@apodacaduron apodacaduron requested a review from level09 August 26, 2025 21:12
@tarekio tarekio merged commit c20c2dd into main Aug 27, 2025
7 checks passed
@tarekio tarekio deleted the BYNT-1393-Filter-life-events-in-map-visualization branch August 27, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants