High-impact settings apply instantly with no confirmation or undo#2
Open
High-impact settings apply instantly with no confirmation or undo#2
Conversation
…ettings High-impact settings (agent mode, budget ceiling, project schedule) previously applied instantly on click/drag with no way to revert. This is risky because these settings directly control agent behavior and token consumption. - Add reusable `undoToast()` in toast.tsx — shows a 5-second undo window (Gmail-style) for any setting change - SchedulingSection: agent mode buttons now show undo toast with previous value restoration - BudgetSection: slider uses local state during drag, only persists on mouse-up/touch-end via Radix `onValueCommit`, with undo toast - ProjectSection: schedule mode buttons and budget slider get the same undo toast and commit-only slider behavior SUSTN-Task: acb368a4-bf78-4c80-b300-b65594ddee3c
…ct settings The undo toast (shown for agent mode, budget ceiling, and project schedule/budget changes) was being immediately followed by a "Saved" toast from the mutation's onSuccess handler. Both toasts would appear simultaneously or the saved toast would replace the undo toast, creating a confusing UX and cutting the undo window short. - Add an `undoActive` flag in the toast module that suppresses `savedToast()` while an undo toast is visible. The flag auto-clears after the undo duration expires (with a small buffer). - When the user clicks "Undo", re-arm the suppression so the reverse mutation's savedToast is also suppressed. - Fix ProjectSection budget slider undo: use `hadOverride` (captured at commit time) instead of comparing prev value against the global default — the old comparison would incorrectly call clearOverride when a project override happened to equal the global value. - Guard against undefined `serverBudget` in the onValueCommit handler to prevent passing undefined to setLocalBudget or updateOverride. SUSTN-Task: acb368a4-bf78-4c80-b300-b65594ddee3c
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Settings changes for agent mode, budget ceiling, and schedule window are applied immediately on user interaction — there's no confirmation dialog, no 'Save' button, and no undo mechanism.
In SchedulingSection.tsx (~lines 115-119), clicking 'Always on' for agent mode immediately fires a mutation that changes agent behavior. If a user accidentally clicks this, the agent starts consuming their budget immediately with no way to undo except navigating back and changing the setting.
In BudgetSection.tsx (~lines 44-66), dragging the budget ceiling slider fires on every change event. If the user overshoots and sets the ceiling to 10%, the agent could immediately pause work. The slider has min=10 but no confirmation for large changes.
In ProjectSection.tsx (~lines 425-429), project-level overrides for budget and scheduling also apply instantly.
This is particularly risky because these settings directly affect the agent's behavior and token consumption — the core resource the product manages.
Fix: For high-impact settings (agent mode, budget ceiling), add a confirmation step or a brief delay with an 'Undo' toast (similar to Gmail's undo-send). For slider-based settings, only persist on mouse-up/touch-end rather than on every change event. Consider showing the impact of the change before applying it ('This will allow the agent to use up to X tokens this week').
Branch:
sustn/high-impact-settings-apply-instantly-with-no-confirmation-or