diff --git a/packages/freecut-editor/consumer-smoke.test.tsx b/packages/freecut-editor/consumer-smoke.test.tsx index 6140a997c..b85ae80fd 100644 --- a/packages/freecut-editor/consumer-smoke.test.tsx +++ b/packages/freecut-editor/consumer-smoke.test.tsx @@ -125,6 +125,10 @@ describe('published FreeCut browser entry', () => { { timeout: 10_000 }, ) + const library = view.container.querySelector('[data-editor-column="library"]')! + expect(library).not.toBeVisible() + fireEvent.click(within(view.container).getByRole('button', { name: 'Show Library' })) + expect(library).toBeVisible() expect(screen.queryByTestId('properties-clip-panel-host')).not.toBeInTheDocument() fireEvent.click(within(view.container).getByRole('button', { name: 'Canvas settings' })) expect(await screen.findByTestId('properties-clip-panel-host')).toBeInTheDocument() diff --git a/packages/freecut-editor/package.json b/packages/freecut-editor/package.json index 5d1a8a09f..76cf36a7e 100644 --- a/packages/freecut-editor/package.json +++ b/packages/freecut-editor/package.json @@ -1,6 +1,6 @@ { "name": "@quantfive/freecut-editor-surface", - "version": "0.3.14", + "version": "0.3.15", "description": "The host-backed FreeCut browser editor surface.", "license": "MIT", "repository": { diff --git a/src/features/editor/components/editor-workspace-shell.test.tsx b/src/features/editor/components/editor-workspace-shell.test.tsx index 9b49f5708..045079a0d 100644 --- a/src/features/editor/components/editor-workspace-shell.test.tsx +++ b/src/features/editor/components/editor-workspace-shell.test.tsx @@ -60,6 +60,16 @@ describe('editor workspace columns', () => { , ) + expect( + container.querySelector('[data-editor-column="library"]')!.style.display, + ).toBe('none') + expect(screen.queryByRole('region', { name: 'editor.refresh.settings' })).toBeNull() + expect(onLayoutChange).toHaveBeenLastCalledWith({ + minimumWidth: 480, + libraryVisible: false, + editorVisible: true, + }) + fireEvent.click(screen.getByRole('button', { name: 'editor.refresh.showLibrary' })) const search = screen.getByLabelText('Transcript search') as HTMLInputElement fireEvent.change(search, { target: { value: 'keep my search' } }) const editor = container.querySelector('[data-editor-column="editor"]')! @@ -157,6 +167,7 @@ describe('editor workspace columns', () => {
, ) + fireEvent.click(screen.getByRole('button', { name: 'editor.refresh.showLibrary' })) const separator = screen.getByRole('separator') fireEvent.keyDown(separator, { key: 'ArrowRight' }) expect(separator.getAttribute('aria-valuenow')).toBe('296') diff --git a/src/features/editor/components/editor-workspace-shell.tsx b/src/features/editor/components/editor-workspace-shell.tsx index f1e05025f..6a0abdedf 100644 --- a/src/features/editor/components/editor-workspace-shell.tsx +++ b/src/features/editor/components/editor-workspace-shell.tsx @@ -31,7 +31,7 @@ export function EditorWorkspaceShell({ const [availableWidth, setAvailableWidth] = useState(280) const [settingsNotice, setSettingsNotice] = useState(false) const settingsSelection = useRef([]) - const [libraryVisible, setLibraryVisible] = useState(true) + const [libraryVisible, setLibraryVisible] = useState(false) const [editorVisible, setEditorVisible] = useState(true) const [libraryWidth, setLibraryWidth] = useState(280) const [metersOpen, setMetersOpen] = useState(false)