feat(a2ui): enhance A2UI notification handling and multi-select support

This commit is contained in:
catlog22
2026-02-04 11:11:55 +08:00
parent c6093ef741
commit 1a05551d00
14 changed files with 539 additions and 94 deletions

View File

@@ -255,6 +255,32 @@ function generateQuestionSurface(question: Question, surfaceId: string): {
},
},
});
// Submit/cancel actions for multi-select so users can choose multiple options before resolving
components.push({
id: 'submit-btn',
component: {
Button: {
onClick: { actionId: 'submit', parameters: { questionId: question.id } },
content: {
Text: { text: { literalString: 'Submit' } },
},
variant: 'primary',
},
},
});
components.push({
id: 'cancel-btn',
component: {
Button: {
onClick: { actionId: 'cancel', parameters: { questionId: question.id } },
content: {
Text: { text: { literalString: 'Cancel' } },
},
variant: 'secondary',
},
},
});
break;
}
@@ -284,6 +310,8 @@ function generateQuestionSurface(question: Question, surfaceId: string): {
options: question.options,
required: question.required,
},
/** Display mode: 'popup' for centered dialog (interactive questions) */
displayMode: 'popup' as const,
},
};
}