Skip to content

Enhance zoom navigation experience#155

Merged
prabinoid merged 1 commit intonaxa-develop-latestfrom
fix/7052-tasks-map-zoom-logic
Apr 7, 2026
Merged

Enhance zoom navigation experience#155
prabinoid merged 1 commit intonaxa-develop-latestfrom
fix/7052-tasks-map-zoom-logic

Conversation

@suzit-10
Copy link
Copy Markdown

@suzit-10 suzit-10 commented Apr 7, 2026

This PR enhances the TasksMap component by implementing a robust, programmatic zooming mechanism for specific tasks and adding UI interaction guards to improve the overall navigation experience.

Changes:

Task-Specific Zooming: Implemented zoomedTaskId support that allows the map to automatically calculate and fit its bounds (using @turf/bbox) to a specific task or a group of tasks.

Redundant Zoom Prevention: Introduced a lastZoomedIdRef utilizing JSON serialization to perform value-based comparisons on task selections. This ensures the map doesn't unnecessarily or re-zoom when mapResults or other dependencies update unless the task selection has actually changed.

Consistent State Reset: Optimized the cleanup logic within useLayoutEffect to correctly reset tracking references when task selections are cleared (null or empty array), ensuring reliable behavior on subsequent selections.

@prabinoid prabinoid merged commit fe857cc into naxa-develop-latest Apr 7, 2026
2 of 3 checks passed
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