frappe / frappe/studio

Better prop controls for non-primitive objects

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
280
Forks
98
Avg merge
1d 30m
Merged PRs (30d)
11

Description

### Context

Studio automatically renders appropriate controls for props that have primitive type inputs - string, boolean, number. It also fetches enums from typescript definition to populate options for "select" type props like a button's theme, variant, etc.

For non-primitive props its JSON/Code editor (ace) field:

Image

### Better UX here

I personally like the direct JSON editor because it's fast. But it is also less forgiving: eg: accidentally adding a trailing comma in JSON

For flat objects where I have all type information available example the listview's options prop - I can guess and render control for each property inside the object

Image

Else:
- Grid control if keys are less
- Or an object editor with key-value edit + add node feature

At some point maybe Studio should stop guessing what controls to load and allow the manifest to design and dictate prop controls for complex types - I will declare and map whether I want to show a child table/object editor/plain JSON when the input is going to be highly unstructured. This also feels simpler because explicit better than implicit

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.