Open dhess opened 3 years ago
This is related to hackworthltd/vonnegut#233 and the general problem case LHSs can't be navigated through with the cursor.
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?
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:
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.
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.
It seems unlikely we'll solve this issue in time for the demos or student testing.
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.
Here the
True
andFalse
labels on thecase
branches are not selectable:We should visually indicate that restriction to the user somehow.