mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-29 02:33:33 +00:00
Polish the update notification action
Present Open updater as the existing confirm-style button on its own toast row. Opening the Self Update modal now dismisses the persistent notification so users do not need to close it separately.\n\nKeep external update-instruction links unchanged and extend the persistent-toast regression coverage.
This commit is contained in:
parent
a55a76f62b
commit
831bed7a0c
4 changed files with 23 additions and 2 deletions
|
|
@ -11,7 +11,7 @@
|
|||
## Local Contracts
|
||||
|
||||
- Keep proactive UI messages relevant, non-spammy, and safe for display.
|
||||
- Keep update-available notifications visible until the user dismisses them.
|
||||
- Keep update-available notifications visible until the user dismisses them or opens the updater.
|
||||
- Do not expose local diagnostics or update data that should stay internal.
|
||||
|
||||
## Work Guidance
|
||||
|
|
|
|||
|
|
@ -98,10 +98,22 @@ class UpdateCheck(Extension):
|
|||
if not self.agent:
|
||||
return
|
||||
|
||||
message = notif.get(
|
||||
"message",
|
||||
"A newer version of Agent Zero is available. Please update to the latest version.",
|
||||
)
|
||||
message = message.replace(
|
||||
'<a href="#" @click.prevent="$store.selfUpdateStore.openModal()">Open updater</a>.',
|
||||
'<div class="toast-action-row">'
|
||||
'<button type="button" class="button confirm" '
|
||||
'@click="$store.selfUpdateStore.openModal(); '
|
||||
'$store.notificationStore.dismissToast(toast.toastId)">'
|
||||
"Open updater</button></div>",
|
||||
)
|
||||
notifs = self.agent.context.get_notification_manager()
|
||||
notifs.send_notification(
|
||||
title=notif.get("title", "Newer version available"),
|
||||
message=notif.get("message", "A newer version of Agent Zero is available. Please update to the latest version."),
|
||||
message=message,
|
||||
type=notif.get("type", "info"),
|
||||
detail=notif.get("detail", ""),
|
||||
display_time=0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue