feat(cloud): SEC-4 design tweaks - 'A former teammate' / 'Someone' fallbacks, wider who column

This commit is contained in:
Neil
2026-11-12 18:02:57 -08:00
parent 53cdc4edfd
commit d0c4b5432f
5 changed files with 11 additions and 6 deletions
@@ -22,6 +22,8 @@ export type CloudSecretPeople = {
viewerUserId: string | null
/** Display name for a teammate, or null when the roster does not know them. */
nameFor: (userId: string) => string | null
/** True once the team roster has loaded (so a user missing from it has left the team). */
rosterLoaded?: boolean
}
export type CloudSecretListMode =
@@ -47,7 +47,9 @@ function ActivityRow({
? t('cloudSecrets.activity.byYou', 'You')
: (people.nameFor(event.actor.userId) ??
event.actor.name ??
t('cloudSecrets.activity.byTeammate', 'A teammate'))
(people.rosterLoaded && event.orgId
? t('cloudSecrets.activity.byFormerTeammate', 'A former teammate')
: t('cloudSecrets.activity.bySomeone', 'Someone')))
return (
<li className="flex min-h-9 items-center gap-3 px-3 py-2 text-xs" data-secret-event={event.id}>
<span className="w-16 shrink-0 text-muted-foreground">{actionLabel(event.action, t)}</span>
@@ -58,7 +60,7 @@ function ActivityRow({
: cloudSecretScopeLabel(event.scope, t)}
</Badge>
<span
className="w-40 shrink-0 truncate text-muted-foreground"
className="w-48 shrink-0 truncate text-muted-foreground"
title={new Date(event.at).toLocaleString()}
>
{t('cloudSecrets.activity.byWhen', '{{who}} · {{when}}', {
@@ -18,7 +18,7 @@ const REPOS: CloudSecretRepoChoice[] = [
{ key: 'github.com/acme/web', label: 'acme/web' },
{ key: 'github.com/acme/api', label: 'acme/api' }
]
const people = { nameFor: (userId: string) => FIXTURE_NAMES[userId] ?? null }
const people = { nameFor: (userId: string) => FIXTURE_NAMES[userId] ?? null, rosterLoaded: true }
const noop = (): void => {}
function Frame({ children }: { children: React.ReactNode }): React.JSX.Element {
@@ -340,7 +340,7 @@ export const activityAdmin = defineFixture({
<Frame>
<CloudSecretsPane
api={fixtureCloudSecretsApi({
activity: { team: FIXTURE_TEAM_ACTIVITY, personal: FIXTURE_PERSONAL_ACTIVITY, pageSize: 5 }
activity: { team: FIXTURE_TEAM_ACTIVITY, personal: FIXTURE_PERSONAL_ACTIVITY, pageSize: 7 }
})}
repos={REPOS}
people={people}
@@ -26,7 +26,7 @@ function TeamCloudSecretsPane({
},
[members]
)
return <CloudSecretsPane {...props} people={{ nameFor }} />
return <CloudSecretsPane {...props} people={{ nameFor, rosterLoaded: members !== null }} />
}
/** Shown only where Orca Cloud is offered to this account. */
@@ -143,7 +143,8 @@ export const FIXTURE_TEAM_ACTIVITY: CloudSecretEvent[] = [
event(5, 'created', 'org', 'ANTHROPIC_MODEL', 30, 'u_dana'),
event(6, 'created', 'org', 'AI_GATEWAY_API_KEY', 30, 'u_dana'),
// A member who has since left the team: no roster name, so it reads "A teammate".
event(7, 'created', 'org', 'NPM_TOKEN', 170, 'u_gone')
event(7, 'created', 'org', 'NPM_TOKEN', 170, 'u_gone'),
event(8, 'created', 'org', 'SENTRY_DSN', 400, 'u_ravi')
]
export const FIXTURE_PERSONAL_ACTIVITY: CloudSecretEvent[] = [