Implement auth secret deletion from selector menu#11241
Draft
abhishekp106 wants to merge 2 commits into
Draft
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
Adds a right-aligned X button on each Warp-managed secret row in the auth selector chip menu (non-Oz cloud harnesses). Clicking it deletes the secret via ManagedSecretManager, surfaces a success or failure toast, and clears the selection (and persisted last-selected) when the deleted secret was the active one. Duplicate clicks while a delete is in flight are dropped. - Extends AuthSecretEntry with SecretOwner so per-secret deletes use the correct ownership scope (User vs Team) rather than guessing at click time. - Adds HarnessAvailabilityModel::delete_auth_secret plus AuthSecretDeleted / AuthSecretDeletionFailed events, and updates all match-exhaustive subscribers (FTUX, model selector, orchestration pickers, run-agents card) to refresh on Deleted. - Adds an opt-in right-side action hit target to MenuItemFields so the X dispatches a separate action and stops the row's select click from firing alongside it. Existing right-side icons remain decorative. - Derives PartialEq/Eq/Hash on SecretOwner so it can ride along on the selector's PartialEq action enum. Co-Authored-By: Oz <oz-agent@warp.dev>
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
HarnessAvailabilityModel::delete_auth_secretwith newAuthSecretDeleted/AuthSecretDeletionFailedeventslast_selected_auth_secretwhen the deleted secret was the active oneImplements the behavior described in
specs/cloud-mode-auth-secret-deletion/PRODUCT.mdandTECH.mdon this branch.Key changes
app/src/ai/harness_availability.rs:AuthSecretEntrynow carriesSecretOwner(mapped from the GraphQLSpace);delete_auth_secretcallsManagedSecretManager::delete_secret, updates the cache, and emits the new events.app/src/menu.rs: opt-in right-side icon action onMenuItemFields. Clicking the right-side icon dispatches a separate action via its ownHoverable, suppressing the row's click. Existing decorativewith_right_side_iconcallers are unchanged.app/src/terminal/view/ambient_agent/auth_secret_selector.rs: trackspending_deletes, renders the X on managed-secret rows only, handlesDeleteSecret, and reacts toAuthSecretDeleted/AuthSecretDeletionFailed.HarnessAvailabilityEventmatch sites (FTUX dropdown, FTUX view, model selector, orchestration config block, run-agents card) updated to remain match-exhaustive;Deletedrefreshes pickers so the secret disappears across surfaces.crates/managed_secrets/src/client.rs:SecretOwnernow derivesPartialEq,Eq,Hashso it can ride along on the selector'sPartialEqaction enum.Test plan
This PR was created by Oz (running Claude Code).