From 62e98358c2d7f219df95fa46f02f395103af6c40 Mon Sep 17 00:00:00 2001 From: Matthew Meszaros Date: Sat, 12 Sep 2026 07:23:53 -0700 Subject: [PATCH] feat: keep the contacts list's subscribed state and the campaign lead's progress readable by a screen reader below sm, where both pills are their icon alone and the word was display:none, by holding the label in a permanently screen-reader-only span and hiding the visible copy from the accessibility tree instead, which also keeps the sm+ label's truncation intact where sm:not-sr-only would have reset the overflow and white-space that truncate depends on --- .../components/app/contacts/ContactsTable.tsx | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/web/src/components/app/contacts/ContactsTable.tsx b/web/src/components/app/contacts/ContactsTable.tsx index b2538754..5e73f740 100644 --- a/web/src/components/app/contacts/ContactsTable.tsx +++ b/web/src/components/app/contacts/ContactsTable.tsx @@ -1233,9 +1233,10 @@ function ContactsTableBody({ {!embedded && Phone} {/* Below sm the pill is its icon alone, so the column - narrows to it. The label goes to screen readers - rather than away, or the column loses its name. */} - {embedded ? "Progress" : "Status"} + narrows to it and the label waits for the room — + but never leaves the accessibility tree. */} + {embedded ? "Progress" : "Status"} + {embedded ? "Progress" : "Status"} {embedded && ( <> @@ -1522,18 +1523,23 @@ function Th({ children, className }: { children: React.ReactNode; className?: st } function StatusPill({ subscribed }: { subscribed: boolean }) { - if (subscribed) { - return ( - - - subscribed - - ); - } + const label = subscribed ? "subscribed" : "unsubscribed"; return ( - - - unsubscribed + + + {/* The dot carries the state on its own below sm, so the word stays + for screen readers at every width and the visible copy is the + one that comes and goes. */} + {label} + + {label} + ); } @@ -1620,7 +1626,8 @@ function LeadStatusPill({ lead }: { lead?: ContactCampaignProgress | null }) { ) : ( )} - + {meta.label} + {meta.label}