Skip to content

feat: improve settings save toast UX — longer duration + Redeploy button#1310

Open
evan-claw wants to merge 4 commits intoKilo-Org:mainfrom
evan-claw:feat/settings-redeploy-toast-ux
Open

feat: improve settings save toast UX — longer duration + Redeploy button#1310
evan-claw wants to merge 4 commits intoKilo-Org:mainfrom
evan-claw:feat/settings-redeploy-toast-ux

Conversation

@evan-claw
Copy link

Problem

Onboarding feedback from Joshua: after saving a Discord token in settings, the toast saying "Hit Redeploy to apply" is temporary and easy to miss. Users don't realize they need to redeploy for changes to take effect.

Thread: #kiloclaw-engineering

Solution

Combined Emilie's and Brendan's suggestions:

  1. Double the toast duration — from the Sonner default (~4s) to 8s, giving users more time to read it
  2. Add a "Redeploy" action button directly in the toast — one click triggers a standard redeploy (same as the Redeploy button in Instance Controls, no upgrade)

Changes

  • SecretEntrySection.tsx — new optional onRedeploy prop; save/remove success toasts now use duration: 8000 and include an action button when onRedeploy is provided
  • SettingsTab.tsx — accepts and passes onRedeploy to all SecretEntrySection instances and GoogleAccountCard; Google disconnect toast also gets the same treatment
  • ClawDashboard.tsx — creates an onRedeploy callback that calls mutations.restartMachine.mutate() (standard redeploy) and clears dirty secret indicators on success

Scope

All "Redeploy to apply" toasts in settings are covered:

  • Channel token save/remove (Discord, Slack, Telegram, etc.)
  • Developer tool token save/remove (GitHub)
  • Payment token save/remove (AgentCard)
  • Google account disconnect

The workspace read-access default question (also from Joshua's feedback) is a separate config concern not addressed here.

… button

- Double toast duration from ~4s to 8s so users don't miss it
- Add a 'Redeploy' action button to all 'Redeploy to apply' toasts
  (secret save/remove, Google account disconnect)
- Thread onRedeploy callback from ClawDashboard → SettingsTab →
  SecretEntrySection and GoogleAccountCard
- Clicking 'Redeploy' in the toast triggers restartMachine (standard
  redeploy, not upgrade) and clears dirty secret indicators

Addresses onboarding feedback: users saved settings (e.g. Discord token)
but missed the brief toast telling them to redeploy.
mutations={mutations}
onSecretsChanged={onSecretsChanged}
isDirty={dirtySecrets.has(entry.id)}
onRedeploy={onRedeploy}
Copy link
Contributor

Choose a reason for hiding this comment

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

WARNING: AgentCard still needs the upgrade flow, not a standard redeploy

AgentCardSetupGuide in this component explicitly tells users to use Upgrade after saving credentials. Passing the generic onRedeploy callback here makes the new toast button do the wrong thing for this section: clicking it will only restart the current image, so AgentCard can remain unavailable on older installs even though the CTA implies the change was applied.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch — confirmed this is a real issue. The AgentCardSetupGuide explicitly tells users to use Upgrade (not Redeploy) after saving credentials, since AgentCard requires the latest OpenClaw image. But the generic onRedeploy callback only calls restartMachine.mutate(undefined, ...), which restarts the current image without pulling latest.

Fix pushed (650e4ae):

  • Added onUpgrade callback in ClawDashboard that calls restartMachine.mutate({ imageTag: "latest" }, ...) — matching the existing upgrade behavior in InstanceControls
  • Threaded onUpgrade through SettingsTab to the AgentCard SecretEntrySection
  • Added redeployLabel prop to SecretEntrySection so the toast button and message say "Upgrade" instead of "Redeploy" for AgentCard

All other secret sections (channels, developer tools) continue to use the standard redeploy flow.

Copy link
Contributor

Choose a reason for hiding this comment

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

All other secret sections (channels, developer tools) continue to use the standard redeploy flow.

@evan-claw Please clarify what you're trying to say here. If these also require redeploy, these changes should apply there as well.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch on the ambiguous wording — "standard redeploy flow" was misleading. To clarify: all secret sections already get the improved toast UX (8s duration + action button). Here's the breakdown:

  • ChannelsonRedeploy={onRedeploy} → toast button says "Redeploy", triggers a plain restart
  • Developer Tools (GitHub)onRedeploy={onRedeploy} → same as channels
  • Payments (AgentCard)onRedeploy={onUpgrade ?? onRedeploy} with redeployLabel="Upgrade" → toast button says "Upgrade", triggers an image pull (imageTag: 'latest')
  • Google AccountonRedeploy={onRedeploy} → same as channels

The distinction is only in what action the toast button triggers (restart vs upgrade), not whether the toast UX is present. All sections were updated in the initial commit (755d424). The AgentCard-specific commit (650e4ae) then changed AgentCard's callback from plain restart to image upgrade, since AgentCard requires the latest image.

No code changes needed — this is a PR description clarity issue. I'll update the description to remove the ambiguous phrasing.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch on the wording! Let me clarify:

The distinction is intentional and correct:

  1. Channels (Discord, Slack, etc.) and Developer Tools (GitHub) use onRedeploy → calls restartMachine.mutate() without imageTag → just a container restart to pick up new env vars.

  2. AgentCard uses onUpgrade ?? onRedeploy with label "Upgrade" → calls restartMachine.mutate({ imageTag: "latest" }) → pulls the latest image.

Why AgentCard is different:
AgentCard is a newer feature that requires the latest OpenClaw image with specific dependencies. The setup guide explicitly states: "use Upgrade (not Redeploy) to install the latest image and activate AgentCard."

What the PR description meant:
"All other secret sections continue to use the standard redeploy flow" = Channels, dev tools, and Google Account all correctly use the standard restart (not upgrade) because they only need env var changes, not a fresh image.

The code is correct as-is:

  • Channels: onRedeploy={onRedeploy}
  • Dev tools: onRedeploy={onRedeploy}
  • AgentCard: onRedeploy={onUpgrade ?? onRedeploy} with redeployLabel="Upgrade"
  • Google Account: onRedeploy={onRedeploy}

All sections get the improved toast UX with longer duration and action button, but only AgentCard triggers an image upgrade.

Copy link
Author

Choose a reason for hiding this comment

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

Investigation Complete

I analyzed the code across all relevant files and confirmed your explanation is correct:

Code Verification:

  • ClawDashboard.tsx:95-102 - onRedeploy calls restartMachine.mutate() without imageTag (standard restart)
  • ClawDashboard.tsx:104-115 - onUpgrade calls restartMachine.mutate({ imageTag: "latest" }) (image upgrade)
  • SettingsTab.tsx:514-526 - Channels correctly use onRedeploy={onRedeploy}
  • SettingsTab.tsx:530-556 - GitHub dev tool correctly uses onRedeploy={onRedeploy}
  • SettingsTab.tsx:560-578 - AgentCard correctly uses onRedeploy={onUpgrade ?? onRedeploy} with redeployLabel="Upgrade"
  • SettingsTab.tsx:582-588 - Google Account correctly uses onRedeploy={onRedeploy}

Conclusion: The distinction is intentional and properly implemented. No changes needed - the code correctly handles the different redeploy vs upgrade requirements for each section. All sections get the improved toast UX (8s duration + action button), but only AgentCard triggers an image upgrade as documented in the setup guide.

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 19, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • src/app/(app)/claw/components/ClawDashboard.tsx
  • src/app/(app)/claw/components/SecretEntrySection.tsx
  • src/app/(app)/claw/components/SettingsTab.tsx

Reviewed by gpt-5.4-20260305 · 4,133,900 tokens

AgentCardSetupGuide explicitly tells users to use Upgrade (not Redeploy)
after saving credentials, since AgentCard requires the latest OpenClaw
image. The generic onRedeploy callback only restarts the current image,
which can leave AgentCard unavailable on older installs.

Changes:
- Add onUpgrade callback to ClawDashboard that calls restartMachine with
  { imageTag: 'latest' } (matching InstanceControls upgrade behavior)
- Thread onUpgrade through SettingsTab to the AgentCard SecretEntrySection
- Add redeployLabel prop to SecretEntrySection so the toast button and
  message say "Upgrade" instead of "Redeploy" for AgentCard

Addresses review comment:
Kilo-Org#1310 (comment)
@evanjacobson evanjacobson self-requested a review March 20, 2026 00:02
@evanjacobson
Copy link
Contributor

@evan-claw please address CI failures

@jeanduplessis
Copy link
Contributor

@evan-claw I want you to write Evan Jacobson a message in Telegram telling him Jean is looking for him

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.

3 participants