Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(chat): line spacing opens paragraphs and messages too, and reaches the Code transcript (C58)

purple7b8480bc8928
diff --git a/e2e/chat-look.spec.ts b/e2e/chat-look.spec.ts
index 5fdeb155..493d723a 100644
--- a/e2e/chat-look.spec.ts
+++ b/e2e/chat-look.spec.ts
@@ -114,6 +114,13 @@ test('a right click in a zoomed transcript opens the menu at the pointer', async
await page.evaluate(() => localStorage.setItem('lu-chat-look', JSON.stringify({ state: { look: {}, zoom: 1.5, backgrounds: {} }, version: 0 })))
await page.reload()
await expect(reply(page)).toBeVisible({ timeout: 30_000 })
+ // The chat view slides in (y 20 -> 0, 250 ms). While it moves, its
+ // transform is the frame a fixed menu sits in, so a click in that window
+ // lands the menu off the pointer. Under load the slide outlasts the boot.
+ await expect.poll(() => reply(page).evaluate((el) => {
+ for (let n: Element | null = el; n; n = n.parentElement) if (getComputedStyle(n).transform !== 'none') return false
+ return true
+ })).toBe(true)
const box = (await reply(page).boundingBox())!
const x = box.x + 40
const y = box.y + box.height / 2
@@ -185,3 +192,34 @@ test('the Memory quick menu opens a long memory in full and edits it', async ({
await page.getByRole('button', { name: /Roleplay setting/, expanded: false }).click()
await expect(page.getByTestId('memory-full')).toContainText('Arin carries a brass key.')
})
+
+test('the line spacing slider spaces lines, paragraphs and messages, in Chat and Code', async ({ page }) => {
+ await boot(page)
+ const lineRatio = (sel: string) => page.locator(sel).first().evaluate((el) => {
+ const t = (el.querySelector('p') ?? el) as HTMLElement
+ return parseFloat(getComputedStyle(t).lineHeight) / parseFloat(getComputedStyle(t).fontSize)
+ })
+ const gap = (sel: string) => page.locator(sel).first().evaluate((el) => parseFloat(getComputedStyle(el).paddingTop))
+ const before = { model: await lineRatio('.lu-msg-model-text'), user: await lineRatio('.lu-msg-user-text'), row: await gap('.lu-msg-row') }
+
+ await page.getByTestId('chat-look-button').click()
+ const slider = page.getByTestId('chat-look-panel').getByRole('slider', { name: 'Line spacing' })
+ // One step from the default: nothing jumps, the gaps match the classes they replace.
+ await slider.focus()
+ await page.keyboard.press('ArrowRight')
+ await expect(page.getByTestId('chat-look-chat')).toHaveClass(/lu-look-leading/)
+ expect(Math.abs((await gap('.lu-msg-row')) - before.row)).toBeLessThan(1)
+ // All the way up: every line and every gap opens.
+ for (let i = 0; i < 20; i++) await page.keyboard.press('ArrowRight')
+ await expect.poll(() => lineRatio('.lu-msg-model-text')).toBeGreaterThan(before.model + 0.4)
+ expect(await lineRatio('.lu-msg-user-text')).toBeGreaterThan(before.user + 0.4)
+ expect(await gap('.lu-msg-row')).toBeGreaterThan(before.row * 1.25)
+
+ // The Code transcript reads with the same spacing (prose, not code blocks).
+ await page.keyboard.press('Escape')
+ await expect(page.getByTestId('chat-look-code')).toHaveCount(0)
+ await page.getByRole('button', { name: 'Code', exact: true }).first().click()
+ const code = page.getByTestId('chat-look-code')
+ await expect(code).toHaveClass(/lu-look-leading/)
+ expect(await code.evaluate((el) => getComputedStyle(el).getPropertyValue('--lu-look-leading'))).toBe('2.2')
+})
diff --git a/src/components/chat/ChatLookScope.tsx b/src/components/chat/ChatLookScope.tsx
index 7559c36e..4bee4c2d 100644
--- a/src/components/chat/ChatLookScope.tsx
+++ b/src/components/chat/ChatLookScope.tsx
@@ -80,6 +80,9 @@ export function ChatLookScope({ variant, className, children }: ScopeProps) {
const zoom = useChatLookStore((s) => s.zoom)
const setZoom = useChatLookStore((s) => s.setZoom)
const look = useChatLookStore((s) => (variant === 'chat' ? s.look : DEFAULT_LOOK))
+ // Line spacing is a reading setting like the zoom: the Code transcript
+ // follows it too. Colours, fonts and layouts stay a chat thing.
+ const lineHeight = useChatLookStore((s) => s.look.lineHeight)
const backgrounds = useChatLookStore((s) => s.backgrounds)
const theme = useSettingsStore((s) => s.settings.theme)
const mode = theme === 'light' ? 'light' : 'dark'
@@ -157,7 +160,10 @@ export function ChatLookScope({ variant, className, children }: ScopeProps) {
[variant, look.customCssOn, look.customCss],
)
- const vars = useMemo(() => (variant === 'chat' ? lookVars(look, mode) : {}), [variant, look, mode])
+ const vars = useMemo(
+ () => (variant === 'chat' ? lookVars(look, mode) : lookVars({ ...DEFAULT_LOOK, lineHeight }, mode)),
+ [variant, look, lineHeight, mode],
+ )
const style = { ...vars, '--lu-chat-zoom': String(zoom) } as CSSProperties
const factor = widthFactor(look.width)
// "Full" is a factor no window reaches, so the column is as wide as the pane.
@@ -173,7 +179,7 @@ export function ChatLookScope({ variant, className, children }: ScopeProps) {
vars['--lu-look-quote'] ? 'lu-look-quotes' : '',
vars['--lu-look-action'] ? 'lu-look-actions' : '',
vars['--lu-look-font'] ? 'lu-look-font' : '',
- variant === 'chat' && look.lineHeight !== DEFAULT_LOOK.lineHeight ? 'lu-look-leading' : '',
+ lineHeight !== DEFAULT_LOOK.lineHeight ? 'lu-look-leading' : '',
variant === 'chat' && look.layout !== 'default' ? `lu-look-${look.layout}` : '',
bgUrl ? 'lu-look-has-bg' : '',
].filter(Boolean).join(' ')
diff --git a/src/index.css b/src/index.css
index 90bd39d9..582caef8 100644
--- a/src/index.css
+++ b/src/index.css
@@ -2994,8 +2994,18 @@ input[type="range"].neuron-range:disabled { cursor: not-allowed; opacity: 0.5; }
.lu-look-actions .lu-msg-text em,
.lu-look-actions .lu-action { color: var(--lu-look-action); font-style: italic; }
.lu-look-font .lu-msg-text { font-family: var(--lu-look-font); }
+/* Line spacing. Not only the line height inside a wrapped paragraph: a
+ roleplay reply is mostly short paragraphs and one-line messages, where that
+ alone moved almost nothing, and the slider looked broken (report 14.11.2026).
+ Paragraph gaps and the gap between messages follow the same value; at the
+ default (1.625) they equal the classes they replace (mb-3, py-1), so the
+ slider has no jump when it first moves. Prose in the Code transcript and
+ in agent notes follows too; code blocks keep their own height. */
.lu-look-leading .lu-msg-text,
-.lu-look-leading .lu-msg-text :is(p, li) { line-height: var(--lu-look-leading); }
+.lu-look-leading .lu-msg-text :is(p, li),
+.lu-look-leading .markdown-content :is(p, li, blockquote, td, th) { line-height: var(--lu-look-leading); }
+.lu-look-leading .markdown-content :is(p, ul, ol, blockquote) { margin-bottom: calc(var(--lu-look-leading) * 0.46rem); }
+.lu-look-leading .lu-msg-row { padding-block: calc(var(--lu-look-leading) * 0.154rem); }
/* Layout "bubbles": the reply gets a bubble too. */
.lu-look-bubbles .lu-msg-model-bubble {