Skip to content

fix(ui): show success toast when saving agent configuration#1931

Open
bluzername wants to merge 1 commit intopaperclipai:masterfrom
bluzername:fix/agent-config-save-success-toast
Open

fix(ui): show success toast when saving agent configuration#1931
bluzername wants to merge 1 commit intopaperclipai:masterfrom
bluzername:fix/agent-config-save-success-toast

Conversation

@bluzername
Copy link
Copy Markdown

Problem

When you edit agent configuration (name, instructions, adapter settings, etc) and click Save, the form just quietly go back to normal state. There is no toast, no message, no visual confirmation that the save was successful.

But when the save FAIL, you get a red "Save failed" toast with the error message (line 1459). So the feedback is asymmetrical - you only hear from the system when something go wrong, never when it go right.

This made me click Save multiple times sometimes because I was not sure if it actually work. The button text change from "Saving..." back to "Save" but that transition is easy to miss if you look away for a moment.

What I changed

Added one line in the updateAgent mutation onSuccess callback:

pushToast({ title: "Agent saved", tone: "success" });

Now user see a brief green toast confirming the save. Same pattern used in Routines page when creating a routine (line 132-136) and in many other mutation success handlers across the app.

How to test

  1. Go to any agent detail > Config tab
  2. Change any setting (name, instructions, etc)
  3. Click Save
  4. Should see green "Agent saved" toast appear briefly

1 file, 1 line added.

When user save agent configuration, the onError handler show
a toast with "Save failed" but the onSuccess handler had zero
feedback. The form just silently go back to non-dirty state
and user have to guess if the save actually worked.

Added a simple "Agent saved" success toast in onSuccess. Now
the feedback is symmetrical - error show red toast, success
show green toast.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR adds a single success toast ("Agent saved") to the updateAgent mutation's onSuccess callback in AgentDetail.tsx, closing the asymmetric feedback gap where errors were surfaced via toast but successful saves were silent.

  • Code change: One line added — pushToast({ title: "Agent saved", tone: "success" }) — consistent with the existing error toast pattern in the same mutation and the success-toast pattern used elsewhere in the codebase (e.g., Routines page).
  • Correctness: pushToast is already in scope via useToast() at line 1427, and the new call is placed correctly after query invalidations in onSuccess. No issues found.
  • PR description: The description is missing a "thinking path" (as required by CONTRIBUTING.md) and before/after screenshots of the new toast UI.

Confidence Score: 5/5

Safe to merge — the one-line change is correct, consistent with existing patterns, and carries no risk.

No logic, syntax, or runtime issues found. The only finding is a P2 style/process note about the PR description format and missing screenshots per CONTRIBUTING.md guidelines, which does not block merge.

No files require special attention.

Important Files Changed

Filename Overview
ui/src/pages/AgentDetail.tsx Added pushToast({ title: "Agent saved", tone: "success" }) to the updateAgent mutation's onSuccess callback — a clean, single-line change that mirrors the existing error toast pattern.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: ui/src/pages/AgentDetail.tsx
Line: 1450

Comment:
**PR description missing "thinking path" and screenshots**

Per `CONTRIBUTING.md`, a good PR message should include:
1. A **"thinking path"** that explains the reasoning from the top of the project down to the specific fix (see examples in `CONTRIBUTING.md`).
2. **Before/after screenshots** for any visible UI change — this PR introduces a new success toast, which is a visual change.

The current description explains the problem and the fix well, but it doesn't follow the structured thinking-path format, and no screenshots are included to show what the new success toast looks like.

Could you update the PR description to add a thinking path and include before/after screenshots of the success toast?

**Context Used:** CONTRIBUTING.md has a guide for a good PR message ... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(ui): show success toast when agent c..." | Re-trigger Greptile

queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.urlKey) });
queryClient.invalidateQueries({ queryKey: queryKeys.agents.configRevisions(agent.id) });
queryClient.invalidateQueries({ queryKey: queryKeys.agents.list(agent.companyId) });
pushToast({ title: "Agent saved", tone: "success" });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 PR description missing "thinking path" and screenshots

Per CONTRIBUTING.md, a good PR message should include:

  1. A "thinking path" that explains the reasoning from the top of the project down to the specific fix (see examples in CONTRIBUTING.md).
  2. Before/after screenshots for any visible UI change — this PR introduces a new success toast, which is a visual change.

The current description explains the problem and the fix well, but it doesn't follow the structured thinking-path format, and no screenshots are included to show what the new success toast looks like.

Could you update the PR description to add a thinking path and include before/after screenshots of the success toast?

Context Used: CONTRIBUTING.md has a guide for a good PR message ... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/pages/AgentDetail.tsx
Line: 1450

Comment:
**PR description missing "thinking path" and screenshots**

Per `CONTRIBUTING.md`, a good PR message should include:
1. A **"thinking path"** that explains the reasoning from the top of the project down to the specific fix (see examples in `CONTRIBUTING.md`).
2. **Before/after screenshots** for any visible UI change — this PR introduces a new success toast, which is a visual change.

The current description explains the problem and the fix well, but it doesn't follow the structured thinking-path format, and no screenshots are included to show what the new success toast looks like.

Could you update the PR description to add a thinking path and include before/after screenshots of the success toast?

**Context Used:** CONTRIBUTING.md has a guide for a good PR message ... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant