The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): mermaid zoom overlay body collapsed to zero height
Brooklyn Nicholson6a3a1f411bad
diff --git a/apps/desktop/src/components/ui/zoomable.test.tsx b/apps/desktop/src/components/ui/zoomable.test.tsxnew file mode 100644index 00000000000..45e420cc846--- /dev/null+++ b/apps/desktop/src/components/ui/zoomable.test.tsx@@ -0,0 +1,44 @@+import { cleanup, fireEvent, render, screen } from '@testing-library/react'+import { afterEach, describe, expect, it } from 'vitest'++import { Zoomable } from './zoomable'++afterEach(cleanup)++describe('Zoomable', () => {+ it('opens the full-view overlay when the trigger is clicked', () => {+ render(+ <Zoomable label="Open diagram" overlay={<div data-testid="overlay">Expanded diagram</div>}>+ <div>Inline diagram</div>+ </Zoomable>+ )++ expect(screen.queryByTestId('overlay')).toBeNull()+ fireEvent.click(screen.getByTitle('Open diagram'))+ expect(screen.getByTestId('overlay')).toBeTruthy()+ })++ it('gives the full-view stage flex space inside the fixed-height dialog', () => {+ render(+ <Zoomable label="Open diagram" overlay={<div data-testid="overlay">Expanded diagram</div>}>+ <div>Inline diagram</div>+ </Zoomable>+ )++ fireEvent.click(screen.getByTitle('Open diagram'))++ const dialog = screen.getByRole('dialog')+ const body = dialog.firstElementChild++ // jsdom does not compute flex layout, so height stays 0 either way. The+ // contract that actually failed in Electron is: the body must grow+ // (`flex-1`) inside the h-[85vh] shell, and the pan/zoom stage must too.+ expect(body?.classList.contains('flex-1')).toBe(true)+ expect(body?.classList.contains('min-h-0')).toBe(true)++ const stage = body?.querySelector('.flex-1.overflow-hidden')++ expect(stage).toBeTruthy()+ expect(stage?.contains(screen.getByTestId('overlay'))).toBe(true)+ })+})diff --git a/apps/desktop/src/components/ui/zoomable.tsx b/apps/desktop/src/components/ui/zoomable.tsxindex 63801b9c590..7741022b913 100644--- a/apps/desktop/src/components/ui/zoomable.tsx+++ b/apps/desktop/src/components/ui/zoomable.tsx@@ -80,7 +80,7 @@ function ZoomPanViewer({return (<Dialog onOpenChange={onOpenChange} open={open}><DialogContent- bodyClassName="flex min-h-0 flex-col gap-0 overflow-hidden p-0"+ bodyClassName="flex min-h-0 flex-1 flex-col gap-0 overflow-hidden p-0"className="h-[85vh] w-[90vw] max-w-[90vw]"showCloseButton={false}>