diff --git a/e2e/playwright/feature-tree-pane.spec.ts b/e2e/playwright/feature-tree-pane.spec.ts index f6e47a282..1bcb4d909 100644 --- a/e2e/playwright/feature-tree-pane.spec.ts +++ b/e2e/playwright/feature-tree-pane.spec.ts @@ -90,7 +90,7 @@ test.describe('Feature Tree pane', () => { await scene.settled(cmdBar) await toolbar.openFeatureTreePane() - await page.getByText('Feature tree') + await expect(page.getByText('Feature tree')).toBeVisible() }) async function testViewSource({ diff --git a/e2e/playwright/point-click.spec.ts b/e2e/playwright/point-click.spec.ts index 5ccd9cf23..2fdbe8313 100644 --- a/e2e/playwright/point-click.spec.ts +++ b/e2e/playwright/point-click.spec.ts @@ -74,7 +74,7 @@ test.describe('Point-and-click tests', () => { await test.step('do extrude flow and check extrude code is added to editor', async () => { await toolbar.extrudeButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', @@ -1031,7 +1031,7 @@ openSketch = startSketchOn(XY) }) await test.step(`Go through the command bar flow`, async () => { await toolbar.offsetPlaneButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'plane', @@ -1093,7 +1093,7 @@ openSketch = startSketchOn(XY) await test.step(`Go through the command bar flow`, async () => { await toolbar.helixButton.click() - await page.getByText('AxisOrEdge') + await expect(page.getByText('AxisOrEdge')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'mode', @@ -1109,7 +1109,7 @@ openSketch = startSketchOn(XY) commandName: 'Helix', }) await cmdBar.progressCmdBar() - await page.getByText('Axis') + await expect(page.getByText('Axis')).toBeVisible() await cmdBar.progressCmdBar() await cmdBar.progressCmdBar() await cmdBar.progressCmdBar() @@ -1242,7 +1242,7 @@ openSketch = startSketchOn(XY) await test.step(`Go through the command bar flow`, async () => { await toolbar.closePane('code') await toolbar.helixButton.click() - await page.getByText('AxisOrEdge') + await expect(page.getByText('AxisOrEdge')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'mode', @@ -1258,7 +1258,7 @@ openSketch = startSketchOn(XY) commandName: 'Helix', }) await cmdBar.selectOption({ name: 'Edge' }).click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await clickOnEdge() await cmdBar.progressCmdBar() await cmdBar.argumentInput.focus() @@ -1537,7 +1537,7 @@ extrude001 = extrude(profile001, length = 100) if (!shouldPreselect) { await test.step(`Go through the command bar flow without preselected sketches`, async () => { await toolbar.loftButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'selection', @@ -1556,7 +1556,7 @@ extrude001 = extrude(profile001, length = 100) await test.step(`Go through the command bar flow with preselected sketches`, async () => { await toolbar.loftButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.progressCmdBar() }) } @@ -1717,7 +1717,7 @@ sketch002 = startSketchOn(XZ) await test.step(`Go through the command bar flow`, async () => { await toolbar.sweepButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ commandName: 'Sweep', currentArgKey: 'target', @@ -1854,7 +1854,7 @@ sketch002 = startSketchOn(XZ) await test.step(`Go through the command bar flow and fail validation with a toast`, async () => { await toolbar.sweepButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ commandName: 'Sweep', currentArgKey: 'target', @@ -1971,7 +1971,7 @@ extrude001 = extrude(sketch001, length = -12) await test.step(`Apply fillet to the preselected edge`, async () => { await page.waitForTimeout(100) await toolbar.filletButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ commandName: 'Fillet', highlightedHeaderArg: 'selection', @@ -2072,7 +2072,7 @@ extrude001 = extrude(sketch001, length = -12) await test.step(`Open fillet UI without selecting edges`, async () => { await page.waitForTimeout(100) await toolbar.filletButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'selection', @@ -2439,7 +2439,7 @@ extrude001 = extrude(profile001, length = 5) await test.step(`Apply fillet`, async () => { await page.waitForTimeout(100) await toolbar.filletButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ commandName: 'Fillet', highlightedHeaderArg: 'selection', @@ -2557,7 +2557,7 @@ extrude001 = extrude(sketch001, length = -12) await test.step(`Apply chamfer to the preselected edge`, async () => { await page.waitForTimeout(100) await toolbar.chamferButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ commandName: 'Chamfer', highlightedHeaderArg: 'selection', @@ -2665,7 +2665,7 @@ extrude001 = extrude(sketch001, length = -12) await test.step(`Open chamfer UI without selecting edges`, async () => { await page.waitForTimeout(100) await toolbar.chamferButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'selection', @@ -2975,7 +2975,7 @@ extrude001 = extrude(sketch001, length = 30) if (!shouldPreselect) { await test.step(`Go through the command bar flow without preselected faces`, async () => { await toolbar.shellButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'selection', @@ -3010,7 +3010,7 @@ extrude001 = extrude(sketch001, length = 30) await test.step(`Go through the command bar flow with a preselected face (cap)`, async () => { await toolbar.shellButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.progressCmdBar() await page.waitForTimeout(500) await cmdBar.progressCmdBar() @@ -3117,7 +3117,7 @@ extrude001 = extrude(sketch001, length = 40) await test.step(`Go through the command bar flow, selecting a wall and keeping default thickness`, async () => { await toolbar.shellButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'selection', @@ -3129,7 +3129,9 @@ extrude001 = extrude(sketch001, length = 40) highlightedHeaderArg: 'selection', commandName: 'Shell', }) - await page.getByText('Please select one or more face') + await expect( + page.getByText('Please select one or more face') + ).toBeVisible() await clickOnCap() await page.keyboard.down('Shift') await clickOnWall() @@ -3256,7 +3258,7 @@ extrude002 = extrude(sketch002, length = 50) await test.step(`Go through the command bar flow, selecting a cap and keeping default thickness`, async () => { await toolbar.shellButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'selection', @@ -3268,7 +3270,9 @@ extrude002 = extrude(sketch002, length = 50) highlightedHeaderArg: 'selection', commandName: 'Shell', }) - await page.getByText('Please select one or more face') + await expect( + page.getByText('Please select one or more face') + ).toBeVisible() await clickOnCap() await page.waitForTimeout(500) await cmdBar.progressCmdBar() @@ -3425,7 +3429,7 @@ sweep001 = sweep(sketch001, path = sketch002) await test.step(`Go through the Shell flow and fail validation with a toast`, async () => { await toolbar.shellButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.expectState({ stage: 'arguments', currentArgKey: 'selection', @@ -3496,7 +3500,7 @@ segAng(rectangleSegmentA002), // revolve await page.getByText(codeToSelection).click() await toolbar.revolveButton.click() - await page.getByText('Please select one') + await expect(page.getByText('Please select one')).toBeVisible() await cmdBar.progressCmdBar() await cmdBar.progressCmdBar() await cmdBar.progressCmdBar() @@ -3669,7 +3673,7 @@ sketch003 = startSketchOn(extrude001, 'START') await page.waitForTimeout(1000) await editor.scrollToText(codeToSelection) await page.getByText(codeToSelection).click() - await page.getByText('AxisOrEdge', { exact: true }) + await expect(page.getByText('AxisOrEdge', { exact: true })).toBeVisible() await page.getByText('Edge', { exact: true }).click() const lineCodeToSelection = `length = 2.6` await editor.scrollToText(lineCodeToSelection) diff --git a/e2e/playwright/projects.spec.ts b/e2e/playwright/projects.spec.ts index be2c0321c..b43e93388 100644 --- a/e2e/playwright/projects.spec.ts +++ b/e2e/playwright/projects.spec.ts @@ -775,7 +775,6 @@ test.describe(`Project management commands`, () => { `${dir}/${projectName}/main.kcl` ) }) - const u = await getUtils(page) // Constants and locators const projectHomeLink = page.getByTestId('project-link') @@ -836,7 +835,6 @@ test.describe(`Project management commands`, () => { `${dir}/${projectName}/main.kcl` ) }) - const u = await getUtils(page) // Constants and locators const projectHomeLink = page.getByTestId('project-link') diff --git a/src/components/EngineStream.tsx b/src/components/EngineStream.tsx index 28da4e68c..babf7138f 100644 --- a/src/components/EngineStream.tsx +++ b/src/components/EngineStream.tsx @@ -15,7 +15,7 @@ import { err, reportRejection, trap } from 'lib/trap' import { getArtifactOfTypes } from 'lang/std/artifactGraph' import { ViewControlContextMenu } from './ViewControlMenu' import { useSettings, engineStreamActor } from 'machines/appMachine' -import { commandBarActor, useCommandBarState } from 'machines/commandBarMachine' +import { useCommandBarState } from 'machines/commandBarMachine' import { EngineStreamState, EngineStreamTransition, diff --git a/src/components/ModelingMachineProvider.tsx b/src/components/ModelingMachineProvider.tsx index 13e88dd17..9a67cf03d 100644 --- a/src/components/ModelingMachineProvider.tsx +++ b/src/components/ModelingMachineProvider.tsx @@ -140,14 +140,7 @@ export const ModelingMachineProvider = ({ }) => { const { app: { theme, allowOrbitInSketchMode }, - modeling: { - defaultUnit, - cameraProjection, - highlightEdges, - showScaleGrid, - cameraOrbit, - enableSSAO, - }, + modeling: { defaultUnit, cameraProjection, highlightEdges, cameraOrbit }, } = useSettings() const navigate = useNavigate() const { context, send: fileMachineSend } = useFileContext() @@ -156,9 +149,6 @@ export const ModelingMachineProvider = ({ const streamRef = useRef(null) const persistedContext = useMemo(() => getPersistedContext(), []) - let [searchParams] = useSearchParams() - const pool = searchParams.get('pool') - const isCommandBarClosed = useSelector( commandBarActor, commandBarIsClosedSelector diff --git a/src/machines/engineStreamMachine.ts b/src/machines/engineStreamMachine.ts index d8a729c9d..310d734bf 100644 --- a/src/machines/engineStreamMachine.ts +++ b/src/machines/engineStreamMachine.ts @@ -1,5 +1,4 @@ import { jsAppSettings } from 'lang/wasm' -import { uuidv4 } from 'lib/utils' import { MutableRefObject } from 'react' import { setup, assign, fromPromise } from 'xstate' import { @@ -8,8 +7,6 @@ import { sceneInfra, engineCommandManager, } from 'lib/singletons' -import { trap } from 'lib/trap' -import { Vector3, Vector4 } from 'three' export enum EngineStreamState { Off = 'off',