diff --git a/client/src/components/Chat/Messages/Elapsed.tsx b/client/src/components/Chat/Messages/Elapsed.tsx index 913f75b81b..62c330ce2b 100644 --- a/client/src/components/Chat/Messages/Elapsed.tsx +++ b/client/src/components/Chat/Messages/Elapsed.tsx @@ -59,8 +59,13 @@ const Elapsed = memo(function Elapsed({ index }: { index: number }) { }, [start]); const labels = getElapsedDurationLabels(seconds * 1000, i18n.language); + /** `ps-1.5` puts the reading on the column everything else in this slot + * shares: the streaming dot pads the same 6px to center on the size-6 + * header icon's axis (see `EmptyTextPart`), and the hover-button glyphs + * that replace the timer sit behind the same `p-1.5`. Inline-start, so + * the alignment holds in RTL. */ return ( - + diff --git a/client/src/components/Chat/Messages/__tests__/Elapsed.spec.tsx b/client/src/components/Chat/Messages/__tests__/Elapsed.spec.tsx index dbc86e732e..15da454316 100644 --- a/client/src/components/Chat/Messages/__tests__/Elapsed.spec.tsx +++ b/client/src/components/Chat/Messages/__tests__/Elapsed.spec.tsx @@ -34,6 +34,9 @@ describe('Elapsed', () => { expect(screen.getByTestId('stream-elapsed')).toHaveTextContent(/^5s$/); expect(screen.getByTestId('stream-elapsed')).toHaveAttribute('aria-hidden', 'true'); expect(screen.getByText('5 seconds elapsed')).toHaveClass('sr-only'); + /** The 6px inline-start inset that lines the reading up with the + * streaming dot and the hover-button glyphs that replace it. */ + expect(screen.getByTestId('stream-elapsed').parentElement).toHaveClass('ps-1.5'); advance(54_000); expect(screen.getByTestId('stream-elapsed')).toHaveTextContent(/^59s$/);