-
Notifications
You must be signed in to change notification settings - Fork 45
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
Blocks error highlighting #502
Conversation
22f090f
to
b6b5d4b
Compare
^ Rebased on |
Just so folks can see what is possible with the new outline and bubble message APIs, here is a quick preview.
|
👀 this is awesome, the bubble interface is super cool. Need anything from me here as you work through it? |
Not yet. I think we need a bit longer to decide what we want the experience to be. Once we have that, I'd love to get you to review a plan on what layer in the code we branch between the blocks and non-block handling, to keep things maintainable. |
Without correctly setting up the snap submodule and checking out the right version, blocks won't work.
- Upgrade to latest version of Snap - Color math to tell Snap what color we want. This is not really the end of this work. It demonstrates that we have enough flexibility to do what we want. But we probably still need to think about the error color palette in Pyret and how it should work with the semantic color palette of the Blocks world.
b6b5d4b
to
a1223d8
Compare
^ rebased with other recent blocks work, refactored the error code to be a bit simpler, and upgraded to latest snap to get a bug fix that we needed. |
@asolove this is seriously cool. Do you think we're at a place where we could merge this horizon, in time for the 21st? It's non-invasive to horizon, since without loading the blocks editor it's impossible for anyone else to stumble into this code path. |
@schanzer I think what's here is now mergeable. We've discussed lots of options, so a quick update on what's done and what's still up next.
That's clearly helpful and better than it not being there. We should merge this. But it's not as good as it could be. Other stuff I'd like to do:
|
@jpolitz: I think this is ready for review. The blocks side is working well and I reviewed that the non-Blocks case isn't broken in any obvious way. Medium-term, I'd like to push the logic for blocks v regular mode error handling lower down into the hint/position/anchor code, rather than high-up here at the event handlers, but this seemed like the most "clearly not breaking the world" way to do it for now. (And I have no idea how this will mix with anchor, which I guess we should talk about at some point.) |
@asolove The finer-grained highlighting will depend on Jens' continued improvements on the Snap! side, right? He's already made some strides in that direction, but ultimately there's nothing else you can do besides sending the source locations. Outlining is definitely a must. It doesn't block a demo on the 21st, but it would be a killer feature to have in time. Do you think this is possible, now that Jens has added the outlining code? 100% agree on the bubbles. I think the right solution for now is to put up a bubble that says "be sure to read the error message in the Interactions Area!" I suspect whatever code you write here will have to change for Anchor anyway, so I'd rather put our efforts into Anchor once we reach "good enough" on this side. |
@schanzer agreed on all points:
|
Wow, this is really cool. |
Just a heads up, Chrome had a new version today but chromedriver hasn't so the build is waiting for giggio/node-chromedriver#459 to happen, so we got https://app.travis-ci.com/github/brownplt/code.pyret.org/builds/269572980. I can kick Travis to re-build once chromedriver updates. (This is a detail of the CI that we expect chromedriver to uphold the property that its major version matches Travis CI's major Chrome version, which is often not true for a few hours each month. Totally expected and not a big deal.) |
OK cool this is up on https://pyret-horizon.herokuapp.com/blocks. Looks quite good. |
Hmm, +1 that the blocks highlighting behavior doesn't seem to be working for me on horizon. |
I don't think this change got launched, or there may have been some build or cache problem. When I search through https://s3.amazonaws.com/pyret-horizon/new-horizons/cpo-main.jarr.gz.js I can see |
Ugh you're right. But it should be updating... https://app.travis-ci.com/github/brownplt/code.pyret.org/builds/269594551#L671 Everything seems happy with build and deploy, I ran it again this morning to make sure (that's from this morning's build). Frustrating. Nothing has changed about this in a long time, and the other updates are going through just fine. |
Seems to be working for me now. |
OMG it so totally works! This is amazing! |
So I should always |
This PR adds basic error highlighting to the Blocks UI.
When an error is shown in the REPL side, hovering the highlighted bits trigger a matching highlight on the top-level block where the error occured:
It also upgrades Snap to the latest version, which fixes a bug we encountered with Snap not re-running our code generation after some UI interactions.