-
Notifications
You must be signed in to change notification settings - Fork 828
Generalize A2UI Actions (v0.9) #500
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -317,6 +317,46 @@ | |
| } | ||
| } | ||
| } | ||
| }, | ||
| "Action": { | ||
| "description": "Defines an interaction handler that can either trigger a server-side event or execute a local client-side function.", | ||
| "oneOf": [ | ||
| { | ||
| "type": "object", | ||
| "description": "Triggers a server-side event.", | ||
| "properties": { | ||
| "name": { | ||
| "type": "string", | ||
| "description": "The name of the action to be dispatched to the server." | ||
| }, | ||
| "context": { | ||
| "type": "object", | ||
| "description": "A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.", | ||
| "additionalProperties": { | ||
| "$ref": "#/$defs/DynamicValue" | ||
| } | ||
| } | ||
| }, | ||
| "required": ["name"], | ||
| "additionalProperties": false | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "description": "Executes a local client-side function.", | ||
| "properties": { | ||
| "function": { | ||
| "type": "string", | ||
| "description": "A string specifying the local function to trigger (e.g., 'openUrl(${/url})'). This string can represent nested function calls and data model references." | ||
| } | ||
| }, | ||
| "required": ["function"], | ||
| "additionalProperties": false | ||
| }, | ||
| { | ||
| "type": "string", | ||
| "description": "Shorthand for a local client-side function execution (e.g. 'openUrl(${/url})')." | ||
| } | ||
| ] | ||
| } | ||
|
Comment on lines
+321
to
360
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This pull request introduces a significant new feature: local actions, with both an object and a string shorthand form. However, there are no new test cases being added to verify this new functionality. Adding tests for the new local action formats is important to ensure they are parsed and handled correctly by clients. References
|
||
| } | ||
| } | ||
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.
The
Buttoncomponent examples in the "Defining Actions" section are incorrect. According to thestandard_catalog.jsonschema,Buttondoes not have atextproperty. Instead, it requires achildproperty which should be the ID of a child component (likeText). This issue is present in the "Server Actions", "Local Actions (String Shorthand)", and "Local Actions (Object Definition)" examples.For example, the server action snippet should be structured like this:
{ "component": "Button", "child": "submit_button_label", "action": { "name": "submit_form", "context": { "itemId": "123" } } }...where
submit_button_labelwould be the ID of aTextcomponent defined separately (e.g.,{"id": "submit_button_label", "component": "Text", "text": "Submit"}).Please correct all three examples to align with the
Buttoncomponent's schema.