Commit 785f6bac0 for llama.cpp
commit 785f6bac0008a0871f7c9a9b42c441d4052a684c
Author: Chenyang Li <cl4288@cumc.columbia.edu>
Date: Wed Nov 18 16:56:47 2026 -0500
ui : keep streaming reasoning box inside the viewport when zoomed (#31966)
diff --git a/ui/apps/chat/src/lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte b/ui/apps/chat/src/lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte
index df9eee314..0e232bd66 100644
--- a/ui/apps/chat/src/lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte
+++ b/ui/apps/chat/src/lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte
@@ -152,7 +152,8 @@
<style>
.reasoning-content.is-streaming {
- max-height: 28rem;
+ /* page zoom shrinks the viewport, keep the box inside it */
+ max-height: min(28rem, 50dvh);
overflow-y: auto;
scrollbar-gutter: stable;
padding-right: 0.25rem;
diff --git a/ui/apps/chat/tests/client/reasoning-block-viewport.svelte.test.ts b/ui/apps/chat/tests/client/reasoning-block-viewport.svelte.test.ts
new file mode 100644
index 000000000..d88c9cfaf
--- /dev/null
+++ b/ui/apps/chat/tests/client/reasoning-block-viewport.svelte.test.ts
@@ -0,0 +1,51 @@
+// Guards the height of the streaming reasoning box: page zoom shrinks the viewport in
+// CSS px, so a fixed cap would cover most of a zoomed window (#30811).
+
+import ChatMessageReasoningBlock from '#lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte';
+import { AgenticSectionType } from '#lib/enums/index.ts';
+import { afterEach, describe, expect, it } from 'vitest';
+import { page } from 'vitest/browser';
+import { render } from 'vitest-browser-svelte';
+
+const DESKTOP = { height: 900, width: 1280 };
+// a 900px window at 150% zoom
+const ZOOMED = { height: 600, width: 1280 };
+const content = Array.from({ length: 200 }, (_, i) => `thought line ${i}`).join('\n');
+
+function renderStreaming() {
+ return render(ChatMessageReasoningBlock, {
+ isStreaming: true,
+ open: true,
+ section: { content, type: AgenticSectionType.REASONING_PENDING }
+ });
+}
+
+function boxHeight(): number {
+ const box = document.querySelector('.reasoning-content') as HTMLElement;
+
+ return box.getBoundingClientRect().height;
+}
+
+describe('streaming reasoning box height', () => {
+ afterEach(async () => {
+ await page.viewport(DESKTOP.width, DESKTOP.height);
+ });
+
+ it('stays within half of a zoomed viewport', async () => {
+ await page.viewport(ZOOMED.width, ZOOMED.height);
+
+ renderStreaming();
+
+ await expect.poll(() => boxHeight()).toBeGreaterThan(0);
+ expect(boxHeight()).toBeLessThanOrEqual(window.innerHeight / 2);
+ });
+
+ it('keeps the 28rem cap on a full-size window', async () => {
+ await page.viewport(DESKTOP.width, DESKTOP.height);
+
+ renderStreaming();
+
+ await expect.poll(() => boxHeight()).toBeGreaterThan(0);
+ expect(boxHeight()).toBe(448);
+ });
+});