Each ZObject key (node) has an inline "mode switcher", to allow the key representation to be changed, which is a necessary but relatively rare use case.# Preamble
Each ZObject key (node) has an inline "mode switcher", to allow the key representation to be changed, which is a necessary but relatively rare use case. Currently we use a drop-down with four options. Sometimes, if the key has content, two of these are disabled.
Pros:
* This uses little space
* Options are visibly mutually intelligible
Cons:
* No opportunity for explanation of what these are for and why
* Not clear why you can or can't do certain actions.
* No "undo" option if you've done something and now decide you don't want to.
We should improve this area.
-----# Design proposal
===Why are we doing this?
===User stories
As a function creator I want to be able to switch modes without losing my work.
As a function creator I want to know why I can't take certain actions when changing modesRemove the mode switcher in favor of a programmatic understanding of the mode based on the selected type. Here's an example in which an editor wants to edit the "Family" key of the object `Calbovista subsculpta` which is of type `Mushroom`:
1. When they open expert mode (accordion with a grey background) they can see that the type of "Family" is `Reference` and that the below `Value` is select/dropdown where they can select or search any other object that can be referenced.
As a function creator I want to be able to easily recover from a hasty decision or mistake when changing modes2. They want to change the type because they know there's an existing function that returns the family of a mushroom given the mushroom name.
===Proposed design solu3. Once they select the function `Mushroom family name` we can assume that the mode is going to be a function call `f(x)`, and the form below will dynamically change to serve this specific purpose.
{F35413457}
Other examples can be found under the "Edit mode" section of [[ https://www.figma.com/file/uNBSv1e4ceA8tGNr29R9vp/Default-component?node-id=1843%3A23161 | this Figma file ]].