diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsx index be05477697..197075123e 100644 --- a/client/src/components/Conversations/Convo.tsx +++ b/client/src/components/Conversations/Convo.tsx @@ -390,7 +390,8 @@ function Conversation({ describedBy={projectBadgeProjectId ? projectLabelId : undefined} > {/* Status sits on the avatar so the row's trailing edge stays free for its badges - and menu. The ring is 34px around the 20px icon: offset by half the difference. */} + and menu. The ring is 2.125rem around the 1.25rem icon: offset by half the + difference. Both are rem so the ring follows the icon box at any UI scale. */} {isGenerating && ( @@ -398,7 +399,7 @@ function Conversation({ size={34} strokeWidth={1.9} bgOpacity={0.14} - className="pointer-events-none absolute -top-[7px] -left-[7px]" + className="pointer-events-none absolute -top-[0.4375rem] -left-[0.4375rem] size-[2.125rem]" /> )} {isUnseen && !isGenerating && ( diff --git a/client/src/components/Conversations/__tests__/Convo.status.spec.tsx b/client/src/components/Conversations/__tests__/Convo.status.spec.tsx index 67ce2383a2..92953265cd 100644 --- a/client/src/components/Conversations/__tests__/Convo.status.spec.tsx +++ b/client/src/components/Conversations/__tests__/Convo.status.spec.tsx @@ -9,8 +9,8 @@ jest.mock('@librechat/client', () => ({ useMediaQuery: () => false, useRemScale: () => 1, useToastContext: () => ({ showToast: jest.fn() }), - Spinner: ({ className }: { className?: string }) => ( - + Spinner: ({ className, size }: { className?: string; size?: string | number }) => ( + ), Button: ({ children, ...props }: React.ComponentProps<'button'>) => ( @@ -111,6 +111,21 @@ describe('Conversation row status', () => { expect(rowButton()).toContainElement(ring); }); + it('sizes the ring in rem so it follows the avatar box at any UI scale', () => { + renderRow({ isGenerating: true }); + + expect(screen.getByTestId('status-ring').getAttribute('class')).toContain('size-[2.125rem]'); + }); + + it('offsets the ring in rem so it stays centered on the avatar at any UI scale', () => { + renderRow({ isGenerating: true }); + + const className = screen.getByTestId('status-ring').getAttribute('class') ?? ''; + expect(className).toContain('-top-[0.4375rem]'); + expect(className).toContain('-left-[0.4375rem]'); + expect(className).not.toMatch(/\[\d+px\]/); + }); + it('marks an unseen reply on the avatar and in the title weight', () => { mockIsUnseen = true; const { container } = renderRow();