hackworthltd / primer-app

Primer's React frontend application.
GNU Affero General Public License v3.0
4 stars 0 forks source link

Non-selectable nodes (e.g., case branch labels) should be indicated somehow #59

Open dhess opened 3 years ago

dhess commented 3 years ago

Here the True and False labels on the case branches are not selectable:

Screen Shot 2021-01-27 at 3 27 00 PM

We should visually indicate that restriction to the user somehow.

hmac commented 3 years ago

This is related to hackworthltd/vonnegut#233 and the general problem case LHSs can't be navigated through with the cursor.

brprice commented 3 years ago

I am coming round to the opinion that there are two things that a rounded-rectangle is doing:

These being conflated may be a cause for confusion?

brprice commented 3 years ago

A thing to think about: we could remove boxes from non-interactive things, and add boxes to binders (which may be nested within non-interactive nodes, or even interactive nodes). A quick hack to show what I mean:

Screen Shot 2021-02-08 at 15 44 32

dhess commented 3 years ago

I would rather address this by making everything in the tree selectable and "actionable," even if you can't perform an "action" on it (in the Vonnegut sense of "action").

For example, it might be helpful for some users to be able to click on the value or pattern of a case branch and see its type. This functionality would be redundant for experienced programmers, but probably not for beginners.

As another (aspirational) example, it would be great to be able to click on any node in the tree and get documentation or help.

brprice commented 3 years ago

Yes, that also sounds good -- we could for instance have a thing that explains why there is a "Nil" branch.

One thing that doesn't address is how to render Cons x xs whilst allowing users to rename x and xs -- if we want to have them individually selectable we would need either nested boxes or re-jig the tree. Alternately we could have a "rename one of the bound variables" action, and you have to select which in the action pane.

dhess commented 3 years ago

It seems unlikely we'll solve this issue in time for the demos or student testing.

georgefst commented 11 months ago

I would rather address this by making everything in the tree selectable and "actionable," even if you can't perform an "action" on it (in the Vonnegut sense of "action").

Agreed. I'm pretty sure that the only things which are not selectable now are constructors and wildcards in patterns. Plus pattern boxes themselves, if you consider those to count (they are nodes as far as the API is concerned). This can be seen by the places in Primer.API where we have to cook up non-numeric IDs.