This PR ends up doing a few related things since they came up while I was already working on this...
We now prioritize which label type to choose for a Validate mission based on need. Each of our 6 primary label types have at least a 3% chance of being selected (if there are any such labels left for the user to validate). The remaining probability of being chosen is split up proportionally based no the number of labels remaining of that label type that either has no validations or needs a tie breaking vote. As before, we only assign No Sidewalk missions if there is nothing available for the other label types.
As an example, I tested on my Seattle db dump, and the probabilities for the various label types were: 48% Curb Ramp, 15% Missing Curb Ramp, 9% Obstacle, 21.5% Surface Problem, 3.5% Crosswalk, and 3% Pedestrian Signal. We'll be validating a lot of curb ramps for awhile here while we catch up!
I tweaked the label prioritization algorithm for choosing labels to validate as well, and you could even consider it fixing bugs in the algorithm. Both of these changes increased the frequency that I saw labels that actually needed validations in local testing:
We have been giving a label higher priority if the user who labeled it has fewer than 50 labels validated... But I didn't add the condition that the label in question still required a validation itself! I've added that condition so we don't repeatedly validate a label just bc a user doesn't have 50 labels to validate.
We were adding a weight that was proportional to the number of validations: 100 / (1 + validation_count). I've adjusted this to consider how far we are from consensus instead of how far we are from having no validations: 100 / (1 + abs(agree_count - disagree_count)).
Fixed mobile validate not showing new mission after the first (#3513).
I added label ID to the Admin Validate page.
I added the Admin Validate info to the admin versions of the LabelMap popup. Visible on Admin page "Map" tab, admin user dashboard, etc... anywhere that shows the Label Map popup except for LabelMap itself; I want to keep LabelMap looking clean for demos and such.
Fixes a bug where our mobile page's warning for being in landscape mode wasn't showing up on initial page load.
Before/After screenshots (if applicable)
Here are screenshots of the changes to Admin Validate. The others don't really have screenshots to show.
Things to check before submitting the PR
[x] I've written a descriptive PR title.
[x] I've added/updated comments for large or confusing blocks of code.
Resolves #2530 Fixes #3513
This PR ends up doing a few related things since they came up while I was already working on this...
100 / (1 + validation_count)
. I've adjusted this to consider how far we are from consensus instead of how far we are from having no validations:100 / (1 + abs(agree_count - disagree_count))
.Before/After screenshots (if applicable)
Here are screenshots of the changes to Admin Validate. The others don't really have screenshots to show.
![Screenshot from 2024-03-11 12-28-40](https://github.com/ProjectSidewalk/SidewalkWebpage/assets/6518824/bb26b9b1-5ca0-49d9-90bc-aac4091d465e)
Things to check before submitting the PR