Hierarchical widgets – edit modes #5952
-
Hi @farmaazon and @Frizi. I just had a short call with @farmaazon and I thought it would be good to share here some afterthoughts to be sure we are on the same page. In the list below, there is one idea that is a generalization of what we've been chatting about, so it's important to write it down. Let's consider a code
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I wonder if the connection logic should be somewhat modifyable per widget type. For example, widgets of custom shapes (e.g. join type) might have slightly different requirements around mouse handling. In that way, it would also be possible to create a widget that doesn't allow any connection, if we ever need that.
The dropdown selection logic is just one such implementation of localized edit. I see no issues with allowing other input methods, which would use the same API for submitting changes. Specifically for dropdowns, there is also a complication related to manual input. The entries are displayed in shortened or simplified form, the labels don't have to be valid code. For example, when selecting a column name, the dropdown shows unquoted names. When one is selected, the actual inserted expression ends up being a quoted string literal. Similar thing can happen for other non-string types. Custom entry via input field will have to be aware of correct reverse transformation to transform user input into valid expression. Either way, those specifics are left up to the widget. The edit is performed by providing an expression for replacement at given span tree crumbs.
I like the idea, though it makes #5919 somewhat obsolete. I will still continue with it, as it will be a good first step and will be useful during widget tree development. Eventually all that logic will be moved into the widget tree. In fact, if we would have an "code editor" widget, the edit mode can be implemented as a temporary switch to that widget type for given subtree. Navigating or selecting past start/end of that code could transform further widgets to the left or right into code editors as well. Additionaly, that code editor widget could be integrated with component browser, using existing cursor-aware CB logic. |
Beta Was this translation helpful? Give feedback.
I wonder if the connection logic should be somewhat modifyable per widget type. For example, widgets of custom shapes (e.g. join type) might have slightly different requirements around mouse handling. In that way, it would also be possible to create a widget that doesn't allow any connection, if we ever need that.
The dropdown selection logic is just one such implementation of localized edit. I see no issues with allowing other input methods, which would use the same API for submitting changes.
Specifically for dropdowns, there is also a complication related to manual input. The entries are di…