Skip to content

[4645] fix(frontend): wrap API key inside the create-key modal#4746

Open
Koushik-Salammagari wants to merge 1 commit into
Agenta-AI:mainfrom
Koushik-Salammagari:fix/4645-api-key-modal-overflow
Open

[4645] fix(frontend): wrap API key inside the create-key modal#4746
Koushik-Salammagari wants to merge 1 commit into
Agenta-AI:mainfrom
Koushik-Salammagari:fix/4645-api-key-modal-overflow

Conversation

@Koushik-Salammagari

@Koushik-Salammagari Koushik-Salammagari commented Jun 18, 2026

Copy link
Copy Markdown

Summary

The API-key creation success popup (modal.success via AlertPopup) rendered the full key in a flex row with no break rule. A real key is an 8-character prefix plus a 64-character hex secret joined by a single . ({prefix}.{secrets.token_hex(32)}), so the unbreakable hex tail kept the flex item at its full intrinsic width and the key overflowed past the modal edge — the end of the key and the copy icon were clipped out of view.

Root cause: the key <span> was a flex item with the default min-width: auto, so it could not shrink below its content, and it had no word-break, so the long token never wrapped.

Fix (in web/oss/src/components/pages/settings/APIKeys/APIKeys.tsx):

  • key span → min-w-0 break-all so the flex item can shrink and the token can break mid-string within the available width
  • copy-icon span → shrink-0 so it is never squeezed out
  • row → items-start so the copy icon aligns to the first line when the key wraps

No behavior change beyond layout; the same key string and copy action are preserved.

Testing

Verified locally

  • Reproduced the layout with a faithful key ({8-char prefix}.{64 hex chars}) at the real modal.success width (650px). Before: the key is clipped at the modal's right edge and the copy icon is pushed out of view. After: the key wraps onto a second line, fully visible, with the copy icon beside the first line.
  • pnpm lint-fix in web/ — passes with no ESLint warnings or errors.

Added or updated tests

N/A — CSS/layout-only change to a single presentational block; there is no existing test harness around this modal.

QA follow-up

Confirm wrapping on the live create-key flow across light/dark themes and narrow viewports. No data conditions involved.

Demo

Before / after — the created API key now wraps inside the success modal instead of overflowing past its right edge:

Before and after: API key overflowing the modal vs. wrapping inside it

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

The API-key creation success popup rendered the full key in a flex row
without any break rule. A real key is an 8-char prefix plus a 64-char
hex secret (one '.' separator), so the unbreakable hex tail forced the
flex item past its container and the key overflowed the modal edge.

Let the key wrap within the available width and keep the copy icon
pinned beside it:
- key span: min-w-0 + break-all so it can shrink and break mid-token
- icon span: shrink-0 so it is never squeezed out
- row: items-start so the icon aligns to the first line when wrapping

Fixes Agenta-AI#4645
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@Koushik-Salammagari is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 18, 2026
@CLAassistant

CLAassistant commented Jun 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot Bot added the Frontend label Jun 18, 2026
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

✅ Thanks @Koushik-Salammagari! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Jun 18, 2026
@github-actions github-actions Bot closed this Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b324a07b-10bc-48ce-8a1c-3ba2320e834a

📥 Commits

Reviewing files that changed from the base of the PR and between a97e608 and 44dd417.

📒 Files selected for processing (1)
  • web/oss/src/components/pages/settings/APIKeys/APIKeys.tsx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Style
    • Enhanced the visual presentation of the newly created API key success message in the Settings page. Improved layout spacing and alignment for better readability. Refined text wrapping behavior for optimal display of key information. Adjusted the copy button icon positioning for improved usability and visual consistency.

Walkthrough

Two small CSS utility class adjustments in APIKeys.tsx: the flex container displaying a newly created API key gains updated alignment/spacing and truncation classes, and the copy icon's wrapping span receives a shrink-0 class to prevent it from shrinking within the message row.

Changes

API Key Success Message Layout

Layer / File(s) Summary
Success message flex layout and copy icon shrink fix
web/oss/src/components/pages/settings/APIKeys/APIKeys.tsx
Updates flex alignment, spacing, and truncation utility classes on the key text container; adds shrink-0 to the copy icon span to constrain its layout behavior in the message row.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Jun 20, 2026
@github-actions github-actions Bot reopened this Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants