Keep invitation identities readable and access actions distinct (#4022)

**Keep invitation identities readable and access actions distinct**

Wrap full recipient and inviter identities without shortening them, make
each revoke/remove action name its exact subject, and retain mobile
controls with compact invitation spacing. Preserve current roles,
ownership protection, confirmations and transport.

Contract-Neutral: Organization-access presentation and regression tests
only; existing API, authority, confirmation and saved-state contracts
are unchanged.

**Record comparable organization-access browser proof**

Bind the final access sections to their containing source and comparable
desktop/narrow light/dark captures. Preserve the failed initial WebKit
observation alongside corrected positive-readback controls, full native
output and pixel review.

Contract-Neutral: Source-bound browser receipt only; runtime contracts
are unchanged.

---
Fleet candidate `20261106T105926Z-web-product` from the `web-product`
lane. Reviewed tip `806e53fa991641253b93b38b93e5b9eb8da7a49b` on `main`.

[How Pulse handles
triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
This commit is contained in:
pulse-triage[bot]
2026-11-06 13:27:12 +00:00
committed by GitHub
4 changed files with 174 additions and 7 deletions

View File

@@ -0,0 +1,48 @@
{
"version": 1,
"base_sha": "8fa2973b2afda09b23fa80b2f6eec2201deb3344",
"verified_at": "2026-11-06T11:18:13.107Z",
"result": "passed",
"changed_paths": [
"frontend-modern/src/components/Settings/OrganizationAccessInvitationsSection.tsx",
"frontend-modern/src/components/Settings/OrganizationAccessMembersSection.tsx"
],
"content_sha256": {
"frontend-modern/src/components/Settings/OrganizationAccessInvitationsSection.tsx": "20892f6816cb85b839d1b69797157f76b38612b1643c43f8a424b50404dbff30",
"frontend-modern/src/components/Settings/OrganizationAccessMembersSection.tsx": "4a6235291d9d7f040a3fc05fdd6bd5d994fcac170509eef0372bcd6c0b89662f"
},
"routes": [
"/proof-preview/index.html: isolated production OrganizationAccessPanel consuming the same components, state hook, OrgsAPI and apiClient as /settings/organization/access; not full-App navigation"
],
"viewports": [
{
"width": 1440,
"height": 1000
},
{
"width": 390,
"height": 844
}
],
"states": [
"Comparable manager initial directory in light and dark themes, desktop and narrow",
"Long recipient and inviter identities, independent editor/viewer roles and controls; owner and non-owner member rows",
"Read-only session warning and role badges without administration",
"Post-revocation surviving peer and members; cancelled member confirmation and keyboard focus"
],
"interactions": [
"Real production-panel reads through OrgsAPI and HTTP client with safe fixture responses",
"Keyboard revoke of one exact invitation: selected-org and CSRF headers; one DELETE and post-write readback; peer invitation and members retained",
"Keyboard removal cancellation: original exact member/organization confirmation, no DELETE",
"Confirmed member removal: one exact DELETE and positive owner/peer readback; owner removal stays unavailable",
"Assert unique full-user revoke/remove accessible names, full pending text without overflow, retained 44px touch targets and first-viewport phone member removal"
],
"browser_versions": {
"playwright": "1.56.1",
"chromium": "141.0.7390.37",
"webkit": "26.0"
},
"source_build": "8fa2973b2afda09b23fa80b2f6eec2201deb3344 / source-lpy05x9u; before 280a08690ca5b4d18b025a30126acfc68d72f400 / source-eqouf712",
"before_proof_note": "Initial bounded before matrix: five Chromium scenarios complete, later WebKit immediate-reread assertion failed. Preserved exit1 and all outputs. Corrected WebKit-only positive-readback observation passed without replaying Chromium; same source/fixture/build/theme/viewport. Earlier deadline/output-bound attempts remain adverse.",
"pixel_review": "Opened every retained before and after capture natively. Full identities now readable on phone without losing the existing controls/role distinctions; desktop and read-only layout/information preserved. Independent review still required."
}

View File

@@ -71,27 +71,32 @@ export const OrganizationAccessInvitationsSection: Component<
</Show>
<Show when={props.state.canManageCurrentOrg() && props.state.pendingInvitations().length > 0}>
<section class="rounded-md border border-border p-4 space-y-3">
<section class="rounded-md border border-border p-3 space-y-2 sm:p-4 sm:space-y-3">
<div>
<h4 class="text-sm font-semibold text-base-content">Pending Invitations</h4>
<p class="text-sm text-muted">These users still need to accept access.</p>
</div>
<div class="space-y-3">
<div class="space-y-2 sm:space-y-3">
<For each={props.state.pendingInvitations()}>
{(invitation) => (
<div class="flex flex-col gap-2 rounded-md border border-border bg-surface px-3 py-3 sm:flex-row sm:items-center sm:justify-between">
<div class="space-y-1">
<div
role="group"
aria-label={`Pending invitation for ${invitation.userId}`}
class="flex flex-col gap-1 rounded-md border border-border bg-surface px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-2 sm:py-3"
>
<div class="min-w-0 space-y-1 [overflow-wrap:anywhere]">
<div class="text-sm font-medium text-base-content">{invitation.userId}</div>
<div class="text-xs text-muted">
Invited by {invitation.invitedBy || 'an admin'} on{' '}
{formatOrgDate(invitation.invitedAt)}
</div>
</div>
<div class="flex items-center gap-2">
<div class="flex shrink-0 items-center gap-2">
<OrganizationRoleBadge role={invitation.role} />
<Button
variant="dangerOutline"
size="mdCompact"
aria-label={`Revoke invitation for ${invitation.userId}`}
onClick={() => void props.state.revokeInvitation(invitation.userId)}
disabled={!props.state.canChangeAccess()}
>

View File

@@ -101,6 +101,7 @@ export const OrganizationAccessMembersSection: Component<OrganizationAccessMembe
variant="dangerGhost"
size="xs"
class="gap-1"
aria-label={`Remove ${member.userId} from organization`}
onClick={() => {
void props.state.removeMember(member);
}}

View File

@@ -169,6 +169,117 @@ afterEach(() => {
});
describe('OrganizationAccessPanel', () => {
const pendingInvitations = () =>
[
'provisioningserviceaccountfortheoperationsdepartmentanddisasterrecoveryteam@example.test',
'analyst@example.test',
].map((userId) => ({
userId,
role: 'editor' as const,
invitedBy: 'centralidentitymanagementadministratorfortheoperationsdepartment@example.test',
invitedAt: '2026-11-01T12:00:00Z',
}));
it('identifies each pending invitation and its revocation action without shortening identities', async () => {
listPendingInvitationsMock.mockResolvedValue(pendingInvitations());
renderPanel();
for (const invitation of pendingInvitations()) {
const group = await screen.findByRole('group', {
name: `Pending invitation for ${invitation.userId}`,
});
expect(within(group).getByText(invitation.userId, { exact: true })).toBeVisible();
expect(group).toHaveTextContent(`Invited by ${invitation.invitedBy}`);
expect(within(group).getByText('editor', { exact: true })).toBeVisible();
expect(
within(group).getByRole('button', {
name: `Revoke invitation for ${invitation.userId}`,
}),
).toBeEnabled();
}
expectNoWrites();
});
it.each([0, 1])(
'revokes only the invitation named by action %s and rereads saved access',
async (index) => {
let invitations = pendingInvitations();
const target = invitations[index].userId;
const retained = invitations[1 - index].userId;
listPendingInvitationsMock.mockImplementation(async () => invitations);
revokeInvitationMock.mockImplementation(async (_orgId, userId) => {
invitations = invitations.filter((invitation) => invitation.userId !== userId);
});
renderPanel();
fireEvent.click(
await screen.findByRole('button', { name: `Revoke invitation for ${target}` }),
);
await waitFor(() =>
expect(
screen.queryByRole('group', { name: `Pending invitation for ${target}` }),
).not.toBeInTheDocument(),
);
expect(revokeInvitationMock).toHaveBeenCalledExactlyOnceWith(
'org-a',
target,
expect.objectContaining({ expectedOrgID: 'org-a', retry: false }),
);
expect(
await screen.findByRole('group', { name: `Pending invitation for ${retained}` }),
).toBeVisible();
expect(await screen.findByText('user-2', { exact: true })).toBeVisible();
expect(removeMemberMock).not.toHaveBeenCalled();
expect(updateMemberRoleMock).not.toHaveBeenCalled();
expect(inviteMemberMock).not.toHaveBeenCalled();
expect(acceptMyInvitationMock).not.toHaveBeenCalled();
expect(declineMyInvitationMock).not.toHaveBeenCalled();
},
);
it.each(['user-2', 'user-3'])(
'names member removal for %s and keeps the existing confirmation',
async (target) => {
listMembersMock.mockResolvedValue([
...baseMembers,
{ userId: 'user-3', role: 'viewer', addedAt: '2026-11-01T12:00:00Z' },
]);
vi.mocked(confirm).mockReturnValue(false);
renderPanel();
for (const userId of ['user-2', 'user-3']) {
expect(
await screen.findByRole('button', { name: `Remove ${userId} from organization` }),
).toBeEnabled();
}
expect(
screen.queryByRole('button', { name: 'Remove user-1 from organization' }),
).not.toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: `Remove ${target} from organization` }));
expect(confirm).toHaveBeenCalledOnce();
expect(vi.mocked(confirm).mock.calls[0][0]).toContain(target);
expect(vi.mocked(confirm).mock.calls[0][0]).toContain('Organization A');
expectNoWrites();
},
);
it('does not expose named invitation or member administration in a read-only session', async () => {
listPendingInvitationsMock.mockResolvedValue(pendingInvitations());
setReadOnly(true);
renderPanel();
await screen.findByText('user-2', { exact: true });
expect(
screen.queryByRole('button', { name: /^Revoke invitation for / }),
).not.toBeInTheDocument();
expect(
screen.queryByRole('button', { name: /^Remove .* from organization$/ }),
).not.toBeInTheDocument();
expectNoWrites();
});
const sameNamedInvitations = () =>
['client-east', 'client-west'].map((orgId) => ({
orgId,
@@ -321,7 +432,7 @@ describe('OrganizationAccessPanel', () => {
),
);
} else {
fireEvent.click(screen.getByRole('button', { name: 'Remove' }));
fireEvent.click(screen.getByRole('button', { name: 'Remove user-2 from organization' }));
await waitFor(() =>
expect(removeMemberMock).toHaveBeenCalledWith(
'org-a',
@@ -394,7 +505,9 @@ describe('OrganizationAccessPanel', () => {
await screen.findByText('user-2');
expect(screen.queryByRole('textbox', { name: 'Invite user ID' })).not.toBeInTheDocument();
expect(screen.queryByRole('combobox', { name: 'Role for user-2' })).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'Remove' })).not.toBeInTheDocument();
expect(
screen.queryByRole('button', { name: /^Remove .* from organization$/ }),
).not.toBeInTheDocument();
expect(listPendingInvitationsMock).not.toHaveBeenCalled();
expectNoWrites();
},