Skip to content

improvement(settings): unify save/discard across editable surfaces - #6173

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/save-discard-consistency
Aug 2, 2026
Merged

improvement(settings): unify save/discard across editable surfaces#6173
waleedlatif1 merged 1 commit into
stagingfrom
fix/save-discard-consistency

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Save is now always rendered (primary, disabled until there's something to save); Discard only appears once there's something to discard
  • Fixes the reported inconsistency: sandboxes showed no action at all until dirty — so a new sandbox had no visible Create button — while skills always showed a disabled Save and no Discard
  • saveDiscardActions moves to @/components/settings and owns the single rule; create flows pass creating so the Create/Creating… labels can't drift
  • Adds SettingsActionChip / SettingsActionChips so the settings shell and the ReactNode-slot headers (CredentialDetailLayout) render actions through one chip path instead of two copies
  • Skills, secrets, connected credentials, custom tools and the secrets manager drop their hand-rolled Save chips for the shared helper
  • Credential-detail drafts now seed once per credential instead of re-seeding on every refetch, which was silently acting as an implicit discard
  • Removes the "Joins your organization. Adds a seat." member hint from the invite modal

Type of Change

  • Bug fix
  • Improvement

Testing

Tested manually. tsc, bun run lint:check and the sso-settings suite pass.

Not yet verified in a browser: the always-present Save changes the resting header on ~10 surfaces, and the saveTooltip on a disabled Save relies on a new pointer-events-none (a disabled button isn't a hit-test target, so the tooltip never fired before). Both want a look on staging.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Save is now always rendered (primary, disabled until there is something to
save) and Discard only appears once there is something to discard. Previously
sandboxes showed no action at all until dirty — so a new sandbox had no visible
Create button — while skills always showed a disabled Save and no Discard.

- saveDiscardActions moves to @/components/settings and owns the one rule
- adds SettingsActionChip / SettingsActionChips so the settings shell and the
  ReactNode-slot headers render actions through the same chip path
- skills, secrets, connected credentials, custom tools and the secrets manager
  drop their hand-rolled Save chips for the shared helper
- credential-detail drafts seed once per credential instead of re-seeding from
  every refetch, which was acting as an implicit discard
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 2, 2026 12:19am

Request Review

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Wide UI refactor across ~10 editable surfaces changes resting headers and discard semantics; low security risk but worth browser QA on disabled Save tooltips and create flows (e.g. sandboxes).

Overview
Unifies Save / Discard across settings panels and credential-detail headers so behavior and chrome stay consistent.

saveDiscardActions and SaveDiscardChips now live in @/components/settings/save-discard-actions. Save is always shown (primary, disabled until dirty); Discard appears only when dirty. Create flows use creating for paired Create / Creating… labels. The secrets manager can pass saveTooltip when Save is blocked (conflicts / invalid keys).

SettingsActionChip / SettingsActionChips centralize action chip rendering (variant, tooltips on disabled Save via pointer-events-none). Stable action **id**s avoid remounting when labels flip to Saving….

Credential-detail editors (connected integration, skill detail/create, secret value, useCredentialDetailForm) swap hand-rolled Save chips for the shared helper and add explicit discard; drafts seed once per credential/skill id so background refetches do not reset in-progress edits.

Invite modal: removes the “Joins your organization. Adds a seat.” hint for Member membership.

Reviewed by Cursor Bugbot for commit 3edc45f. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR centralizes editable-surface actions and makes Save/Create consistently visible while adding dirty-only Discard behavior.

  • Adds shared Save/Discard action and chip renderers.
  • Migrates settings, credential, secret, skill, sandbox, and enterprise surfaces to the shared action path.
  • Preserves credential drafts across same-credential refetches and adds explicit discard handlers.
  • Removes the standard-member seat hint from the invitation modal.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code regression established across the migrated editable surfaces.

The shared helper preserves existing save, validation, and permission gates while standardizing action visibility, and the draft-seeding changes retain explicit discard paths without an established cross-resource data-loss path.

Important Files Changed

Filename Overview
apps/sim/components/settings/save-discard-actions.tsx Introduces the canonical dirty-aware Save/Discard action configuration and ReactNode-slot chip renderer.
apps/sim/components/settings/settings-header.tsx Consolidates SettingsAction chip rendering and adds stable action identities without an established behavioral regression.
apps/sim/app/workspace/[workspaceId]/components/credential-detail/hooks/use-credential-detail-form.ts Changes credential draft seeding to preserve edits across same-ID refetches and exposes an explicit discard reset.
apps/sim/app/workspace/[workspaceId]/settings/components/secrets/hooks/use-secret-value.ts Adds an explicit reset-to-current-value operation for the shared Discard action.
apps/sim/app/workspace/[workspaceId]/skills/[skillId]/skill-detail.tsx Migrates skill detail actions to the shared Save/Discard chip path and centralizes draft resetting.
apps/sim/app/workspace/[workspaceId]/settings/components/custom-tools/components/custom-tool-detail/custom-tool-detail.tsx Replaces separate create/edit action construction with the shared helper and standardized create labels.
apps/sim/app/workspace/[workspaceId]/settings/components/sandboxes/sandboxes.tsx Uses the shared helper's create mode so sandbox creation consistently exposes a disabled Create action.
apps/sim/app/workspace/[workspaceId]/settings/components/secrets/components/secrets-manager/secrets-manager.tsx Replaces hand-built Save/Discard actions with the shared helper while retaining validation tooltips and disabled conditions.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  E[Editable settings surface] --> H[saveDiscardActions]
  H --> D{Dirty?}
  D -->|No| S[Disabled Save or Create]
  D -->|Yes| DS[Discard plus enabled Save or Create]
  H --> P[SettingsPanel actions]
  H --> C[SaveDiscardChips]
  P --> R[SettingsActionChip]
  C --> R
Loading

Reviews (1): Last reviewed commit: "improvement(settings): unify save/discar..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit bf78c4c into staging Aug 2, 2026
27 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/save-discard-consistency branch August 2, 2026 00:19
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