🛠️ Fix: Update Agent Cache and Improve Actions UI (#5020)

* style: improve a11y, localization, and styling consistency of actions input form

* refactor: move agent mutations to dedicated module

* fix: update agent cache on agent deletion + delete and update actions
This commit is contained in:
Danny Avila 2024-12-17 12:45:58 -05:00 committed by GitHub
parent 6ef05dd2e6
commit 0a97ad3915
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 337 additions and 320 deletions

View file

@ -39,7 +39,7 @@ export default function ActionsPanel({
},
onError(error) {
showToast({
message: (error as Error)?.message ?? localize('com_assistants_delete_actions_error'),
message: (error as Error).message ?? localize('com_assistants_delete_actions_error'),
status: 'error',
});
},
@ -68,7 +68,7 @@ export default function ActionsPanel({
const type = watch('type');
useEffect(() => {
if (action?.metadata?.auth) {
if (action?.metadata.auth) {
reset({
type: action.metadata.auth.type || AuthTypeEnum.None,
saved_auth_fields: false,
@ -149,16 +149,16 @@ export default function ActionsPanel({
)}
<div className="text-xl font-medium">{(action ? 'Edit' : 'Add') + ' ' + 'actions'}</div>
<div className="text-token-text-tertiary text-sm">
<div className="text-xs text-text-secondary">
{localize('com_assistants_actions_info')}
</div>
{/* <div className="text-sm text-token-text-tertiary">
{/* <div className="text-sm text-text-secondary">
<a href="https://help.openai.com/en/articles/8554397-creating-a-gpt" target="_blank" rel="noreferrer" className="font-medium">Learn more.</a>
</div> */}
</div>
<Dialog open={openAuthDialog} onOpenChange={setOpenAuthDialog}>
<DialogTrigger asChild>
<div className="relative mb-6">
<div className="relative mb-4">
<div className="mb-1.5 flex items-center">
<label className="text-token-text-primary block font-medium">
{localize('com_ui_authentication')}