Skip to content

Conversation

@aaronchongth
Copy link
Member

@aaronchongth aaronchongth commented Dec 24, 2025

New feature implementation

Implemented feature

Fixes #153.

  • added fields description and example_inputs into Diagram
  • propagate usage into diagram editor
  • added those fields into example diagram json files we host
  • will address adding description and example_inputs when exporting, in a separate PR
image

GenAI Use

We follow OSRA's policy on GenAI tools

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Generated-by:

@mxgrey mxgrey added this to PMC Board Dec 24, 2025
@github-project-automation github-project-automation bot moved this to Inbox in PMC Board Dec 24, 2025
@aaronchongth aaronchongth changed the title Ac/diagram desc and ex inputs Diagram description and example inputs Dec 24, 2025
@aaronchongth aaronchongth force-pushed the ac/diagram-desc-and-ex-inputs branch from 094ffbc to 1d32dda Compare December 25, 2025 08:33
Copy link
Contributor

@mxgrey mxgrey left a 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:

Screenshot from 2025-12-29 13-40-29

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>>,
Copy link
Contributor

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 be JsonMessage. The String type 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 Option around Vec. 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>,
Copy link
Contributor

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.

@mxgrey mxgrey moved this from Inbox to In Progress in PMC Board Dec 30, 2025
aaronchongth and others added 7 commits January 1, 2026 11:49
…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]>
@aaronchongth aaronchongth force-pushed the ac/diagram-desc-and-ex-inputs branch from 3126037 to e5d1f63 Compare January 1, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Diagram Editor] Support workflow input help text

2 participants