Giter Club home page Giter Club logo

blacklistr's People

Contributors

ent8r avatar rugk avatar westnordost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rugk akeamazan

blacklistr's Issues

Better error handling

Referring #20 I'd also say this needs a better error handling.

What currently happens

  • it either shows nothing
  • or shows the default example that when you visit the site without params

What should happen

  • show an error to the user (at least "That link could not be loaded.")
  • that can (possibly should) still be dissmissable

Image export

It would be awesome if I can export the image for the Quests wiki.

From streetcomplete/StreetComplete#824 (comment):

By the way, rugk, this would also be great for your Quests wiki page, to show where certain quests are enabled or disabled.

From streetcomplete/StreetComplete#824 (comment):

so you can export the image as a PNG, or, better, SVG (otherwise we'd have to screenshot this, but that may not be nice, e.g. one may want a transparent background and the same size, which us hard when screenshotting)

Third state: Disabled by default

From streetcomplete/StreetComplete#824 (comment):

make sure there are tree colors/states for: enabled, disabled by default and blacklisted (the last one cannot be enabled manually in the setting)

States are:

  • enabled = always shown
  • disabled by default = (indoor quests) user can enable these in the settings
  • blacklisted = user cannot enable them, they are not available in the country

I.e. especially for illustrations in the wiki this is useful (see #2).

Add links to wiki

I'll do that, just want to have an issue for that, here. You can assign me, if that is possible.

Support kotlin for Streetcomplete endpoint

After the migration of quests in Streetcomplete to Kotlin, unfortunately the endpoint does not work anymore :-(

It now looks like this (commented out what is may or may not be there / is optional)

override val enabledForCountries/* : Countries*/ /* get() */ = Countries.noneExcept(
        // all of Northern and Western Europe, most of Central Europe, some of Southern Europe
        "NO","SE","FI","IS","DK",
// etc...
)

So, the most future proof method would be to look for the first Countries. after override val enabledForCountries to read either noneExcept or allExcept, then look for the first " and parse the list of country codes as usual until the first ) that is not in a comment.

Add human-readable list of countries

From streetcomplete/StreetComplete#824 (comment):

to make it really easy you could also automatically generate the alt/title text, which should list the countries and the quest's state there.

Actually you already have it mostly. You have the list on the right. Now it would only be useful if you can show this list in a human-readable way.

This can then be used as a text-description of the black- or whitelist this is generating. As said, this is useful for the alt and title text for the image in the wiki (#2).

Checkbox to toggle display of country borders

It is really funny to see these, and also useful for StreetComplete/technical aspects, but for Wiki visitors (see #2) it is not that useful.
So maybe just add a toggle, so you can hide these.

What's up with New South Wales?

new south wales

So does it belong to Australia or not? And if it does (as the areas overlap each other*) why should one select/use New South Wales?

* Actually it seems New South Wales is completely inside Australia here…

YAML and StreetComplete

I just looked into that again, and was quite surprised to see blacklistr does some format conversion and does not support the exactly format, that StreetComplete uses.

Does not this defeat one whole use case?

Because as a StreetComplete developer/contributor/... I want to have a simple copy & paste workflow.

I.e. I want to:

  1. Load the file in blacklistr
  2. Do some changes (click on countries, or do it manually).
  3. Copy the output and add it back into the source file in StreetComplete.

The third thing is not possible, because the syntax is different. And doing the conversion back by hand, totally defeats the purpose of blacklistr - then I can also just edit it by hand.

/cc @westnordost

Requirements

Hi @ENT8R , man, you are quick. It is impressive how quickly you can whip something up like this. So, here are the promised requirements. What @rugk writes is well-meant, but in my opinion, he is missing the big picture. Since you already built most of it, I am just telling what I'd want to have changed:

We have two use cases:

  1. View for which states the quest is enabled and why, if specified. The idea here is to be able to directly link a blacklistr page from the wiki which already includes all the information directly from repository:
  • so, no screenshot functionality. Best remove it to keep it as simple as possible
  • Hide all these controls and input fields by default, just show the map. The focus should be on the enabled/disabled countries.
  • Do not show the polygons for not-selected countries at all, it is clearer that way. Depending on whether it is a black- or whitelist, the selected polygons can be colored slightly green/red (or white/black ;-) ). Regarding that "show borders" option, I'd remove the option and always show borders but only for the selected polygons and in a color that is similar to the fill color (i.e. without alpha or slightly darker)
  • Bonus: blacklistr should be able to parse and show comments that are written for a country and show them (in a bubble) when clicking on the country. For example, currently in the AddHousenumber quest, there is a comment for each blacklisted country
  • finally, (after it has been implemented in StreetComplete), blacklistr should accept a url parameter from which the countries are loaded, whether it is a black- or whitelist etc. This way, @rugk can simply specify a link to blacklistr with the correct parameter pointing to the master of the StreetComplete repos and will never have to update this.
  1. edit it easily by clicking on the countries. This is optional, really. Perhaps for simplicity sake, you want to remove it, because my requirements would make this edit-mode more sophisticated. It is more than enough to be able to edit it by writing into the input-field.
  • Input field: There should be just one input field, where the list is specified in a specific format and the map should update accordingly.
  • Again, I would advise to not make the map itself editable by clicking, because it makes the UI interaction more complex (i.e. how to select India as a whole? How to set a comment for a country selection?) and it becomes necessary to not only write a parser for that format, but a writer, which additionally mess up the comments or predefined order.

Format
I thought it would be best to have an own simple format for specifying these white/blacklists to have it both human readable and not verbose. It is basically a comma separated list + line comments + specifying whether it is a white-or blacklist. Here is an example file:

all except 
NL, # https://forum.openstreetmap.org/viewtopic.php?id=60356
DK, # https://lists.openstreetmap.org/pipermail/talk-dk/2017-November/004898.html
NO, # https://forum.openstreetmap.org/viewtopic.php?id=60357
CZ, # https://lists.openstreetmap.org/pipermail/talk-cz/2017-November/017901.html

or

# See https://ent8r.github.io/blacklistr?path=/app/src/main/assets/quest_blacklists/AddCycleway.txt

# #749. sources:
# Google Street View (driving around in virtual car)
# https://en.wikivoyage.org/wiki/Cycling
only 
DE, AT,NO, FI, IS, DK, CZ, HU,CH,ES,
IE,LU, FI,
LI, # may not have cycleways after all, bla bla bla
PL, # by local knowlege of xyz (forum link)
# US source: http://peopleforbikes.org/get-local/
US-WA,US-OR, HI, US-CA,US-AZ,
US-TX

So:

  • it always starts with either all except or only (could also be none except, or none but... opinions?), then a space, and then...
  • a list of country codes, separated by ,
  • comments start with # and go till the end of the line
  • otherwise, line feeds are ignored

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.