Commit 950644c9 by CaIon

fix(keys): preserve spacing after desktop quota content

Bound desktop quota content to 180px so column width provides whitespace before the group column. Remove the quota-only padding override to use the same cell padding as other columns. Preserve the mobile quota layout.

Validation: layout regressions failed before the fix and all 26 API key listing tests passed afterward. TypeScript, scoped lint, formatting, production build, and git diff checks passed.
parent bd22e45a
...@@ -166,6 +166,7 @@ it('shows desktop remaining and used amounts side by side without labels, with t ...@@ -166,6 +166,7 @@ it('shows desktop remaining and used amounts side by side without labels, with t
).toHaveClass('grid-cols-2') ).toHaveClass('grid-cols-2')
expect(within(trigger).getByText('80')).toHaveClass('text-left') expect(within(trigger).getByText('80')).toHaveClass('text-left')
expect(within(trigger).getByText('120')).toHaveClass('text-right') expect(within(trigger).getByText('120')).toHaveClass('text-right')
expect(trigger.parentElement).toHaveClass('max-w-45')
expect(trigger).not.toHaveTextContent('$') expect(trigger).not.toHaveTextContent('$')
expect(trigger.querySelector('svg')).toBeNull() expect(trigger.querySelector('svg')).toBeNull()
expect(screen.getByRole('progressbar')).toHaveAttribute('aria-valuenow', '40') expect(screen.getByRole('progressbar')).toHaveAttribute('aria-valuenow', '40')
...@@ -359,11 +360,12 @@ it('combines creation and last use while keeping expiry, models and IP restricti ...@@ -359,11 +360,12 @@ it('combines creation and last use while keeping expiry, models and IP restricti
).toBeInTheDocument() ).toBeInTheDocument()
const timeCell = screen.getByRole('cell', { name: /Created.*Last Used/ }) const timeCell = screen.getByRole('cell', { name: /Created.*Last Used/ })
expect(within(timeCell).getByText('Last Used')).toBeInTheDocument() expect(within(timeCell).getByText('Last Used')).toBeInTheDocument()
expect( const quotaHeader = screen.getByRole('columnheader', { name: 'Quota ($)' })
screen.getByRole('button', { const quotaTrigger = screen.getByRole('button', {
name: /Remaining 80; Remaining percentage 40%; Used amount 120/, name: /Remaining 80; Remaining percentage 40%; Used amount 120/,
}) })
).toBeInTheDocument() expect(quotaHeader).not.toHaveClass('pr-8')
expect(quotaTrigger.closest('td')).not.toHaveClass('pr-8')
}) })
it('restores dates hidden by the old default and preserves unrelated column preferences', async () => { it('restores dates hidden by the old default and preserves unrelated column preferences', async () => {
...@@ -495,6 +497,8 @@ it('keeps mobile quota readable and opens complete model and IP restrictions by ...@@ -495,6 +497,8 @@ it('keeps mobile quota readable and opens complete model and IP restrictions by
name: /Unlimited; Used amount 4,490.16/, name: /Unlimited; Used amount 4,490.16/,
}) })
expect(quota).toHaveTextContent('Remaining($)UnlimitedUsed amount4,490.16') expect(quota).toHaveTextContent('Remaining($)UnlimitedUsed amount4,490.16')
expect(quota.parentElement).toHaveClass('w-full')
expect(quota.parentElement).not.toHaveClass('max-w-45')
expect(quota.querySelector('[data-slot="api-key-quota-values"]')).toHaveClass( expect(quota.querySelector('[data-slot="api-key-quota-values"]')).toHaveClass(
'grid-cols-[auto_minmax(0,1fr)]' 'grid-cols-[auto_minmax(0,1fr)]'
) )
......
...@@ -83,7 +83,7 @@ export function ApiKeyQuotaCell(props: ApiKeyQuotaCellProps) { ...@@ -83,7 +83,7 @@ export function ApiKeyQuotaCell(props: ApiKeyQuotaCellProps) {
<div <div
className={cn( className={cn(
'w-full min-w-0', 'w-full min-w-0',
props.variant === 'card' ? 'space-y-2.5' : 'space-y-1.5' props.variant === 'card' ? 'space-y-2.5' : 'max-w-45 space-y-1.5'
)} )}
> >
<PopoverTrigger <PopoverTrigger
......
...@@ -351,9 +351,6 @@ export function ApiKeysTable() { ...@@ -351,9 +351,6 @@ export function ApiKeysTable() {
)} )}
skeletonKeyPrefix='api-keys-skeleton' skeletonKeyPrefix='api-keys-skeleton'
applyHeaderSize applyHeaderSize
getColumnClassName={(columnId) =>
columnId === 'quota' ? 'pr-8' : undefined
}
toolbarProps={{ toolbarProps={{
searchPlaceholder: t('Filter by name...'), searchPlaceholder: t('Filter by name...'),
searchDebounceMs: 500, searchDebounceMs: 500,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment