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.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(gallery): zoomed back out, the large view shows a clean, centred picture (D3, Discord 01.11.)
purple9b61a1f60e8f
diff --git a/src/components/create/experimental/Lightbox.tsx b/src/components/create/experimental/Lightbox.tsxindex 52f35ff4..1035669c 100644--- a/src/components/create/experimental/Lightbox.tsx+++ b/src/components/create/experimental/Lightbox.tsx@@ -97,6 +97,12 @@ export function Lightbox({ item, onClose, onSaveCharacter, onNavigate, promptOpe// the picture, and letting go there does not close the view.const [dragging, setDragging] = useState(false)const dragMoved = useRef(false)+ // Discord 01.11.2026 (3.0.8, Windows): zoomed in and back out, the picture+ // stayed shifted with its last pixel column smeared in stripes beside it,+ // although the zoom itself was back at 1 with no pan. WebView2 kept the+ // composited layer of the zoom. Back at the fitted size the picture gets a+ // fresh element (this key), without the opening animation.+ const [layer, setLayer] = useState(0)useEffect(() => {if (!item) return@@ -123,6 +129,7 @@ export function Lightbox({ item, onClose, onSaveCharacter, onNavigate, promptOpe// Back at the fitted size the picture is centred again.const keep = nextScale > 1 ? { panX, panY } : { panX: 0, panY: 0 }setZoom({ id: item.id, scale: nextScale, x: scale === 1 ? x : zoom.x, y: scale === 1 ? y : zoom.y, ...keep })+ if (scale > 1 && nextScale === 1) setLayer((n) => n + 1)}const onPanStart = (e: React.MouseEvent<HTMLImageElement>) => {@@ -180,7 +187,8 @@ export function Lightbox({ item, onClose, onSaveCharacter, onNavigate, promptOpeif (dragMoved.current) { dragMoved.current = false; return }onClose()}}- className="lu-on-dark fixed inset-0 z-[80] bg-black/85 flex flex-col items-center justify-center gap-3 p-8"+ // Opaque: a stale layer of a zoom must never let the app show through.+ className="lu-on-dark fixed inset-0 z-[80] bg-black flex flex-col items-center justify-center gap-3 p-8"><button onClick={onClose} className="absolute top-4 right-4 w-9 h-9 flex items-center justify-center rounded-lg bg-white/10 text-gray-200 hover:bg-white/20"><X size={18} />@@ -293,7 +301,8 @@ export function Lightbox({ item, onClose, onSaveCharacter, onNavigate, promptOpe/>) : (<motion.img- initial={{ scale: 0.95 }}+ key={layer}+ initial={layer === 0 ? { scale: 0.95 } : false}// The wheel zoom rides on the same scale the opening// animation uses: a style scale next to it would be// animated back to 1.@@ -308,7 +317,11 @@ export function Lightbox({ item, onClose, onSaveCharacter, onNavigate, promptOpeonClick={(e) => { e.stopPropagation(); dragMoved.current = false }}onWheel={onWheel}onMouseDown={onPanStart}- onDoubleClick={(e) => { e.stopPropagation(); setZoom({ id: item.id, scale: 1, x: 50, y: 50, panX: 0, panY: 0 }) }}+ onDoubleClick={(e) => {+ e.stopPropagation()+ if (scale > 1) setLayer((n) => n + 1)+ setZoom({ id: item.id, scale: 1, x: 50, y: 50, panX: 0, panY: 0 })+ }}data-testid="lightbox-image"data-zoom={scale}data-pan={`${Math.round(panX)},${Math.round(panY)}`}diff --git a/src/components/create/experimental/__tests__/grossansicht-zoom-zurueck.test.tsx b/src/components/create/experimental/__tests__/grossansicht-zoom-zurueck.test.tsxnew file mode 100644index 00000000..70e25057--- /dev/null+++ b/src/components/create/experimental/__tests__/grossansicht-zoom-zurueck.test.tsx@@ -0,0 +1,89 @@+// @vitest-environment jsdom+/**+ * Discord #bug-reports 01.11.2026 (3.0.8, Windows): zoomed into a picture of+ * the large view and back out, the picture stayed shifted to the left, to its+ * right the last pixel column was smeared over the whole width in vertical+ * stripes, and the app showed through underneath.+ *+ * The zoom state itself comes back clean (scale 1, no pan, centred origin;+ * measured in Chromium and WebKit with wheel and trackpad). What stayed on+ * screen was the picture's composited layer from the zoom, which WebView2 did+ * not paint again. So the picture now gets a fresh element whenever the zoom+ * is back at 1, and the large view has an opaque backdrop: a stale layer, if+ * one is left, never lets the app show through.+ *+ * Run: npx vitest run src/components/create/experimental/__tests__/grossansicht-zoom-zurueck.test.tsx+ */+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import { cleanup, fireEvent, render, screen } from '@testing-library/react'+import { useState } from 'react'++vi.mock('../CreateContext', () => ({+ useCreateExp: () => ({ quota: null, enhanceVideo: vi.fn() }),+}))+vi.mock('../useComfyMedia', () => ({+ useComfyMedia: () => ({ src: 'blob:media', onError: vi.fn(), onLoad: vi.fn() }),+}))+vi.mock('../../../../api/mlx-image', () => ({ isMlxImageHost: () => false, MLX_MODEL_PREFIX: 'MLX ' }))++import { useCreateStore, type GalleryItem } from '../../../../stores/createStore'+import { Lightbox } from '../Lightbox'++const ITEM = (id: string): GalleryItem => ({+ id, type: 'image', filename: `${id}.png`, subfolder: '', prompt: `prompt ${id}`, negativePrompt: '',+ model: 'm.safetensors', modelType: 'sdxl', seed: 1, steps: 20, cfgScale: 5, sampler: 'euler',+ scheduler: 'normal', width: 1536, height: 2304, batchSize: 1, createdAt: 1,+})++beforeEach(() => {+ useCreateStore.setState({ backend: 'local', gallery: [ITEM('a')], galleryFolders: [], galleryFolderOpen: null })+})+afterEach(() => { cleanup() })++function Viewer() {+ const [item, setItem] = useState<GalleryItem | null>(useCreateStore.getState().gallery[0])+ return <Lightbox item={item} onClose={() => setItem(null)} onNavigate={setItem} />+}+const img = () => screen.getByTestId('lightbox-image') as HTMLImageElement+const wheel = (dy: number, n: number) => { for (let i = 0; i < n; i++) fireEvent.wheel(img(), { deltaY: dy }) }++describe('zoom in and back out in the large view', () => {+ it('back at 1 the picture is centred, without pan, on a fresh element', () => {+ render(<Viewer />)+ const before = img()+ wheel(-100, 12)+ expect(img().dataset.zoom).toBe('5')+ fireEvent.mouseDown(img(), { button: 0, clientX: 10, clientY: 10 })+ fireEvent.mouseMove(window, { clientX: 60, clientY: 40 })+ fireEvent.mouseUp(window)+ wheel(100, 12)+ expect(img().dataset.zoom).toBe('1')+ expect(img().dataset.pan).toBe('0,0')+ // A new element: the zoomed layer is not carried back to scale 1.+ expect(img()).not.toBe(before)+ })++ it('the same after a double-click back to the fitted size', () => {+ render(<Viewer />)+ wheel(-100, 3)+ const zoomed = img()+ fireEvent.doubleClick(img())+ expect(img().dataset.zoom).toBe('1')+ expect(img()).not.toBe(zoomed)+ })++ it('zooming in keeps the element (no flicker while zooming)', () => {+ render(<Viewer />)+ const before = img()+ wheel(-100, 3)+ expect(img()).toBe(before)+ })++ it('the large view has an opaque backdrop, the app never shows through', () => {+ render(<Viewer />)+ const backdrop = img().closest('.fixed.inset-0') as HTMLElement+ const classes = backdrop.className.split(/\s+/)+ expect(classes).toContain('bg-black')+ expect(classes.some((c) => /^bg-black\/\d+$/.test(c))).toBe(false)+ })+})