-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maproulette fixes and improvements #1689
Open
tordans
wants to merge
11
commits into
facebook:main
Choose a base branch
from
tordans:maproulette-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+152
−39
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We use the same class for the MapRoulette Sidepanel and the term error was confusing.
…ries Even though the method name is called "task" what it actually loaded was the MapRoulette "challenge". Which means we did not have the actual task properties to replace the Mustache tags. Now we also load the task but only add the features which hold the properties. In MR one task has a FeatureCollection attached which holds geometries that are displayed in the UI and properties. Usually this is only one feature (there are special cases). We now flatten the properties of all features and use this list to replace the Mustache tags.
This way it is clear that something was there but was not replaced. I think this is easier to understand than showing nothing.
Before, the markdown parsing was done on the initial data. However, this data can include Mustache tags which are replaced later which also can hold Markdown. Now we parse the Markdown after replacing all Mustache tags.
The Mustache replacement also handels a special case of `osmIdentifier` which create a special link that hovers or selects the element in the map. This change fixes this feature for all cases when the OSM identifier follows the pattern `way/${number}`, `node/${number}`, `relation/${number}`
The challenge description is a high level description on the challenge which is great when one select a MR node without knowing the challenge. However, when a explicit challenge ID is selected, we can assume the challenge is known beforehand so this hides it to reduce clutter on the page.
The markdown that is provided by the challenge authors can add headlines and lists to the sidebar. This adds some basic styling for this case.
The sidebar showed all information in one gray box, which made it hard to distinguish the challenge description and task instruction; especially when the challenge authors used headlines in their text as well. This changes the UI to show description and instruction in separate boxes and updates the loading and error messages to work with this updated design.
This makes it easier to debug the error cases when the MR API returns an error.
The results look good to me! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does a couple of things. They are separated into commits. Let me know which I should extract into separate PRs (if any).
The commits describe what is going on and why; I list them below with some added screenshots.
This what the new UI looks like:
Test-Location: https://rapideditor.org/edit#map=19.38/52.48353/13.44032&maproulette=49357&background=Berlin-2024&datasets=fbRoads,msBuildings&disable_features=boundaries
MapRoulette: Fix Mustache property replacement by loading task geometries
Even though the method name is called "task" what it actually loaded was the MapRoulette "challenge". Which means we did not have the actual task properties to replace the Mustache tags.
Now we also load the task but only add the features which hold the properties. In MR one task has a FeatureCollection attached which holds geometries that are displayed in the UI and properties. Usually this is only one feature (there are special cases). We now flatten the properties of all features and use this list to replace the Mustache tags.
MapRoulette: Only remove Mustache tag if replaced
This way it is clear that something was there but was not replaced. I think this is easier to understand than showing nothing.
MapRoulette: Fix the markdown parsing
Before, the markdown parsing was done on the initial data. However, this data can include Mustache tags which are replaced later which also can hold Markdown.
Now we parse the Markdown after replacing all Mustache tags.
MapRoulette: Fix osmIdentifier links which interact with the map
The Mustache replacement also handels a special case of
osmIdentifier
which create a special link that hovers or selects the element in the map.This change fixes this feature for all cases when the OSM identifier follows the pattern
way/${number}
,node/${number}
,relation/${number}
MapRoulette: Hide Challenge Desc when an explicit challenge is selected
The challenge description is a high level description on the challenge which is great when one select a MR node without knowing the challenge.
However, when a explicit challenge ID is selected, we can assume the challenge is known beforehand so this hides it to reduce clutter on the page.
MapRoulette: Apply default styles to Markdown
The markdown that is provided by the challenge authors can add headlines and lists to the sidebar. This adds some basic styling for this case.
MapRoulette: Improve sidebar design
The sidebar showed all information in one gray box, which made it hard to distinguish the challenge description and task instruction; especially when the challenge authors used headlines in their text as well.
This changes the UI to show description and instruction in separate boxes and updates the loading and error messages to work with this updated design.
Other small changes
Closes #1686