fix(credentials): let members leave a shared credential

Merged
WA
7d ago
+178-35

Summary

  • DELETE /api/credentials/memberships lets any member leave a shared credential (refusing only the last active explicit admin), but the members list hid every row action from non-admins, including on their own row
  • The viewer's own row now shows Leave (with confirm) for members; it navigates back to Integrations or Secrets afterward since explicit membership was their only access
  • Disabled with a tooltip for the last explicit admin, and for workspace/org admins whose credential admin role is inherited (leaving wouldn't remove access)
  • MemberRow takes one optional action instead of canManage/removeDisabled/onRemove; admins' Remove on other rows is unchanged (skill editors updated to the new props, same behavior)
  • New useLeaveCredential marks affected caches stale without refetching the page being left

Type of Change

  • Bug fix

Testing

  • bun run lint, check:react-query, check:client-boundary, check:source-conventions, pre-push type-check

Checklist

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