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

Allow invalid styles and show errors #353

Closed
orangemug opened this issue Jul 27, 2018 · 7 comments
Closed

Allow invalid styles and show errors #353

orangemug opened this issue Jul 27, 2018 · 7 comments

Comments

@orangemug
Copy link
Collaborator

orangemug commented Jul 27, 2018

Editing a Maputnik style can be a pain right now. In many places entering an invalid value will cause the input to get in a funny state or just refuse to let you complete the action. For example changing a color input with the value rgba(255, 0, 0, 1) to rgb(255, 0, 0) and you'll see the issue.

Also editing a style via the JSON editor is next to impossible at the moment for similar reasons.

I think we should allow errors to be present in the style, and indicate what layers have errors.

Here's a prototype https://696-84182601-gh.circle-artifacts.com/0/artifacts/build/index.html#0.26/0/0 (working branch master...orangemug:feature/allow-invalid-values)

Below is an example where I've modified a layer type to be invalid, backgroun instead of background

screen shot 2018-07-27 at 17 02 13

Below is an example where I am part way through modifying a color from hsl to hsla and am still missing the forth argument.

screen shot 2018-07-27 at 17 02 39

Any thoughts or feedback welcome and encouraged 😄

@gregwolanski
Copy link
Contributor

gregwolanski commented Sep 1, 2018

This issue appears in the answers to question “What annoys you about Maputnik?” in the survey (original spelling):

  • sometimes ctl+v doesnt work if theres is mismatch,it should give error by underline or something

  • Black Screen with often no error messge once you make a mistake editing the local style file.

  • Bugs to refresh style (I need to play with JSON to fix issues)

  • When I want to set “Offset” to “1.7” and I type “1.6” by mistake, click “Backspace” to change “6” to “7”, I get “17” instead of “1.7”, because Maputnik changes “1.” to “1” after the “Backspace”.

@pathmapper
Copy link
Contributor

pathmapper commented Oct 5, 2018

I'm all for it. This would allow also to change the source for an existing layer which is not possible currently.

Would it be possible in the JSON editor to mark additionally the line(s) which is/are invalid (e.g. make the line number red)?

@orangemug
Copy link
Collaborator Author

Would it be possible in the JSON editor to mark additionally the line(s) which is/are invalid (e.g. make the line number red)?

Hmmm I'm not sure, but it's a good idea I'll take a look

@pathmapper
Copy link
Contributor

pathmapper commented Oct 11, 2018

There is already something similar to indicate parse errors:

auswahl_426

image

@sk1p
Copy link
Contributor

sk1p commented Jan 6, 2019

Any thoughts or feedback welcome and encouraged

I like it! Maybe in addition to the layer-wide error, also highlight the field that is currently invalid.

@pathmapper
Copy link
Contributor

pathmapper commented Jan 29, 2019

There are two regressions in master since v1.5.0 which are likely related: #484, #488

@orangemug
Copy link
Collaborator Author

Closed by PR #620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants