https://sonarly.com/issue/21336?type=bug
The "New API Key" page lacks loading feedback during save and silently swallows mutation errors, causing users to rage-click the Save button with no visual response.
Fix: Added loading state and error handling to the API key creation page (`SettingsDevelopersApiKeysNew`), matching the exact pattern used in the sibling `SettingsDevelopersApiKeyDetail` component:
1. **Loading state**: Added `useState(false)` for `isLoading`, set to `true` before the async save operation begins, and reset to `false` in a `finally` block. Passed `isLoading` to `SaveAndCancelButtons` which disables the Save button and shows a spinner during the operation.
2. **Error handling**: Wrapped the two sequential mutations (`createApiKey` + `generateApiKeyToken`) in a `try/catch/finally` block. On failure, an error snackbar is displayed via `enqueueErrorSnackBar` — the same hook and pattern used throughout the settings pages.
3. **Silent failure fix**: The `if (!newApiKey) return` silent failure now shows an error snackbar before returning, so users see feedback when the mutation returns no data.
These changes prevent rage clicks by:
- Showing a loading spinner on the Save button during the async operation
- Disabling the button while the operation is in progress (preventing duplicate submissions)
- Displaying an error toast if the operation fails (instead of silently doing nothing)