-
Notifications
You must be signed in to change notification settings - Fork 327
Editable argument name #13014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editable argument name #13014
Conversation
app/gui/src/project-view/components/GraphEditor/CodeMirrorWidgetBase.vue
Outdated
Show resolved
Hide resolved
const allWidgetsComputed = [ | ||
mkWidget(() => definition.open), | ||
mkWidget(() => definition.open2), | ||
mkWidget(() => definition.suspension), | ||
mkWidget(() => definition.pattern, patternWidget), | ||
mkWidget(() => definition.type?.operator), | ||
mkWidget(() => definition.type?.type), | ||
mkWidget(() => definition.close2), | ||
mkWidget(() => definition.defaultValue?.equals), | ||
mkWidget(() => definition.defaultValue?.expression), | ||
mkWidget(() => definition.close), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use argumentDefinitionToConcrete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a special case in the middle, pattern has a different widget kind and soon other parts (type, default value expression) will have different ones as well.
app/gui/src/project-view/components/GraphEditor/widgets/WidgetText.vue
Outdated
Show resolved
Hide resolved
app/gui/src/project-view/providers/widgetRegistry/editHandler.ts
Outdated
Show resolved
Hide resolved
app/gui/src/project-view/components/GraphEditor/CodeMirrorWidgetBase.vue
Outdated
Show resolved
Hide resolved
app/gui/src/project-view/components/GraphEditor/CodeMirrorWidgetBase.vue
Outdated
Show resolved
Hide resolved
🧪 Storybook is successfully deployed!📊 Dashboard:
|
Added "no changelog needed" as a workaround for broken CI changelog check. The changelog entry is present in the PR. |
…pdowns to not show up in certain cases
5902ea5
to
e17b8b5
Compare
Implement editing grouped component argument names.
Fixes #12911
edit-arg-names.mp4
enter
.arg-name-validation-error.mp4
Important Notes
Fairly big code changes included:
onUpdate
now returns an update result and can be async. That allows widgets to properly handle error states caused by their attempted updates. Injecting an update processor in the middle of the chain also allows for inesrting additional input validation by intermediate widgets (used by argument name editor to only acceptAst.Expr
patterns).codemirror
. Now there is a commonCodeMirrorWidgetBase
component that abstracts away most of the complexities of dealing with the editor, while allowing it to still be configurable (e.g. adding extra extensions). Only the final conversion of widget input data into text and emitting the final edit remains a responsibility of individual widgets. This common layer is now used byWidgetText
,WidgetFunctionName
andWidgetEnsoExpression
, but more widgets with any form of text input can be later ported as needed.widgetPill
shared class.