Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
e642731
Add back stream idle mode
lf94 Feb 7, 2025
1e4b6ce
Shut up codespell
lf94 Feb 7, 2025
ff887af
Correct serialization; only expose at user level
lf94 Feb 10, 2025
e3705bf
cargo fmt
lf94 Feb 11, 2025
deb83cf
tsc lint fmt
lf94 Feb 17, 2025
2a60efc
Move engineStreamMachine as a global actor; tons of more work
lee-at-zoo-corp Mar 19, 2025
cfbe805
Fix up everything after bumping kittycad/lib
lee-at-zoo-corp Mar 20, 2025
be0fdc5
Remove camera sync
lee-at-zoo-corp Mar 20, 2025
6bc8e45
Use pause/play iconology
lee-at-zoo-corp Mar 21, 2025
955a2ff
Add back better ping indicator
lee-at-zoo-corp Mar 21, 2025
c32a3ed
wip
lee-at-zoo-corp Mar 21, 2025
2cca137
Fix streamIdleMode checkbox being wonky
lee-at-zoo-corp Mar 21, 2025
4c9851e
yarn fmt
lee-at-zoo-corp Mar 21, 2025
fbefff4
Massive extinction event for waitForExecutionDone; try to stop projec…
lee-at-zoo-corp Mar 21, 2025
12bf41a
Clear diagnostics when unmounting code editor!
lee-at-zoo-corp Mar 24, 2025
c817756
wip
lee-at-zoo-corp Mar 25, 2025
6c8a525
Rework initial root projects dir + deflake many projects tests
lee-at-zoo-corp Mar 25, 2025
d03343d
More e2e fixes
lee-at-zoo-corp Mar 25, 2025
74f9afb
Deflake revolve some revolve tests
lee-at-zoo-corp Mar 27, 2025
81f7025
Fix the rest of the mfing tests
lee-at-zoo-corp Mar 27, 2025
9e19d13
yarn fmt
lee-at-zoo-corp Mar 27, 2025
fb192ee
yarn lint
lee-at-zoo-corp Mar 27, 2025
c75aafa
yarn tsc
lee-at-zoo-corp Mar 27, 2025
635314b
Fix tsc after rebase
lee-at-zoo-corp Mar 27, 2025
2c673fb
wip
lee-at-zoo-corp Mar 27, 2025
62a18dd
less flaky point and click
lee-at-zoo-corp Mar 27, 2025
992fec6
wip
lee-at-zoo-corp Mar 28, 2025
ed1e2ae
Fixup after rebase
lee-at-zoo-corp Mar 31, 2025
4c564bf
Fix more tests
lee-at-zoo-corp Mar 31, 2025
8d0343c
Fix 2 more
lee-at-zoo-corp Mar 31, 2025
65adfd4
Fix up named-views tests
lee-at-zoo-corp Apr 1, 2025
00122aa
yarn fmt lint tsc
lee-at-zoo-corp Apr 1, 2025
277c489
Fix up new changes
lee-at-zoo-corp Apr 2, 2025
3471f73
Get rid of 1 cyclic dependency
lee-at-zoo-corp Apr 3, 2025
91b5549
Fix another cyclic mfer!
lee-at-zoo-corp Apr 3, 2025
9de3787
fmt
lee-at-zoo-corp Apr 3, 2025
70f9c8e
fmt tsc
lee-at-zoo-corp Apr 3, 2025
4c57cea
Fix zoom to fit being frigged
lee-at-zoo-corp Apr 3, 2025
496522e
a new list of circular deps
lee-at-zoo-corp Apr 3, 2025
682fa50
Remove NetworkHealthIndicator test that was shit
lee-at-zoo-corp Apr 3, 2025
4d06a91
Fix the bad reload repeat issue kevin started on
lee-at-zoo-corp Apr 3, 2025
cdc0fa4
Fix zoom to fit at the right moments...
lee-at-zoo-corp Apr 4, 2025
25af691
Fix cache count numbers in editor test
lee-at-zoo-corp Apr 4, 2025
e98a957
Remove a test race - poll window info.
lee-at-zoo-corp Apr 4, 2025
e06f76a
Qualify fail function
lee-at-zoo-corp Apr 4, 2025
49fcbdd
Try something
lee-at-zoo-corp Apr 4, 2025
767fde8
Use scene.connectionEstablished
lee-at-zoo-corp Apr 4, 2025
062495c
Hopefully fix snapshots at least
lee-at-zoo-corp Apr 4, 2025
7f18aef
Add app console.log
lee-at-zoo-corp Apr 4, 2025
0af99af
Fix native menu tests more
lee-at-zoo-corp Apr 4, 2025
8940f9b
tsc lint
lee-at-zoo-corp Apr 4, 2025
b9875bb
Fix camera failure
lee-at-zoo-corp Apr 4, 2025
313a21e
Try again
lee-at-zoo-corp Apr 4, 2025
ddac107
Test attempt number 15345203, action!
lee-at-zoo-corp Apr 4, 2025
2342d04
Add back old window detection heuristic
lee-at-zoo-corp Apr 4, 2025
468c069
Merge branch 'main' into lf94/stream-idle-revamp
lee-at-zoo-corp Apr 4, 2025
752518d
Remove firstWindow to complete the work of 2342d04fe244c327cdb1a1a721…
franknoirot Apr 4, 2025
83e04a1
Tweak some tests for MacOS
franknoirot Apr 5, 2025
084619b
Tweak "set appearance" test for MacOS
franknoirot Apr 5, 2025
d56e984
Are you serious? This was all that needed formatting?
franknoirot Apr 5, 2025
2c35d19
More color tweaks
franknoirot Apr 5, 2025
5e01dc3
Merge branch 'main' into lf94/stream-idle-revamp
pierremtb Apr 5, 2025
27bd553
Merge branch 'main' into lf94/stream-idle-revamp
pierremtb Apr 5, 2025
306eca8
Fixes on apperance e2e test for stream idle branch (#6168)
pierremtb Apr 5, 2025
1ef2cea
Another apperance fix
pierremtb Apr 5, 2025
ba874ed
Skip one native menu test to make stream idle green (#6169)
pierremtb Apr 5, 2025
3078662
Merge branch 'main' into lf94/stream-idle-revamp
pierremtb Apr 6, 2025
92a8610
Update snapshot for test_generate_settings_docs
pierremtb Apr 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/kcl/settings/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Permanently dismiss the banner warning to download the desktop app. This setting

##### stream_idle_mode

When the user is idle, and this is true, the stream will be torn down.
When the user is idle, teardown the stream after some time.


**Default:** None
Expand Down
5 changes: 3 additions & 2 deletions e2e/playwright/boolean.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ test.describe('Point and click for boolean workflows', () => {
localStorage.setItem('persistCode', file)
}, file)
await homePage.goToModelingScene()
await scene.waitForExecutionDone()

await scene.settled(cmdBar)

// Test coordinates for selection - these might need adjustment based on actual scene layout
Expand Down Expand Up @@ -77,6 +75,7 @@ test.describe('Point and click for boolean workflows', () => {

// Select first object in the scene, expect there to be a pixel diff from the selection color change
await clickFirstObject({ pixelDiff: 50 })
await page.waitForTimeout(1000)

// For subtract, we need to proceed to the next step before selecting the second object
if (operationName !== 'subtract') {
Expand All @@ -87,6 +86,8 @@ test.describe('Point and click for boolean workflows', () => {
// Select second object
await clickSecondObject({ pixelDiff: 50 })

await page.waitForTimeout(1000)

// Confirm the operation in the command bar
await cmdBar.progressCmdBar()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { uuidv4 } from '@src/lib/utils'

import type { HomePageFixture } from '@e2e/playwright/fixtures/homePageFixture'
import type { SceneFixture } from '@e2e/playwright/fixtures/sceneFixture'
import type { ToolbarFixture } from '@e2e/playwright/fixtures/toolbarFixture'
import { getUtils } from '@e2e/playwright/test-utils'
import { expect, test } from '@e2e/playwright/zoo-test'

Expand All @@ -15,6 +16,7 @@ test.describe(
page: Page,
homePage: HomePageFixture,
scene: SceneFixture,
toolbar: ToolbarFixture,
plane: string,
clickCoords: { x: number; y: number }
) => {
Expand Down Expand Up @@ -59,9 +61,12 @@ test.describe(
await u.sendCustomCmd(updateCamCommand)

await u.closeDebugPanel()

await page.mouse.click(clickCoords.x, clickCoords.y)
await page.waitForTimeout(600) // wait for animation

await toolbar.waitUntilSketchingReady()

await expect(
page.getByRole('button', { name: 'line Line', exact: true })
).toBeVisible()
Expand Down Expand Up @@ -117,11 +122,12 @@ test.describe(
]

for (const config of planeConfigs) {
test(config.plane, async ({ page, homePage, scene }) => {
test(config.plane, async ({ page, homePage, scene, toolbar }) => {
await sketchOnPlaneAndBackSideTest(
page,
homePage,
scene,
toolbar,
config.plane,
config.coords
)
Expand Down
9 changes: 5 additions & 4 deletions e2e/playwright/code-pane-and-errors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ test.describe('Code pane and errors', { tag: ['@skipWin'] }, () => {
page,
homePage,
scene,
cmdBar,
}) => {
const u = await getUtils(page)

Expand All @@ -36,7 +37,7 @@ extrude001 = extrude(sketch001, length = 5)`

await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()
await scene.waitForExecutionDone()
await scene.settled(cmdBar)

// Ensure no badge is present
const codePaneButtonHolder = page.locator('#code-button-holder')
Expand Down Expand Up @@ -171,6 +172,8 @@ extrude001 = extrude(sketch001, length = 5)`
context,
page,
homePage,
scene,
cmdBar,
}) => {
// Load the app with the working starter code
await context.addInitScript((code) => {
Expand All @@ -180,9 +183,7 @@ extrude001 = extrude(sketch001, length = 5)`
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()

// FIXME: await scene.waitForExecutionDone() does not work. It still fails.
// I needed to increase this timeout to get this to pass.
await page.waitForTimeout(10000)
await scene.settled(cmdBar)

// Ensure badge is present
const codePaneButtonHolder = page.locator('#code-button-holder')
Expand Down
6 changes: 6 additions & 0 deletions e2e/playwright/command-bar-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,13 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
test('Can switch between sketch tools via command bar', async ({
page,
homePage,
scene,
cmdBar,
toolbar,
}) => {
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene()
await scene.settled(cmdBar)

const sketchButton = page.getByRole('button', { name: 'Start Sketch' })
const cmdBarButton = page.getByRole('button', { name: 'Commands' })
Expand All @@ -343,7 +347,9 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {

// Start a sketch
await sketchButton.click()

await page.mouse.click(700, 200)
await toolbar.waitUntilSketchingReady()

// Switch between sketch tools via the command bar
await expect(lineToolButton).toHaveAttribute('aria-pressed', 'true')
Expand Down
10 changes: 5 additions & 5 deletions e2e/playwright/desktop-export.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { expect, test } from '@e2e/playwright/zoo-test'
test(
'export works on the first try',
{ tag: ['@electron', '@skipLocalEngine'] },
async ({ page, context, scene, tronApp }, testInfo) => {
async ({ page, context, scene, tronApp, cmdBar }, testInfo) => {
if (!tronApp) {
fail()
}
Expand All @@ -37,7 +37,7 @@ test(
const projectName = page.getByText(`bracket`)
await expect(projectName).toBeVisible()
await projectName.click()
await scene.waitForExecutionDone()
await scene.settled(cmdBar)
await page.waitForTimeout(1_000) // wait for panel buttons to be available

// Expect zero errors in gutter
Expand All @@ -46,6 +46,7 @@ test(
// Click the export button
const exportButton = page.getByTestId('export-pane-button')
await expect(exportButton).toBeVisible()

await exportButton.click()
await page.waitForTimeout(1_000) // wait for export options to be available

Expand Down Expand Up @@ -110,10 +111,9 @@ test(

// Close the file pane
await u.closeFilePanel()
await scene.waitForExecutionDone()
await page.waitForTimeout(1_000) // wait for panel buttons to be available
await scene.settled(cmdBar)

// Expect zero errors in gutter
// expect zero errors in guter
await expect(page.locator('.cm-lint-marker-error')).not.toBeVisible()

// Click the export button
Expand Down
20 changes: 12 additions & 8 deletions e2e/playwright/editor-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ sketch001 = startSketchOn(XY)

// Ensure we execute the first time.
await u.openDebugPanel()
await expect(
page.locator('[data-receive-command-type="scene_clear_all"]')
).toHaveCount(1)
await expect(
page.locator('[data-message-type="execution-done"]')
).toHaveCount(2)
await expect
.poll(() =>
page.locator('[data-receive-command-type="scene_clear_all"]').count()
)
.toBe(1)
await expect
.poll(() => page.locator('[data-message-type="execution-done"]').count())
.toBe(2)

// Add whitespace to the end of the code.
await u.codeLocator.click()
Expand All @@ -110,12 +112,14 @@ sketch001 = startSketchOn(XY)
test('ensure we use the cache, and do not clear on append', async ({
homePage,
page,
scene,
cmdBar,
}) => {
const u = await getUtils(page)
await page.setBodyDimensions({ width: 1000, height: 500 })

await homePage.goToModelingScene()
await u.waitForPageLoad()
await scene.settled(cmdBar)

await u.codeLocator.click()
await page.keyboard.type(`sketch001 = startSketchOn(XY)
Expand Down Expand Up @@ -499,7 +503,7 @@ sketch_001 = startSketchOn(XY)
await page.keyboard.press('ArrowLeft')
await page.keyboard.press('ArrowRight')

await scene.waitForExecutionDone()
await scene.connectionEstablished()

// error in guter
await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible()
Expand Down
17 changes: 10 additions & 7 deletions e2e/playwright/feature-tree-pane.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test.describe('Feature Tree pane', () => {
test(
'User can go to definition and go to function definition',
{ tag: '@electron' },
async ({ context, homePage, scene, editor, toolbar }) => {
async ({ context, homePage, scene, editor, toolbar, cmdBar, page }) => {
await context.folderSetupFn(async (dir) => {
const bracketDir = join(dir, 'test-sample')
await fsp.mkdir(bracketDir, { recursive: true })
Expand All @@ -86,9 +86,13 @@ test.describe('Feature Tree pane', () => {
sortBy: 'last-modified-desc',
})
await homePage.openProject('test-sample')
await scene.waitForExecutionDone()
await editor.closePane()
await scene.connectionEstablished()
await scene.settled(cmdBar)

await toolbar.openFeatureTreePane()
await expect
.poll(() => page.getByText('Feature tree').count())
.toBeGreaterThan(1)
})

async function testViewSource({
Expand Down Expand Up @@ -254,7 +258,7 @@ test.describe('Feature Tree pane', () => {
sortBy: 'last-modified-desc',
})
await homePage.openProject('test-sample')
await scene.waitForExecutionDone()
await scene.settled(cmdBar)
await toolbar.openFeatureTreePane()
})

Expand Down Expand Up @@ -339,7 +343,7 @@ test.describe('Feature Tree pane', () => {
sortBy: 'last-modified-desc',
})
await homePage.openProject('test-sample')
await scene.waitForExecutionDone()
await scene.settled(cmdBar)
await toolbar.openFeatureTreePane()
})

Expand Down Expand Up @@ -414,8 +418,7 @@ profile003 = startProfileAt([0, -4.93], sketch001)
const planeColor: [number, number, number] = [74, 74, 74]

await homePage.openProject('test-sample')
// FIXME: @lf94 has a better way to verify execution completion, in a PR rn
await scene.waitForExecutionDone()
await scene.settled(cmdBar)

await test.step(`Verify we see the sketch`, async () => {
await scene.expectPixelColor(sketchColor, testPoint, 10)
Expand Down
9 changes: 5 additions & 4 deletions e2e/playwright/file-tree.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ test.describe('integrations tests', () => {
await scene.connectionEstablished()
await scene.settled(cmdBar)
await clickObj()
await page.waitForTimeout(1000)
await scene.moveNoWhere()
await editor.expectState({
activeLines: [
Expand All @@ -72,11 +73,11 @@ test.describe('integrations tests', () => {
})
await test.step('setup for next assertion', async () => {
await toolbar.openFile('main.kcl')

await scene.settled(cmdBar)

await page.waitForTimeout(1000)
await clickObj()
await page.waitForTimeout(1000)
await scene.moveNoWhere()
await page.waitForTimeout(1000)
await editor.expectState({
activeLines: [
'|>startProfileAt([75.8,317.2],%)//[$startCapTag,$EndCapTag]',
Expand All @@ -89,7 +90,7 @@ test.describe('integrations tests', () => {
await toolbar.expectFileTreeState(['main.kcl', fileName])
})
await test.step('check sketch mode is exited when opening a different file', async () => {
await toolbar.openFile(fileName, { wait: false })
await toolbar.openFile(fileName)

// check we're out of sketch mode
await expect(toolbar.exitSketchBtn).not.toBeVisible()
Expand Down
24 changes: 9 additions & 15 deletions e2e/playwright/fixtures/cmdBarFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,16 @@ export class CmdBarFixture {
* and assumes we are past the `pickCommand` step.
*/
progressCmdBar = async (shouldFuzzProgressMethod = true) => {
// FIXME: Progressing the command bar is a race condition. We have an async useEffect that reports the final state via useCalculateKclExpression. If this does not run quickly enough, it will not "fail" the continue because you can press continue if the state is not ready. E2E tests do not know this.
// Wait 1250ms to assume the await executeAst of the KCL input field is finished
await this.page.waitForTimeout(1250)
if (shouldFuzzProgressMethod || Math.random() > 0.5) {
const arrowButton = this.page.getByRole('button', {
name: 'arrow right Continue',
})
if (await arrowButton.isVisible()) {
await arrowButton.click()
} else {
await this.page
.getByRole('button', { name: 'checkmark Submit command' })
.click()
}
await this.page.waitForTimeout(2000)
const arrowButton = this.page.getByRole('button', {
name: 'arrow right Continue',
})
if (await arrowButton.isVisible()) {
await arrowButton.click()
} else {
await this.page.keyboard.press('Enter')
await this.page
.getByRole('button', { name: 'checkmark Submit command' })
.click()
}
}

Expand Down
Loading
Loading