Skip to content
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
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

tordans
Copy link

@tordans tordans commented Feb 8, 2025

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:

sidebar

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}

hover selected
link-hover link-selected

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.

no challenge specified with challenge specified
id-none id-given

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.

loading error

Other small changes

  • MapRoulette: Add error logging — This makes it easier to debug the error cases when the MR API returns an error.
  • MapRoulette: Add missing translation for error message
  • MapRoulette: Reduce line height for Sidebar title
  • Rename css class for QA tools — We use the same class for the MapRoulette Sidepanel and the term error was confusing.

Closes #1686

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.
@atiannicelli
Copy link

The results look good to me!

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.

MapRoulette: Mustache Tags are not replaced
3 participants