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(desktop): stop 360px scrollLeft leak without touching popup or overlay overflow

purple04fa3e5fdd73
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7a4e328e..c56763f2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -138,6 +138,11 @@ installs stop losing environment variables to it.
the web catalog, instead of pricing as free.
- **The model marks now live in the model list only**, the line above the
message box is gone; the Flash notice sits next to the Agent toggle.
+- **At a narrow window width, picking a model or opening the sampling or
+ plugins popups no longer shifts the whole chat sideways.** The shared chat
+ area allowed the browser to scroll it into view when a clicked control sat
+ partly off screen. That area no longer accepts a programmatic scroll, so it
+ stays put.
## [3.0.0] - 2026-09-13
diff --git a/e2e/flash-notice-real-geometry.spec.ts b/e2e/flash-notice-real-geometry.spec.ts
index 385e7d32..3f1af45f 100644
--- a/e2e/flash-notice-real-geometry.spec.ts
+++ b/e2e/flash-notice-real-geometry.spec.ts
@@ -24,21 +24,35 @@ import { routeCloud, seedOnboardingDone, signInViaGate, cloudSwitch } from './su
const CORS = { 'access-control-allow-origin': '*', 'access-control-allow-headers': 'authorization, content-type' }
/**
- * Selects the model at a roomy default width, THEN resizes to the size under
- * test.
+ * Picks the model through the real UI, natively at the size under test where
+ * the trigger is actually reachable, at a roomy width first where it is not.
*
- * Found while writing this proof, unrelated to Blocker A1: `ModelSelector`'s
- * dropdown, opened at 360px, leaves the shared scroll-clipped ancestor
- * (`ChatView.tsx`'s `overflow-hidden` content column) scrolled roughly 290px
- * to the right afterwards (`scrollLeft` on an `overflow-hidden` element is
- * still settable, and something, likely a focus-follow on the picked row,
- * sets it). That drags the WHOLE chat column, this popup's trigger included,
- * off-screen to the left, permanently, for reasons that have nothing to do
- * with this popup. Picking the model before narrowing the window sidesteps
- * that pre-existing bug instead of silently proving something else.
+ * Runde 4 (19.09.2026) tried native selection at all three sizes, including
+ * 360px. Runde 5 (19.09.2026, Nachmessung) found that does not hold at 360px,
+ * independent of the scrollLeft leak: the composer action row itself is
+ * wider than its box there (measured `scrollWidth` 586 against `clientWidth`
+ * 207, `ChatInput.tsx`'s action row carries no scroll of its own), so
+ * "Select chat model" sits at `x` 525, fully past the 360px window edge, the
+ * same as "Sampling" (423) and "Send message" (732). A real pointer cannot
+ * reach a control past the window edge either. The scrollLeft leak this spec
+ * used to trip over was Playwright's OWN actionability assist calling
+ * `scrollIntoView` on the nearest scrollable ancestor to reach it, something
+ * no real click ever does on its own; that assist is exactly what dragged
+ * the shared `ChatView.tsx` column sideways. Fixing the leak at the root
+ * (that ancestor now carries `overflow-clip` instead of `overflow-hidden`,
+ * proven in `e2e/model-selector-scroll-leak.spec.ts`) also removes the one
+ * thing that used to paper over this pre-existing, separate narrowness bug:
+ * `overflow-clip` rejects the same `scrollIntoView` assist, so the click now
+ * honestly times out instead of silently dragging the chat. That narrowness
+ * bug is real and unfixed, but it is not this fix's to solve (it needs its
+ * own toolbar-layout work, out of scope for a scrollLeak root fix), so 360px
+ * keeps the pre-Runde-4 workaround: pick the model at a roomy width first,
+ * then resize down. 900 and 1280px have no such overflow (measured
+ * `scrollWidth === clientWidth` there), so both pick natively.
*/
async function boot(page: Page, width: number, height: number): Promise<void> {
- await page.setViewportSize({ width: Math.max(width, 1024), height: Math.max(height, 700) })
+ const REACHABLE_AT_TARGET_WIDTH = width >= 900
+ await page.setViewportSize(REACHABLE_AT_TARGET_WIDTH ? { width, height } : { width: 1024, height: Math.max(height, 700) })
await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME })
await seedOnboardingDone(page)
await routeCloud(page, { license: 'active', access: true, mediaLive: true, paidPlan: true })
@@ -56,7 +70,7 @@ async function boot(page: Page, width: number, height: number): Promise<void> {
await page.getByRole('button', { name: /New Chat/i }).first().click()
await page.getByRole('button', { name: 'Select chat model', exact: true }).click()
await page.getByRole('button', { name: /Llama 3.1 8B Turbo/ }).click()
- await page.setViewportSize({ width, height })
+ if (!REACHABLE_AT_TARGET_WIDTH) await page.setViewportSize({ width, height })
}
interface Box { x: number; y: number; width: number; height: number }
diff --git a/e2e/model-selector-scroll-leak.spec.ts b/e2e/model-selector-scroll-leak.spec.ts
new file mode 100644
index 00000000..f728141c
--- /dev/null
+++ b/e2e/model-selector-scroll-leak.spec.ts
@@ -0,0 +1,223 @@
+import { test, expect, type Page } from '@playwright/test'
+import { tauriMockInit, DEFAULT_ASSISTANT_REPLY, DEFAULT_MODEL_NAME } from './support/tauri-mock'
+import { seedOnboardingDone } from './support/cloud-mock'
+
+/**
+ * Alt-Fehler (gefunden waehrend der Flash-Popup-Arbeit, Runde 4, 19.09.2026,
+ * Wurzel-Fix neu gefasst Runde 5): bei 360px Fensterbreite fasst die
+ * Aktionszeile des Composers (Clip, Voice, Think, Effort, die view-eigenen
+ * Actions, Sampling, der Modellwaehler, Send) mehr Knoepfe, als die Zeile
+ * breit ist (gemessen: `scrollWidth` 586 gegen `clientWidth` 207,
+ * `ChatInput.tsx` traegt selbst keinen eigenen Bildlauf). Ein Klick auf einen
+ * Ausloeser, der teilweise oder ganz ausserhalb der sichtbaren Zeile lag,
+ * loeste Playwrights eigene Actionability-Pruefung aus, die vor jedem
+ * `.click()` das Ziel per `scrollIntoView` in Sicht holt, auch wenn keine
+ * echte Maus das je koennte. Das traf den gemeinsamen `overflow-hidden`-
+ * Vorfahren (`ChatView.tsx`, umschliesst Verlauf UND Composer), und
+ * `overflow: hidden` erlaubt programmatisches Scrollen trotz fehlender
+ * Bildlaufleiste. Das Ergebnis: die ganze Spalte verschob sich seitlich,
+ * Verlauf inklusive, dauerhaft, auch nach dem Schliessen des Menues
+ * (gemessen vor dem Fix: 290 bis 357px).
+ *
+ * Der Fix (`ChatView.tsx`): der gemeinsame Vorfahr traegt jetzt
+ * `overflow-clip` statt `overflow-hidden`. Das clippt genauso (CSS Overflow
+ * Module Level 3), lehnt aber `scrollLeft`-Zuweisungen darauf ab, egal ob
+ * von einer echten Interaktion oder von Playwrights Assist. Die drei Popups
+ * (ModelSelector, SamplingControls, PluginsDropdown) bleiben
+ * `position: absolute`, unveraendert gegenueber dem Stand vor Runde 4.
+ *
+ * Nachmessung Runde 5: bei 360px liegt der Modellwaehler-Ausloeser selbst
+ * bei `x` 525, "Sampling" bei 423, "Send message" bei 732, alle drei
+ * vollstaendig hinter dem 360px-Fensterrand, unabhaengig vom Fix. Das ist
+ * dieselbe Zeilen-Enge, die oben beschrieben ist, nur jetzt ohne den
+ * Playwright-Assist, der sie bisher verdeckt hat: eine echte Maus haette
+ * diese Knoepfe bei 360px nie erreicht. Diese Spec prueft den Leck-Fix
+ * deshalb bei 360px an den Knoepfen, die dort WIRKLICH erreichbar sind
+ * (Clip, Voice, Think, alle innerhalb des 360px-Fensters gemessen), plus
+ * direkt am Vorfahren selbst (Negativkontrolle unten); bei 900 und 1280px,
+ * wo die Zeile keinen Ueberlauf hat (`scrollWidth === clientWidth`,
+ * gemessen), laeuft der volle Oeffnen/Waehlen/Schliessen-Weg am
+ * Modellwaehler selbst.
+ */
+
+/**
+ * Der gemeinsame Vorfahr, der Verlauf UND Composer umschliesst
+ * (`ChatView.tsx`, `flex-1 flex overflow-clip min-h-0`). Gemessen (nicht nur
+ * angenommen): `getComputedStyle().overflowX`/`overflowY` melden fuer diesen
+ * Knoten `'clip'`, NICHT `'hidden'`, die beiden Rechenwerte des CSS Overflow
+ * Module Level 3 sind unterschiedlich. Die Suche prueft deshalb auf beide
+ * Werte, sonst faende sie den naechsten `overflow-hidden`-Vorfahren weiter
+ * oben (`MAIN.overflow-hidden`), der selbst keinen eigenen Ueberlauf hat
+ * (`scrollWidth === clientWidth`) und die Messung stumm bedeutungslos macht.
+ */
+async function findeSchneidendenVorfahren(page: Page) {
+ return page.evaluateHandle(() => {
+ const btn = document.querySelector('[aria-label="Select chat model"]') as HTMLElement
+ let p: HTMLElement | null = btn
+ while (p) {
+ const cs = getComputedStyle(p)
+ if (cs.overflowX === 'hidden' || cs.overflowY === 'hidden' || cs.overflowX === 'clip' || cs.overflowY === 'clip') return p
+ p = p.parentElement
+ }
+ return null
+ })
+}
+
+async function scrollLeftVon(page: Page, handle: Awaited<ReturnType<typeof findeSchneidendenVorfahren>>) {
+ return page.evaluate((el) => (el as HTMLElement | null)?.scrollLeft ?? null, handle)
+}
+
+/**
+ * `--ui-scale` ist die CSS-Variable, die `zoom` auf `#root` treibt
+ * (`index.css:381/518`), Standardwert 1.15. Ohne Ueberschreibung testet jeder
+ * Lauf also schon den Standard; die zweite Stufe (1) wird hier explizit
+ * gesetzt, um beide Werte aus der Aufgabe abzudecken.
+ */
+async function boot(page: Page, width: number, height: number, uiScale = 1.15): Promise<void> {
+ await page.setViewportSize({ width, height })
+ await page.addInitScript(tauriMockInit, { assistantReply: DEFAULT_ASSISTANT_REPLY, modelName: DEFAULT_MODEL_NAME })
+ await seedOnboardingDone(page)
+ await page.goto('/')
+ if (uiScale !== 1.15) {
+ await page.evaluate((s) => document.documentElement.style.setProperty('--ui-scale', String(s)), uiScale)
+ }
+ await page.getByRole('button', { name: /New Chat/i }).first().click()
+}
+
+const WIDE_SIZES: Array<{ label: string; width: number; height: number }> = [
+ { label: '900x600 (kleines Fenster)', width: 900, height: 600 },
+ { label: '1280x800 (breiter Desktop)', width: 1280, height: 800 },
+]
+
+for (const { label, width, height } of WIDE_SIZES) {
+ for (const uiScale of [1, 1.15]) {
+ test(`scrollLeft bleibt 0 durch Oeffnen, Waehlen, Schliessen bei ${label}, --ui-scale ${uiScale}`, async ({ page }) => {
+ await boot(page, width, height, uiScale)
+ const vorfahr = await findeSchneidendenVorfahren(page)
+ expect(await scrollLeftVon(page, vorfahr)).toBe(0)
+
+ const trigger = page.getByRole('button', { name: 'Select chat model', exact: true })
+ await trigger.click()
+ expect(await scrollLeftVon(page, vorfahr), 'nach dem Oeffnen').toBe(0)
+
+ const menu = page.getByTestId('model-picker-menu')
+ await expect(menu).toBeVisible()
+ // Das Menue selbst muss vollstaendig bedienbar bleiben: nicht nur
+ // "gefunden" (`toBeVisible` prueft CSS-Sichtbarkeit, nicht Lage im
+ // Fenster), das X-lose Menue hat hier keinen eigenen Schliessknopf, also
+ // wird die erste Modellzeile direkt vermessen.
+ const row = page.locator('[data-testid="model-picker-menu"] [role="button"]').first()
+ await expect(row).toBeVisible()
+ const kasten = await row.boundingBox()
+ expect(kasten, 'die Modellzeile muss ein messbares Rechteck haben').not.toBeNull()
+ if (kasten) {
+ expect(kasten.x).toBeGreaterThanOrEqual(0)
+ expect(kasten.y).toBeGreaterThanOrEqual(0)
+ expect(kasten.x + kasten.width).toBeLessThanOrEqual(width + 0.5)
+ expect(kasten.y + kasten.height).toBeLessThanOrEqual(height + 0.5)
+ }
+
+ await row.click()
+ await expect(menu).toBeHidden()
+ expect(await scrollLeftVon(page, vorfahr), 'nach der Wahl, Menue zu').toBe(0)
+
+ // Nochmal oeffnen und mit Escape schliessen, der zweite Weg hinaus.
+ await trigger.click()
+ await expect(menu).toBeVisible()
+ await page.keyboard.press('Escape')
+ await expect(menu).toBeHidden()
+ expect(await scrollLeftVon(page, vorfahr), 'nach Escape').toBe(0)
+ })
+ }
+}
+
+/**
+ * 360px: der Modellwaehler selbst ist nicht erreichbar (siehe Dateikopf),
+ * unabhaengig vom Fix. Geprueft wird hier trotzdem der volle Umfang des
+ * Fixes bei genau dieser Breite: `scrollLeft` startet bei 0, bleibt 0 durch
+ * eine echte Interaktion mit einem Knopf, der bei 360px WIRKLICH im Fenster
+ * liegt (Clip, gemessen bei x 106 bis 136), und eine direkte Zuweisung auf
+ * den Vorfahren selbst (das ist exakt die Operation, die `scrollIntoView`
+ * vorher ausgeloest hat) bleibt wirkungslos.
+ */
+for (const uiScale of [1, 1.15]) {
+test(`scrollLeft bleibt 0 bei 360px, auch nach einer echten Interaktion in der Zeile, --ui-scale ${uiScale}`, async ({ page }) => {
+ await boot(page, 360, 720, uiScale)
+ const vorfahr = await findeSchneidendenVorfahren(page)
+ expect(await scrollLeftVon(page, vorfahr)).toBe(0)
+
+ // Ein Knopf, der bei 360px WIRKLICH im Fenster liegt (nicht der
+ // Modellwaehler, siehe Dateikopf): das Clip-Icon, ganz links in der Zeile.
+ const clip = page.getByRole('button', { name: /Attach images/ })
+ const box = await clip.boundingBox()
+ expect(box, 'der Clip-Knopf muss messbar sein').not.toBeNull()
+ if (box) {
+ expect(box.x).toBeGreaterThanOrEqual(0)
+ expect(box.x + box.width).toBeLessThanOrEqual(360)
+ }
+ await clip.click()
+ expect(await scrollLeftVon(page, vorfahr), 'nach dem Klick auf einen erreichbaren Knopf').toBe(0)
+
+ // Genau die Operation, die vor dem Fix ueber `scrollIntoView` auf diesem
+ // Vorfahren landete: eine direkte `scrollLeft`-Zuweisung. `overflow: clip`
+ // lehnt sie ab, `overflow: hidden` (der Zustand vor dem Fix) haette sie
+ // angenommen, siehe die Negativkontrolle unten.
+ await page.evaluate((el) => {
+ const node = el as HTMLElement | null
+ if (node) node.scrollLeft = 300
+ }, vorfahr)
+ expect(await scrollLeftVon(page, vorfahr), 'nach direkter scrollLeft-Zuweisung').toBe(0)
+})
+}
+
+/**
+ * Negativkontrolle: beweist, dass die Messung oben wirklich etwas prueft.
+ *
+ * Am LAUFENDEN, echten Baum wird der Fix zur Laufzeit zurueckgedreht (keine
+ * Quelldatei angefasst, `page.evaluate` setzt nur die Inline-Stilregel des
+ * gefundenen Vorfahren zurueck): er bekommt wieder `overflow: hidden`, genau
+ * der Zustand vor diesem Fix, in dem `scrollLeft`-Zuweisungen wirken.
+ */
+test('Negativkontrolle: ohne overflow-clip auf dem Vorfahren wirkt eine scrollLeft-Zuweisung', async ({ page }) => {
+ await boot(page, 360, 720)
+ const vorfahr = await findeSchneidendenVorfahren(page)
+ expect(await scrollLeftVon(page, vorfahr)).toBe(0)
+
+ await page.evaluate((el) => {
+ (el as HTMLElement | null)?.style.setProperty('overflow', 'hidden')
+ }, vorfahr)
+
+ await page.evaluate((el) => {
+ const node = el as HTMLElement | null
+ if (node) node.scrollLeft = 300
+ }, vorfahr)
+
+ const nachher = await scrollLeftVon(page, vorfahr)
+ expect(nachher, 'mit overflow: hidden statt clip nimmt der Vorfahr die Zuweisung an').not.toBe(0)
+})
+
+/**
+ * Sichtbarkeitsfall fuer den VoiceButton-Tooltip: diese Runde ruehrt
+ * `ChatInput.tsx`s Werkzeugzeile selbst nicht an (anders als Runde 4, die
+ * die Zeile auf `overflow-x-auto` umstellte und damit `overflow-y` auf
+ * `auto` mitzog, was den Tooltip, der `bottom-full` ueber die Zeile hinaus
+ * oeffnet, abschnitt, siehe Review-Blocker 3). Der Fix dieser Runde aendert
+ * nur den VIEL groesseren `ChatView.tsx`-Vorfahren, dessen Kasten den
+ * Tooltip an dieser Stelle bei weitem nicht beruehrt. Gemessen bei 360px,
+ * wo im Testaufbau kein STT installiert ist (`sttSupported` false), also
+ * "Microphone unavailable" mit eigenem Tooltip.
+ */
+test('VoiceButton-Tooltip bleibt bei 360px vollstaendig sichtbar, nicht abgeschnitten', async ({ page }) => {
+ await boot(page, 360, 720)
+ const mic = page.getByRole('button', { name: 'Microphone unavailable' })
+ await expect(mic).toBeVisible()
+ await mic.hover()
+ const tooltip = page.locator('.group\\/mic .absolute.bottom-full')
+ await expect(tooltip).toHaveCSS('opacity', '1')
+ const kasten = await tooltip.boundingBox()
+ expect(kasten, 'der Tooltip muss ein messbares Rechteck haben').not.toBeNull()
+ if (kasten) {
+ expect(kasten.y, 'oberer Rand nicht negativ, also nicht ueber das Fenster hinaus').toBeGreaterThanOrEqual(0)
+ expect(kasten.height, 'eine echte Hoehe, nicht auf 0 geclippt').toBeGreaterThan(10)
+ }
+})
diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx
index c0bb7f30..cf24cda1 100644
--- a/src/components/chat/ChatView.tsx
+++ b/src/components/chat/ChatView.tsx
@@ -277,7 +277,19 @@ export function ChatView() {
the AnimatePresence as ONE instance: a second copy per branch would
drop the draft the moment the first message creates the conversation,
which is worse than having no input field at all. */}
- <div className="flex-1 flex overflow-hidden min-h-0">
+ {/* Runde 5 (19.09.2026): `overflow-hidden` clippt visuell, verhindert aber
+ KEIN programmatisches Scrollen. Klickt man einen Ausloeser, der
+ teilweise ausserhalb der 360px-Zeile liegt (Modellwaehler, Sampling,
+ Plugins), holt der Browser das fokussierte Element per `scrollLeft`
+ auf GENAU DIESEM Vorfahren "in Sicht", und das verschiebt den ganzen
+ Chat seitlich, dauerhaft. `overflow-clip` clippt genauso, laesst aber
+ kein programmatisches Scrollen zu (CSS Overflow Module Level 3):
+ `scrollLeft`-Zuweisungen darauf bleiben wirkungslos. Beide Achsen
+ duerfen hier `clip` sein, kein Nachkomme haengt `scrollTop`,
+ `scrollTo` oder `scrollIntoView` an DIESES Element (grep gegen
+ `src/components/chat/`, siehe `flashchip.md` Runde 5); der Verlauf
+ traegt seinen eigenen `overflow-y-auto` weiter unten. */}
+ <div className="flex-1 flex overflow-clip min-h-0">
<div className="flex-1 flex flex-col min-w-0 relative">
{chatMode === 'codex' && activeConversationId ? (
<CodexView />
diff --git a/src/components/chat/FlashChatNotice.tsx b/src/components/chat/FlashChatNotice.tsx
index 4111c151..15754679 100644
--- a/src/components/chat/FlashChatNotice.tsx
+++ b/src/components/chat/FlashChatNotice.tsx
@@ -280,7 +280,23 @@ export function FlashChatNotice() {
}
place()
window.addEventListener('resize', place)
- return () => window.removeEventListener('resize', place)
+ // Runde 4 (19.09.2026): bisher stand hier nur `resize`. Ein Scroll auf
+ // einem der beiden Vorfahren, die diese Rechnung schon kennt
+ // (`abschneidendeFlaeche` und die 360px-Zeile in `ChatInput.tsx`), aendert
+ // `rect`/`grenze` genauso wie ein Resize, ohne dass eines gefeuert wird:
+ // das Panel blieb an der ALTEN Stelle haengen, obwohl sein Ausloeser
+ // laengst woanders stand. `capture: true`, weil ein Scroll auf einem
+ // inneren Container (die Composer-Zeile zum Beispiel) nicht zum `window`
+ // hochblubbert, nur in der Einfangphase ankommt, dasselbe Argument wie
+ // `useAnchoredPopover.ts` (Web) und `create/ui/Select.tsx`/`Tooltip.tsx`
+ // (Desktop) es fuer ihre eigenen Popover schon fuehren. `passive: true`,
+ // weil `place()` nichts an dem Scroll selbst aendert (kein
+ // `preventDefault`), nur danach neu misst.
+ window.addEventListener('scroll', place, { capture: true, passive: true })
+ return () => {
+ window.removeEventListener('resize', place)
+ window.removeEventListener('scroll', place, true)
+ }
}, [open])
if (!policy) return null
diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.ts
index 2e577794..2a0bb37f 100644
--- a/src/lib/release-notes.ts
+++ b/src/lib/release-notes.ts
@@ -159,6 +159,7 @@ export const RELEASE_NOTES: ReleaseNote[] = [
'The reason the Coding Agent will not let go of its current folder is now shown as a visible line, instead of only a tooltip a disabled button never shows.',
'ltx-2 LoRA renders in the desktop app now carry a credit cost, matching the web catalog, instead of pricing as free.',
'The model marks now live in the model list only, the line above the message box is gone; the Flash notice sits next to the Agent toggle.',
+ 'At a narrow window width, picking a model, opening the sampling sliders or opening the plugins menu used to leave the whole chat shifted sideways afterward, because the shared chat area allowed the browser to scroll it into view when a clicked control sat partly off screen. That area no longer accepts a programmatic scroll, so it stays put.',
],
},
],