Skip to content

Fix "next task" nearby map not always zooming to encompass all nearby tasks and refactor nearby map component - #2986

Merged
CollinBeczak merged 14 commits into
maproulette:v4from
maxwellward:fix/nearby-task-map-zoom-race-condition
Nov 11, 2026
Merged

CollinBeczak merged 14 commits into
maproulette:v4from
maxwellward:fix/nearby-task-map-zoom-race-condition

Conversation

@maxwellward

@maxwellward maxwellward commented Nov 10, 2026 •

Copy link
Copy Markdown

The nearby task map wasn't always zooming to show all the nearby tasks as the nearby tasks were loaded when the next task window opens.

This PR fixes that, while also refactoring the nearby task map component to be more streamlined and use less prop-drilling.

@CollinBeczak

Copy link
Copy Markdown
Collaborator

This is good and works. Curious if you are interested in simplifying the component tho. There is some prop drilling going on and also some extra props that can be ripped out (For example excludeCurrentBundle).

Things you should try to do:

  1. reduce as much prop drilling where possible
  2. move the api call into the component (Its the only place it is used so we should just be able to call it in the component its used)
  3. Collapse TaskNearbyMap and TaskSelectionMap into one component.

This should leave you with one component with two props:

  1. selectedTaskId={selectedNearbyTaskId}
  2. onTaskSelect={setSelectedNearbyTaskId}

@maxwellward

Copy link
Copy Markdown
Author

I can look into these, yes. I didn't initially in order to keep the diff small :) The main reason for it being pulled out into the parent component was because if we load the nearby tasks when the map opens, there is a brief period where the nearby tasks haven't loaded, and so we can't initialize the map zoomed to their bounds.

I will look into alternative options to also clean up this component while maintaining the fixed behaviour!

@CollinBeczak

CollinBeczak commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

We could just use the challenge tasks and get the nearby tasks from there on the frontend. Could be an alternative to solve this issue. Feel free to experiment, or keep it as is!

@maxwellward maxwellward changed the title Fix "next task" nearby map not always zooming to encompass all nearby tasks Fix "next task" nearby map not always zooming to encompass all nearby tasks and refactor nearby map component Nov 11, 2026
@CollinBeczak
CollinBeczak merged commit c238a8a into maproulette:v4 Nov 11, 2026
2 checks passed
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