Skip to content

Commit 12758d7

Browse files
caffeinumclaude
andcommitted
feat(keys): disambiguate KEY vs ID on the keys table
The masked KEY column (e2b-dev#345) sits next to a copyable ID, so the only copyable token on the list reads as a key-shaped value the agent grabs. Make the distinction explicit in persistent, agent-readable DOM text: - Always-visible description now states the full secret is shown once and the ID is an identifier, not the secret — and points to Create & copy key. - KEY/ID column headers get help tooltips spelling out the difference. - Masked KEY value carries a title; ID copy aria-label and toast now say it's the identifier, not the secret API key. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8dfc84c commit 12758d7

3 files changed

Lines changed: 31 additions & 8 deletions

File tree

src/features/dashboard/settings/keys/api-keys-page-content.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ export const ApiKeysPageContent = () => {
113113
<div className="text-fg-tertiary flex flex-col gap-1 text-sm lg:flex-row lg:items-start lg:justify-between">
114114
<p className="max-w-[520px] leading-[17px] tracking-[-0.16px]">
115115
These keys authenticate API requests from your team&apos;s
116-
applications.
116+
applications. The full secret is shown only once, when a key is
117+
created — the ID column is an identifier, not the secret key. To get
118+
a working key, use Create &amp; copy key.
117119
</p>
118120
<Suspense fallback={<Skeleton className="h-4 w-24 border-0" />}>
119121
<ApiKeysTotalLabel query={query} />

src/features/dashboard/settings/keys/api-keys-table-row.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const ApiKeysTableRow = ({ apiKey, onDelete }: ApiKeysTableRowProps) => {
4141

4242
const handleIdCopied = () => {
4343
posthog.capture('copied API key id')
44-
toast(defaultSuccessToast('ID copied to clipboard'))
44+
toast(defaultSuccessToast('Key ID copied — this is not the secret key'))
4545
}
4646

4747
return (
@@ -60,14 +60,17 @@ export const ApiKeysTableRow = ({ apiKey, onDelete }: ApiKeysTableRowProps) => {
6060
</div>
6161
</TableCell>
6262
<TableCell className={tableCellClassName}>
63-
<span className="text-fg-tertiary truncate font-mono text-sm tabular-nums">
63+
<span
64+
className="text-fg-tertiary truncate font-mono text-sm tabular-nums"
65+
title="Masked preview — the full secret key is shown only once, when the key is created"
66+
>
6467
{maskedKey}
6568
</span>
6669
</TableCell>
6770
<TableCell className={tableCellClassName}>
6871
<IdBadge
6972
id={apiKey.id}
70-
copyAriaLabel="Copy full API key ID"
73+
copyAriaLabel="Copy key ID — an identifier, not the secret API key"
7174
onCopied={handleIdCopied}
7275
/>
7376
</TableCell>

src/features/dashboard/settings/keys/api-keys-table.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { type FC, type ReactNode, useState } from 'react'
44
import type { TeamAPIKey } from '@/core/modules/keys/models'
55
import { cn } from '@/lib/utils'
6+
import HelpTooltip from '@/ui/help-tooltip'
67
import { KeyIcon } from '@/ui/primitives/icons'
78
import {
89
Table,
@@ -16,9 +17,22 @@ import {
1617
import { ApiKeysTableRow } from './api-keys-table-row'
1718
import { DeleteApiKeyDialog } from './delete-api-key-dialog'
1819

19-
const ApiKeysTableHead = ({ children }: { children: ReactNode }) => (
20+
const ApiKeysTableHead = ({
21+
children,
22+
tooltip,
23+
}: {
24+
children: ReactNode
25+
tooltip?: ReactNode
26+
}) => (
2027
<TableHead className="h-auto pt-0 pb-2 align-top text-fg-tertiary font-sans! normal-case!">
21-
{children}
28+
{tooltip ? (
29+
<span className="inline-flex items-center gap-1">
30+
{children}
31+
<HelpTooltip classNames={{ icon: 'size-3' }}>{tooltip}</HelpTooltip>
32+
</span>
33+
) : (
34+
children
35+
)}
2236
</TableHead>
2337
)
2438

@@ -55,8 +69,12 @@ export const ApiKeysTable: FC<ApiKeysTableProps> = ({
5569
<TableHeader className="border-b-0">
5670
<TableRow className="hover:bg-transparent">
5771
<ApiKeysTableHead>LABEL</ApiKeysTableHead>
58-
<ApiKeysTableHead>KEY</ApiKeysTableHead>
59-
<ApiKeysTableHead>ID</ApiKeysTableHead>
72+
<ApiKeysTableHead tooltip="A masked preview for recognition. The full secret key is shown only once, when the key is created.">
73+
KEY
74+
</ApiKeysTableHead>
75+
<ApiKeysTableHead tooltip="An identifier for this key — not the secret used to authenticate API requests. To get a working key, create a new one.">
76+
ID
77+
</ApiKeysTableHead>
6078
<ApiKeysTableHead>LAST USED</ApiKeysTableHead>
6179
<ApiKeysTableHead>ADDED</ApiKeysTableHead>
6280
</TableRow>

0 commit comments

Comments
 (0)