diff --git a/e2e/playwright/fixtures/homePageFixture.ts b/e2e/playwright/fixtures/homePageFixture.ts index 07044ae37ef..09d77b01496 100644 --- a/e2e/playwright/fixtures/homePageFixture.ts +++ b/e2e/playwright/fixtures/homePageFixture.ts @@ -99,7 +99,6 @@ export class HomePageFixture { createAndGoToProject = async (projectTitle = 'untitled') => { await this.projectsLoaded() await this.projectButtonNew.click() - await this.projectTextName.click() await this.projectTextName.fill(projectTitle) await this.projectButtonContinue.click() } diff --git a/e2e/playwright/snapshot-tests.spec.ts b/e2e/playwright/snapshot-tests.spec.ts index a064b763190..5295247434d 100644 --- a/e2e/playwright/snapshot-tests.spec.ts +++ b/e2e/playwright/snapshot-tests.spec.ts @@ -588,6 +588,7 @@ test( 'Draft circle should look right', { tag: '@snapshot' }, async ({ page, context, cmdBar, scene }) => { + test.fixme(orRunWhenFullSuiteEnabled()) const u = await getUtils(page) await page.setViewportSize({ width: 1200, height: 500 }) const PUR = 400 / 37.5 //pixeltoUnitRatio diff --git a/src/components/CommandBar/CommandBar.tsx b/src/components/CommandBar/CommandBar.tsx index 0af977af7dc..a1613b5781d 100644 --- a/src/components/CommandBar/CommandBar.tsx +++ b/src/components/CommandBar/CommandBar.tsx @@ -14,6 +14,7 @@ import { commandBarActor, useCommandBarState, } from '@src/machines/commandBarMachine' +import toast from 'react-hot-toast' export const COMMAND_PALETTE_HOTKEY = 'mod+k' @@ -35,13 +36,23 @@ export const CommandBar = () => { commandBarActor.send({ type: 'Close' }) }, [pathname]) + /** + * if the engine connection is about to end, we don't want users + * to be able to perform commands that might require that connection, + * so we just close the command palette. + * TODO: instead, let each command control whether it is disabled, and + * don't just bail out + */ useEffect(() => { if ( - immediateState.type !== EngineConnectionStateType.ConnectionEstablished + !commandBarActor.getSnapshot().matches('Closed') && + (immediateState.type === EngineConnectionStateType.Disconnecting || + immediateState.type === EngineConnectionStateType.Disconnected) ) { commandBarActor.send({ type: 'Close' }) + toast.error('Exiting command flow because engine disconnected') } - }, [immediateState]) + }, [immediateState, commandBarActor]) // Hook up keyboard shortcuts useHotkeyWrapper([COMMAND_PALETTE_HOTKEY], () => {