From 5c687aca6df3747fd55e1f60c76ca59bf4e6e830 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Wed, 29 Jul 2026 20:00:39 +0300 Subject: [PATCH] fix(ui) add round for line height values --- packages/ui/src/components/chat/message/MessageBody.tsx | 3 ++- packages/ui/src/lib/theme/cssGenerator.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/components/chat/message/MessageBody.tsx b/packages/ui/src/components/chat/message/MessageBody.tsx index 56b3bd70..ee65064d 100644 --- a/packages/ui/src/components/chat/message/MessageBody.tsx +++ b/packages/ui/src/components/chat/message/MessageBody.tsx @@ -72,9 +72,10 @@ const getDisplayFileName = (file: string): string => { const TurnChangedFileChipContent = React.memo(({ file, interactive = false }: { file: TurnChangedFile; interactive?: boolean }) => ( {getDisplayFileName(file.file)} diff --git a/packages/ui/src/lib/theme/cssGenerator.ts b/packages/ui/src/lib/theme/cssGenerator.ts index 53ee7476..db202bc7 100644 --- a/packages/ui/src/lib/theme/cssGenerator.ts +++ b/packages/ui/src/lib/theme/cssGenerator.ts @@ -629,7 +629,9 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted); vars.push(' --code-inline-line-height: 1rem;'); vars.push(' --code-inline-letter-spacing: 0;'); vars.push(' --code-inline-font-weight: 400;'); - vars.push(' --code-block-line-height: 1.4rem;'); + // Tool and Markdown code output can stream. Keep its used line height on + // the pixel grid so incremental content growth cannot accumulate remainders. + vars.push(' --code-block-line-height: round(1.4rem, 1px);'); vars.push(' --code-block-letter-spacing: 0;'); vars.push(' --code-block-font-weight: 400;'); vars.push(' --code-line-numbers-line-height: 1.25rem;'); @@ -659,7 +661,7 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted); vars.push(' --markdown-link-line-height: 1.5rem;'); vars.push(' --markdown-link-letter-spacing: 0;'); vars.push(' --markdown-link-font-weight: var(--ui-regular-font-weight, 400);'); - vars.push(' --markdown-code-line-height: 1.35;'); + vars.push(' --markdown-code-line-height: round(1.35em, 1px);'); vars.push(' --markdown-code-letter-spacing: 0;'); vars.push(' --markdown-code-font-weight: 400;'); vars.push(' --markdown-code-block-letter-spacing: 0;');