Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/mosaic-api-keys-sticky-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/mosaic': patch
---

The actions menu column in `APIKeysTable` stays pinned to the end edge when the table scrolls horizontally, so each key's menu stays in reach on narrow screens.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,19 @@ describe('APIKeysTable', () => {
expect(columnWidths()).toEqual(loadingWidths);
});

it('pins the actions column to the end edge', async () => {
await renderTable();
const table = await loadedTable();
await within(table).findByText('Web app');

const headers = within(table).getAllByRole('columnheader');
expect(headers[headers.length - 1]).toHaveAttribute('data-sticky', 'end');
for (const name of ['Web app', 'CI pipeline']) {
const trigger = within(table).getByRole('button', { name: `Manage ${name}` });
expect(trigger.closest('[role=cell], td')).toHaveAttribute('data-sticky', 'end');
}
});

it('explains when the user has no keys', async () => {
await renderTable(signedIn([]));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function APIKeysTableSkeleton({
{canManage ? (
<Table.Column
align='end'
sticky='end'
width='4rem'
>
<VisuallyHidden>{m.actions}</VisuallyHidden>
Expand Down Expand Up @@ -77,7 +78,10 @@ export function APIKeysTableSkeleton({
</Text>
</Table.Cell>
{canManage ? (
<Table.Cell align='end'>
<Table.Cell
align='end'
sticky='end'
>
<Skeleton visible={false}>
<Menu.Root>
<Menu.Trigger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export function APIKeysTableView({
{revoke ? (
<Table.Column
align='end'
sticky='end'
width='4rem'
>
<VisuallyHidden>{m.actions}</VisuallyHidden>
Expand Down Expand Up @@ -136,7 +137,10 @@ export function APIKeysTableView({
<Text>{apiKey.lastUsedAtLabel ?? m.neverUsed}</Text>
</Table.Cell>
{revoke ? (
<Table.Cell align='end'>
<Table.Cell
align='end'
sticky='end'
>
<APIKeyActions
messages={m}
apiKey={apiKey}
Expand Down
Loading