Skip to content

fix(api-keys): reuse shared copy button for created keys#432

Merged
Soju06 merged 1 commit intoSoju06:mainfrom
stemirkhan:feat/fix-api-key-copy
Apr 21, 2026
Merged

fix(api-keys): reuse shared copy button for created keys#432
Soju06 merged 1 commit intoSoju06:mainfrom
stemirkhan:feat/fix-api-key-copy

Conversation

@stemirkhan
Copy link
Copy Markdown
Contributor

Summary

  • replace the custom inline copy logic in the API key created dialog with the shared CopyButton
  • reuse the existing clipboard success/error handling instead of calling navigator.clipboard.writeText(...) directly
  • add focused component coverage for copying a newly created API key

Why

The API key created dialog had its own minimal clipboard implementation with no error handling or user feedback on failure. Reusing the shared copy control makes the behavior consistent across browsers and aligns this dialog with the rest of the frontend.

Testing

  • cd frontend && npx -y node@20 ./node_modules/vitest/vitest.mjs run src/components/copy-button.test.tsx src/features/api-keys/components/api-key-created-dialog.test.tsx

Notes

Copy link
Copy Markdown
Owner

@Soju06 Soju06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean refactor replacing the inline clipboard logic with the shared CopyButton component. Approving.

  • Shared CopyButton already has error handling (toast.error("Failed to copy")) which the previous inline version was missing — this is the user-facing improvement behind #127.
  • Removes 36 lines of duplicated component code and drops 2 lucide imports.
  • Frontend-only, no collisions with recently merged #421.
  • CI 18/18 green.

Merging into the v1.13.2 batch.

@Soju06 Soju06 merged commit b59f1c8 into Soju06:main Apr 21, 2026
18 checks passed
@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented Apr 21, 2026

@codex review

(Post-merge audit — missed the pre-merge review step. Triggering now; any findings will be addressed in a follow-up PR.)

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Soju06
Copy link
Copy Markdown
Owner

Soju06 commented Apr 21, 2026

@all-contributors please add @stemirkhan for code, test

(Contributions across #422, #425, #432 — all merged in v1.14.0. Picker UX, request-logs plan column, and the API-key CopyButton refactor that fixes #127.)

@allcontributors
Copy link
Copy Markdown
Contributor

@Soju06

I've put up a pull request to add @stemirkhan! 🎉

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.

не копируется api ключ

2 participants