scastie icon indicating copy to clipboard operation
scastie copied to clipboard

Results blends with code

Open vladap opened this issue 7 years ago • 13 comments

Align results to right or place them on the next line or allow for both in custom settings (but just one is fine). Some users probably use Intellij Scala Worksheet which aligns to the right.

vladap avatar Mar 03 '17 13:03 vladap

It would be nice to let the user select his instrumentation mode.

  • aligned on a panel on the left like scala IDE
  • debug mode (current)
  • any other relevant mode we can think

MasseGuillaume avatar Mar 04 '17 13:03 MasseGuillaume

Why would what you call "debug mode" ever be preferable? As far as I know, all other worksheet modes align results to the right. I don't know any that behave like scastie.

heathermiller avatar Mar 04 '17 13:03 heathermiller

@heathermiller chrome inspector javascript debugger and intellij

idea

MasseGuillaume avatar Mar 04 '17 14:03 MasseGuillaume

IntelliJ is aligned in a right panel. So is the ScalaIDE for Eclipse. Those are the places where people actually have a concept of a worksheet – I'd not call a debugger a worksheet (I don't think the comparison to the JS debugger is valid)

heathermiller avatar Mar 04 '17 14:03 heathermiller

Also, just to re-ask my question: Why would what you call "debug mode" ever be preferable?

heathermiller avatar Mar 04 '17 14:03 heathermiller

i think it's actually preferable to have annotations closer to where they were produced intellij and eclipse probably output it in separate pane just because it's easier if the current scastie way turns out to cause too much trouble, and aligned representation is implemented, there at least should be a way to highlight current line (with it's annotation) to provide visual cue

OlegYch avatar Mar 04 '17 14:03 OlegYch

I disagree that it's desirable to have annotations pushed up against expressions. By panel, I don't mean like an iFrame. I just mean right aligned, not squeezed up against expressions.

So, something like: img_4131

It doesn't have to be really another pane. Just something to unclutter up individual lines of code.

heathermiller avatar Mar 04 '17 14:03 heathermiller

what if you add a box around the annotation

MasseGuillaume avatar Mar 04 '17 15:03 MasseGuillaume

I guess what still makes my eyes itch is that it's so cluttered. Even if there was a box. It's just visually noisy. I like the structured/organized feeling of things where there's a bit of space separating code from result.

If we did the right align thing and had a subtly different color for the line that the cursor was on, there'd be no way to not be able to tell what line the result is on, so that could potentially settle @OlegYch's concerns.

heathermiller avatar Mar 04 '17 15:03 heathermiller

I wouldn't mix worksheet and debug. They have different goals. Worksheet displays result for return value of the whole code block. Debug tries to show as much as possible information for each line of code, here it makes sense to have very close. As such debug mode is much more complex to implement. And I don't think it is goal of Scastie.

vladap avatar Mar 05 '17 11:03 vladap

You can take a look on notebooks - Python, Spark like Zeppelin, Databrics, Jupyther. These shows more complex results and shows them on the next line. If results become more complex it can be better choice but I don't think it were is right not.

I would suggest not to get detracted by this much, The problem is that it blends, commonly used solution for Worksheets with simple results is to the right. I would implement to the right. And wait. If users will have demand for left, next line it can be added later with settings. I wouldn't try to guess what users will prefer the most nor implement more complex solution supporting all sorts of bells right now. Let's just solve the problem in the most simple way and let users vote with usage. They will ask if to the right only will be insufficient.

vladap avatar Mar 05 '17 11:03 vladap

If it should ever evolve into something more complex, like notebooks, it would have to be justified by use cases. I would put anything more complex into Scala project and use IDE. As well debug mode would be justified only for more complex use cases.

I think, the goal here is to have online tool with prepared Scala prepared platform with ecosystem core libraries so that it is easy to try them out, learning purposes. I typically use these things to check out how something works in Scala or some library, e.g. to simulate some implicit search scenario. Overtime it could evolve into being able to share working snippets of code in discussions, e.g. like jsfiddle, Allow to inline working code snippets in blogs. Scala doc could use it for examples (inlined).

vladap avatar Mar 05 '17 12:03 vladap

This got worse with the UI redesign. I'm bumping the priority.

MasseGuillaume avatar Apr 06 '17 22:04 MasseGuillaume