feat(playground): add copy button when creating an API key#896
Merged
Conversation
df45f99 to
c6cc817
Compare
a6ed323 to
0937771
Compare
leoguillaume
approved these changes
Jun 4, 2026
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.
Overview
This PR improves the user experience around API key creation in the playground.
When a new API key is created, the value is shown only once and cannot be retrieved again. The previous dialog displayed the key in a read-only text area and only offered an "I've copied the key" button that the user had to act on manually, which was error-prone (the key could easily be lost if not copied correctly).
What was done:
Redesigned the "API key created" dialog with a clearer layout (header with icon + title/description, an amber warning callout, the key in a tinted bordered panel, and a footer with actions).
Added a "Copy API key" button that copies the key to the clipboard and shows a success toast, removing the manual copy/paste step.
Replaced the manual "I've copied the key" action with a simple "Done" button to close the dialog.
Added a default expiration date of one year for newly created keys, capped at the configured maximum (
auth_key_max_expiration_days) when one is set.Reset the creation form after a key is created, keeping the default 1-year expiry pre-filled for the next key.
Users can copy the newly created API key in one click (with confirmation feedback).
The new key value remains visible/copyable until the dialog is dismissed.
New keys default to a 1-year expiration, capped at the configured maximum.
Breaking changes:
Check lists
Review checklist
Before requesting a review, please take a moment to confirm that the following aspects have been considered and addressed. This section helps ensure the PR is ready for review, safe to merge, and deployable. If any items are left unchecked, please add a brief explanation for context.
Deployment checklist
For each of the following items, please confirm if the PR concerns the deployment of the changes:
Additional Notes
The expiry default reuses the existing
auth_key_max_expiration_dayssetting to make sure the proposed 1-year default never exceeds the configured maximum.Changes are scoped to two files in the playground:
playground/app/features/keys/components/dialogs.py— redesigned dialog + copy button.playground/app/features/keys/state.py— default 1-year expiry and form reset after creation.Before redesign:

After redesign:
