feat: address CodeRabbit review on the segment ID chip: narrow the API reference sentence to endpoints that operate on an existing segment, add an aria-label and a polite sr-only status to the copy button so the copied state reaches assistive technology

This commit is contained in:
Matthew Meszaros
2026-08-31 04:19:20 -07:00
parent 1194f819d0
commit f35d7e5037
2 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -982,7 +982,7 @@ Auth: **Scope** `READ_CRM` · **Org permission** `view_contacts`
## Segments
Segments are saved contact audiences: a list of conditions plus per-contact manual overrides. Membership is evaluated live on every read, so a segment never needs rebuilding. Every segment endpoint takes the contact scopes, except enrolling into a campaign, which writes leads and takes `WRITE_CAMPAIGNS`. Every endpoint here addresses a segment by its `id`; besides `GET /segments`, the dashboard shows it on the segment page header (click to copy) and in the row menu of the Segments tab.
Segments are saved contact audiences: a list of conditions plus per-contact manual overrides. Membership is evaluated live on every read, so a segment never needs rebuilding. Every segment endpoint takes the contact scopes, except enrolling into a campaign, which writes leads and takes `WRITE_CAMPAIGNS`. Endpoints that operate on an existing segment address it by its `id`; besides `GET /segments`, the dashboard shows that ID on the segment page header (click to copy) and in the row menu of the Segments tab.
A segment object:
+16 -10
View File
@@ -149,16 +149,22 @@ function SegmentIdChip({ id }: { id: string }) {
}
}
return (
<button
type="button"
onClick={copy}
title="Copy segment ID"
className="mt-1 inline-flex items-center gap-1.5 max-w-full font-mono text-[10.5px] text-slate-400 hover:text-slate-700 transition-colors"
>
<span className="uppercase tracking-[0.14em] font-sans font-medium text-[9.5px]">ID</span>
<span className="truncate">{id}</span>
{copied ? <CheckIcon className="w-3 h-3 text-emerald-600 shrink-0" /> : <CopyIcon className="w-3 h-3 shrink-0" />}
</button>
<>
<button
type="button"
onClick={copy}
aria-label={copied ? "Segment ID copied" : "Copy segment ID"}
title="Copy segment ID"
className="mt-1 inline-flex items-center gap-1.5 max-w-full font-mono text-[10.5px] text-slate-400 hover:text-slate-700 transition-colors"
>
<span className="uppercase tracking-[0.14em] font-sans font-medium text-[9.5px]">ID</span>
<span className="truncate">{id}</span>
{copied ? <CheckIcon className="w-3 h-3 text-emerald-600 shrink-0" /> : <CopyIcon className="w-3 h-3 shrink-0" />}
</button>
<span className="sr-only" role="status" aria-live="polite">
{copied ? "Segment ID copied" : ""}
</span>
</>
);
}