-
Notifications
You must be signed in to change notification settings - Fork 6
Diagram description and example inputs #155
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
base: main
Are you sure you want to change the base?
Diagram description and example inputs #155
Conversation
094ffbc to
1d32dda
Compare
mxgrey
left a comment
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.
I think this is a good start, but I see some improvements that can be made before we merge it. I've left some inline comments about improving the data structures in the Diagram schema. Besides that, I have some recommendations on improving the UI:
Editing descriptions
I think we should address the ability to edit and export the descriptions and input examples within this PR, because I believe doing that in a follow-up PR will effectively become a rewrite of all the typescript introduced in this PR.
Reduce clutter
I don't think it's necessary for the diagram description or example inputs to always be visible. For example, the node builder descriptions are hidden behind an (i) icon, and show up in a tooltip:
I think we should do something similar for the workflow descriptions. Maybe we can have a (?) or (i) toggle button on the right-hand side of the Run Workflow row that would expand a panel to the right of the Run Workflow widget. That expanded panel would contain a read-only text box of the workflow description, as well as a 📝 button to switch the description text box into an edit mode.
Then for the input examples, we could put a (?) or (i) toggle button on the right-hand side of the Request: row that would expand a panel that lists out the input examples. This would also have a 📝 button to switch into edit mode. This panel would be mutually exclusive with the description panel, so toggling on one would automatically toggle off the other.
These are just rough ideas. I'm happy to further discuss the feasibility or effectiveness of this approach.
src/diagram.rs
Outdated
| pub description: Option<String>, | ||
|
|
||
| /// Examples of inputs that can be used with this workflow. | ||
| pub example_inputs: Option<Vec<String>>, |
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.
A few concerns here:
- For each example input, we should also allow a description, so users can have some context about the input.
- The data type of the input should not be
String, it should beJsonMessage. TheStringtype is too ambiguous, i.e. should the value be interpreted as a literal character string or as the text of a JSON message? - There's no need to wrap
OptionaroundVec. We can tag this field with#[serde(default, skip_serializing_if = "is_default")]. That way the field can just be skipped for empty vectors.
Overall we should see something like
pub struct ExampleInput {
pub value: JsonMessage,
pub description: String,
}#[serde(default, skip_serializing_if = "is_default")]
example_inputs: Vec<ExampleInput>,
src/diagram.rs
Outdated
| pub extensions: Option<ExtensionSettings>, | ||
|
|
||
| /// Optional text to describe the workflow. | ||
| pub description: Option<String>, |
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 should tag this field with
#[serde(default, skip_serializing_if = "is_default")]so it can truly be an optional field.
…er in form Signed-off-by: Aaron Chong <[email protected]> Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]> Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]> Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]> Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]> Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
3126037 to
e5d1f63
Compare
New feature implementation
Implemented feature
Fixes #153.
descriptionandexample_inputsintoDiagramdescriptionandexample_inputswhen exporting, in a separate PRGenAI Use
We follow OSRA's policy on GenAI tools
Generated-by: