From bbf60b49f6a4cab709e49e57d45f7911fc7dccae Mon Sep 17 00:00:00 2001 From: Seefs <40468931+seefs001@users.noreply.github.com> Date: Mon, 12 Oct 2026 16:54:24 +0800 Subject: [PATCH] fix(logs): vertically align billing source icons on mobile (#7760) --- .../__tests__/cost-display.test.tsx | 21 +++++++++++++++++++ .../components/log-cost-display.tsx | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/web/src/features/usage-logs/components/__tests__/cost-display.test.tsx b/web/src/features/usage-logs/components/__tests__/cost-display.test.tsx index 9231571540..db5c52a02f 100644 --- a/web/src/features/usage-logs/components/__tests__/cost-display.test.tsx +++ b/web/src/features/usage-logs/components/__tests__/cost-display.test.tsx @@ -147,6 +147,27 @@ describe('log cost display', () => { expect(screen.getByRole('img', { name: 'Subscription' })).toBeVisible() }) + test.each([ + { source: 'subscription', label: 'Subscription' }, + { source: 'wallet', label: 'Wallet' }, + ])( + 'vertically centers the $source icon within its container', + ({ source, label }) => { + renderCost({ + quota: 5000, + other: { billing_source: source }, + showBillingSource: true, + }) + + // Mobile cards give inline-flex descendants a minimum height, so the + // source container must center its smaller icon independently of the badge. + expect(screen.getByRole('img', { name: label })).toHaveClass( + 'inline-flex', + 'items-center' + ) + } + ) + test.each([ { source: 'subscription', label: 'Subscription' }, { source: 'wallet', label: 'Wallet' }, diff --git a/web/src/features/usage-logs/components/log-cost-display.tsx b/web/src/features/usage-logs/components/log-cost-display.tsx index efcfabbbd5..551363c60b 100644 --- a/web/src/features/usage-logs/components/log-cost-display.tsx +++ b/web/src/features/usage-logs/components/log-cost-display.tsx @@ -115,7 +115,7 @@ export function LogCostDisplay(props: LogCostDisplayProps) {