Files
modeling-app/e2e/playwright/feature-tree-pane.spec.ts

475 lines
15 KiB
TypeScript
Raw Normal View History

import { join } from 'path'
import * as fsp from 'fs/promises'
Sort imports (#6101) * add package.json Signed-off-by: Jess Frazelle <github@jessfraz.com> initial run; Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> more fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> clientsidescne Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> paths Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fix styles Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> combine Signed-off-by: Jess Frazelle <github@jessfraz.com> eslint rule Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> my ocd Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> constants file Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> no more import sceneInfra Signed-off-by: Jess Frazelle <github@jessfraz.com> updates Signed-off-by: Jess Frazelle <github@jessfraz.com> try fix circular import Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-01 23:54:26 -07:00
import { expect, test } from '@e2e/playwright/zoo-test'
const FEATURE_TREE_EXAMPLE_CODE = `export fn timesFive(@x) {
return 5 * x
}
export fn triangle() {
return startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> xLine(length = 10)
KCL: Use keyword arguments for line, lineTo, extrude and close (#5249) Part of #4600. PR: https://github.com/KittyCAD/modeling-app/pull/4826 # Changes to KCL stdlib - `line(point, sketch, tag)` and `lineTo(point, sketch, tag)` are combined into `line(@sketch, end?, endAbsolute?, tag?)` - `close(sketch, tag?)` is now `close(@sketch, tag?)` - `extrude(length, sketch)` is now `extrude(@sketch, length)` Note that if a parameter starts with `@` like `@sketch`, it doesn't have any label when called, so you call it like this: ``` sketch = startSketchAt([0, 0]) line(sketch, end = [3, 3], tag = $hi) ``` Note also that if you're using a `|>` pipeline, you can omit the `@` argument and it will be assumed to be the LHS of the `|>`. So the above could be written as ``` sketch = startSketchAt([0, 0]) |> line(end = [3, 3], tag = $hi) ``` Also changes frontend tests to use KittyCAD/kcl-samples#139 instead of its main The regex find-and-replace I use for migrating code (note these don't work with multi-line expressions) are: ``` line\(([^=]*), %\) line(end = $1) line\((.*), %, (.*)\) line(end = $1, tag = $2) lineTo\((.*), %\) line(endAbsolute = $1) lineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) extrude\((.*), %\) extrude(length = $1) extrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) ``` # Selected notes from commits before I squash them all * Fix test 'yRelative to horizontal distance' Fixes: - Make a lineTo helper - Fix pathToNode to go through the labeled arg .arg property * Fix test by changing lookups into transformMap Parts of the code assumed that `line` is always a relative call. But actually now it might be absolute, if it's got an `endAbsolute` parameter. So, change whether to look up `line` or `lineTo` and the relevant absolute or relative line types based on that parameter. * Stop asserting on exact source ranges When I changed line to kwargs, all the source ranges we assert on became slightly different. I find these assertions to be very very low value. So I'm removing them. * Fix more tests: getConstraintType calls weren't checking if the 'line' fn was absolute or relative. * Fixed another queryAst test There were 2 problems: - Test was looking for the old style of `line` call to choose an offset for pathToNode - Test assumed that the `tag` param was always the third one, but in a kwarg call, you have to look it up by label * Fix test: traverse was not handling CallExpressionKw * Fix another test, addTagKw addTag helper was not aware of kw args. * Convert close from positional to kwargs If the close() call has 0 args, or a single unlabeled arg, the parser interprets it as a CallExpression (positional) not a CallExpressionKw. But then if a codemod wants to add a tag to it, it tries adding a kwarg called 'tag', which fails because the CallExpression doesn't need kwargs inserted into it. The fix is: change the node from CallExpression to CallExpressionKw, and update getNodeFromPath to take a 'replacement' arg, so we can replace the old node with the new node in the AST. * Fix the last test Test was looking for `lineTo` as a substring of the input KCL program. But there's no more lineTo function, so I changed it to look for line() with an endAbsolute arg, which is the new equivalent. Also changed the getConstraintInfo code to look up the lineTo if using line with endAbsolute. * Fix many bad regex find-replaces I wrote a regex find-and-replace which converted `line` calls from positional to keyword calls. But it was accidentally applied to more places than it should be, for example, angledLine, xLine and yLine calls. Fixes this. * Fixes test 'Basic sketch › code pane closed at start' Problem was, the getNodeFromPath call might not actually find a callExpressionKw, it might find a callExpression. So the `giveSketchFnCallTag` thought it was modifying a kwargs call, but it was actually modifying a positional call. This meant it tried to push a labeled argument in, rather than a normal arg, and a lot of other problems. Fixed by doing runtime typechecking. * Fix: Optional args given with wrong type were silently ignored Optional args don't have to be given. But if the user gives them, they should be the right type. Bug: if the KCL interpreter found an optional arg, which was given, but was the wrong type, it would ignore it and pretend the arg was never given at all. This was confusing for users. Fix: Now if you give an optional arg, but it's the wrong type, KCL will emit a type error just like it would for a mandatory argument. --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-04 08:31:43 -06:00
|> line(end = [-10, -5])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
length001 = timesFive(1) * 5
sketch001 = startSketchOn(XZ)
|> startProfile(at = [20, 10])
KCL: Use keyword arguments for line, lineTo, extrude and close (#5249) Part of #4600. PR: https://github.com/KittyCAD/modeling-app/pull/4826 # Changes to KCL stdlib - `line(point, sketch, tag)` and `lineTo(point, sketch, tag)` are combined into `line(@sketch, end?, endAbsolute?, tag?)` - `close(sketch, tag?)` is now `close(@sketch, tag?)` - `extrude(length, sketch)` is now `extrude(@sketch, length)` Note that if a parameter starts with `@` like `@sketch`, it doesn't have any label when called, so you call it like this: ``` sketch = startSketchAt([0, 0]) line(sketch, end = [3, 3], tag = $hi) ``` Note also that if you're using a `|>` pipeline, you can omit the `@` argument and it will be assumed to be the LHS of the `|>`. So the above could be written as ``` sketch = startSketchAt([0, 0]) |> line(end = [3, 3], tag = $hi) ``` Also changes frontend tests to use KittyCAD/kcl-samples#139 instead of its main The regex find-and-replace I use for migrating code (note these don't work with multi-line expressions) are: ``` line\(([^=]*), %\) line(end = $1) line\((.*), %, (.*)\) line(end = $1, tag = $2) lineTo\((.*), %\) line(endAbsolute = $1) lineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) extrude\((.*), %\) extrude(length = $1) extrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) ``` # Selected notes from commits before I squash them all * Fix test 'yRelative to horizontal distance' Fixes: - Make a lineTo helper - Fix pathToNode to go through the labeled arg .arg property * Fix test by changing lookups into transformMap Parts of the code assumed that `line` is always a relative call. But actually now it might be absolute, if it's got an `endAbsolute` parameter. So, change whether to look up `line` or `lineTo` and the relevant absolute or relative line types based on that parameter. * Stop asserting on exact source ranges When I changed line to kwargs, all the source ranges we assert on became slightly different. I find these assertions to be very very low value. So I'm removing them. * Fix more tests: getConstraintType calls weren't checking if the 'line' fn was absolute or relative. * Fixed another queryAst test There were 2 problems: - Test was looking for the old style of `line` call to choose an offset for pathToNode - Test assumed that the `tag` param was always the third one, but in a kwarg call, you have to look it up by label * Fix test: traverse was not handling CallExpressionKw * Fix another test, addTagKw addTag helper was not aware of kw args. * Convert close from positional to kwargs If the close() call has 0 args, or a single unlabeled arg, the parser interprets it as a CallExpression (positional) not a CallExpressionKw. But then if a codemod wants to add a tag to it, it tries adding a kwarg called 'tag', which fails because the CallExpression doesn't need kwargs inserted into it. The fix is: change the node from CallExpression to CallExpressionKw, and update getNodeFromPath to take a 'replacement' arg, so we can replace the old node with the new node in the AST. * Fix the last test Test was looking for `lineTo` as a substring of the input KCL program. But there's no more lineTo function, so I changed it to look for line() with an endAbsolute arg, which is the new equivalent. Also changed the getConstraintInfo code to look up the lineTo if using line with endAbsolute. * Fix many bad regex find-replaces I wrote a regex find-and-replace which converted `line` calls from positional to keyword calls. But it was accidentally applied to more places than it should be, for example, angledLine, xLine and yLine calls. Fixes this. * Fixes test 'Basic sketch › code pane closed at start' Problem was, the getNodeFromPath call might not actually find a callExpressionKw, it might find a callExpression. So the `giveSketchFnCallTag` thought it was modifying a kwargs call, but it was actually modifying a positional call. This meant it tried to push a labeled argument in, rather than a normal arg, and a lot of other problems. Fixed by doing runtime typechecking. * Fix: Optional args given with wrong type were silently ignored Optional args don't have to be given. But if the user gives them, they should be the right type. Bug: if the KCL interpreter found an optional arg, which was given, but was the wrong type, it would ignore it and pretend the arg was never given at all. This was confusing for users. Fix: Now if you give an optional arg, but it's the wrong type, KCL will emit a type error just like it would for a mandatory argument. --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-04 08:31:43 -06:00
|> line(end = [10, 10])
|> angledLine(angle = -45, length = length001)
KCL: Use keyword arguments for line, lineTo, extrude and close (#5249) Part of #4600. PR: https://github.com/KittyCAD/modeling-app/pull/4826 # Changes to KCL stdlib - `line(point, sketch, tag)` and `lineTo(point, sketch, tag)` are combined into `line(@sketch, end?, endAbsolute?, tag?)` - `close(sketch, tag?)` is now `close(@sketch, tag?)` - `extrude(length, sketch)` is now `extrude(@sketch, length)` Note that if a parameter starts with `@` like `@sketch`, it doesn't have any label when called, so you call it like this: ``` sketch = startSketchAt([0, 0]) line(sketch, end = [3, 3], tag = $hi) ``` Note also that if you're using a `|>` pipeline, you can omit the `@` argument and it will be assumed to be the LHS of the `|>`. So the above could be written as ``` sketch = startSketchAt([0, 0]) |> line(end = [3, 3], tag = $hi) ``` Also changes frontend tests to use KittyCAD/kcl-samples#139 instead of its main The regex find-and-replace I use for migrating code (note these don't work with multi-line expressions) are: ``` line\(([^=]*), %\) line(end = $1) line\((.*), %, (.*)\) line(end = $1, tag = $2) lineTo\((.*), %\) line(endAbsolute = $1) lineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) extrude\((.*), %\) extrude(length = $1) extrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) ``` # Selected notes from commits before I squash them all * Fix test 'yRelative to horizontal distance' Fixes: - Make a lineTo helper - Fix pathToNode to go through the labeled arg .arg property * Fix test by changing lookups into transformMap Parts of the code assumed that `line` is always a relative call. But actually now it might be absolute, if it's got an `endAbsolute` parameter. So, change whether to look up `line` or `lineTo` and the relevant absolute or relative line types based on that parameter. * Stop asserting on exact source ranges When I changed line to kwargs, all the source ranges we assert on became slightly different. I find these assertions to be very very low value. So I'm removing them. * Fix more tests: getConstraintType calls weren't checking if the 'line' fn was absolute or relative. * Fixed another queryAst test There were 2 problems: - Test was looking for the old style of `line` call to choose an offset for pathToNode - Test assumed that the `tag` param was always the third one, but in a kwarg call, you have to look it up by label * Fix test: traverse was not handling CallExpressionKw * Fix another test, addTagKw addTag helper was not aware of kw args. * Convert close from positional to kwargs If the close() call has 0 args, or a single unlabeled arg, the parser interprets it as a CallExpression (positional) not a CallExpressionKw. But then if a codemod wants to add a tag to it, it tries adding a kwarg called 'tag', which fails because the CallExpression doesn't need kwargs inserted into it. The fix is: change the node from CallExpression to CallExpressionKw, and update getNodeFromPath to take a 'replacement' arg, so we can replace the old node with the new node in the AST. * Fix the last test Test was looking for `lineTo` as a substring of the input KCL program. But there's no more lineTo function, so I changed it to look for line() with an endAbsolute arg, which is the new equivalent. Also changed the getConstraintInfo code to look up the lineTo if using line with endAbsolute. * Fix many bad regex find-replaces I wrote a regex find-and-replace which converted `line` calls from positional to keyword calls. But it was accidentally applied to more places than it should be, for example, angledLine, xLine and yLine calls. Fixes this. * Fixes test 'Basic sketch › code pane closed at start' Problem was, the getNodeFromPath call might not actually find a callExpressionKw, it might find a callExpression. So the `giveSketchFnCallTag` thought it was modifying a kwargs call, but it was actually modifying a positional call. This meant it tried to push a labeled argument in, rather than a normal arg, and a lot of other problems. Fixed by doing runtime typechecking. * Fix: Optional args given with wrong type were silently ignored Optional args don't have to be given. But if the user gives them, they should be the right type. Bug: if the KCL interpreter found an optional arg, which was given, but was the wrong type, it would ignore it and pretend the arg was never given at all. This was confusing for users. Fix: Now if you give an optional arg, but it's the wrong type, KCL will emit a type error just like it would for a mandatory argument. --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-04 08:31:43 -06:00
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
revolve001 = revolve(sketch001, axis = X)
triangle()
KCL: Use keyword arguments for line, lineTo, extrude and close (#5249) Part of #4600. PR: https://github.com/KittyCAD/modeling-app/pull/4826 # Changes to KCL stdlib - `line(point, sketch, tag)` and `lineTo(point, sketch, tag)` are combined into `line(@sketch, end?, endAbsolute?, tag?)` - `close(sketch, tag?)` is now `close(@sketch, tag?)` - `extrude(length, sketch)` is now `extrude(@sketch, length)` Note that if a parameter starts with `@` like `@sketch`, it doesn't have any label when called, so you call it like this: ``` sketch = startSketchAt([0, 0]) line(sketch, end = [3, 3], tag = $hi) ``` Note also that if you're using a `|>` pipeline, you can omit the `@` argument and it will be assumed to be the LHS of the `|>`. So the above could be written as ``` sketch = startSketchAt([0, 0]) |> line(end = [3, 3], tag = $hi) ``` Also changes frontend tests to use KittyCAD/kcl-samples#139 instead of its main The regex find-and-replace I use for migrating code (note these don't work with multi-line expressions) are: ``` line\(([^=]*), %\) line(end = $1) line\((.*), %, (.*)\) line(end = $1, tag = $2) lineTo\((.*), %\) line(endAbsolute = $1) lineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) extrude\((.*), %\) extrude(length = $1) extrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) ``` # Selected notes from commits before I squash them all * Fix test 'yRelative to horizontal distance' Fixes: - Make a lineTo helper - Fix pathToNode to go through the labeled arg .arg property * Fix test by changing lookups into transformMap Parts of the code assumed that `line` is always a relative call. But actually now it might be absolute, if it's got an `endAbsolute` parameter. So, change whether to look up `line` or `lineTo` and the relevant absolute or relative line types based on that parameter. * Stop asserting on exact source ranges When I changed line to kwargs, all the source ranges we assert on became slightly different. I find these assertions to be very very low value. So I'm removing them. * Fix more tests: getConstraintType calls weren't checking if the 'line' fn was absolute or relative. * Fixed another queryAst test There were 2 problems: - Test was looking for the old style of `line` call to choose an offset for pathToNode - Test assumed that the `tag` param was always the third one, but in a kwarg call, you have to look it up by label * Fix test: traverse was not handling CallExpressionKw * Fix another test, addTagKw addTag helper was not aware of kw args. * Convert close from positional to kwargs If the close() call has 0 args, or a single unlabeled arg, the parser interprets it as a CallExpression (positional) not a CallExpressionKw. But then if a codemod wants to add a tag to it, it tries adding a kwarg called 'tag', which fails because the CallExpression doesn't need kwargs inserted into it. The fix is: change the node from CallExpression to CallExpressionKw, and update getNodeFromPath to take a 'replacement' arg, so we can replace the old node with the new node in the AST. * Fix the last test Test was looking for `lineTo` as a substring of the input KCL program. But there's no more lineTo function, so I changed it to look for line() with an endAbsolute arg, which is the new equivalent. Also changed the getConstraintInfo code to look up the lineTo if using line with endAbsolute. * Fix many bad regex find-replaces I wrote a regex find-and-replace which converted `line` calls from positional to keyword calls. But it was accidentally applied to more places than it should be, for example, angledLine, xLine and yLine calls. Fixes this. * Fixes test 'Basic sketch › code pane closed at start' Problem was, the getNodeFromPath call might not actually find a callExpressionKw, it might find a callExpression. So the `giveSketchFnCallTag` thought it was modifying a kwargs call, but it was actually modifying a positional call. This meant it tried to push a labeled argument in, rather than a normal arg, and a lot of other problems. Fixed by doing runtime typechecking. * Fix: Optional args given with wrong type were silently ignored Optional args don't have to be given. But if the user gives them, they should be the right type. Bug: if the KCL interpreter found an optional arg, which was given, but was the wrong type, it would ignore it and pretend the arg was never given at all. This was confusing for users. Fix: Now if you give an optional arg, but it's the wrong type, KCL will emit a type error just like it would for a mandatory argument. --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-04 08:31:43 -06:00
|> extrude(length = 30)
plane001 = offsetPlane(XY, offset = 10)
sketch002 = startSketchOn(plane001)
|> startProfile(at = [-20, 0])
KCL: Use keyword arguments for line, lineTo, extrude and close (#5249) Part of #4600. PR: https://github.com/KittyCAD/modeling-app/pull/4826 # Changes to KCL stdlib - `line(point, sketch, tag)` and `lineTo(point, sketch, tag)` are combined into `line(@sketch, end?, endAbsolute?, tag?)` - `close(sketch, tag?)` is now `close(@sketch, tag?)` - `extrude(length, sketch)` is now `extrude(@sketch, length)` Note that if a parameter starts with `@` like `@sketch`, it doesn't have any label when called, so you call it like this: ``` sketch = startSketchAt([0, 0]) line(sketch, end = [3, 3], tag = $hi) ``` Note also that if you're using a `|>` pipeline, you can omit the `@` argument and it will be assumed to be the LHS of the `|>`. So the above could be written as ``` sketch = startSketchAt([0, 0]) |> line(end = [3, 3], tag = $hi) ``` Also changes frontend tests to use KittyCAD/kcl-samples#139 instead of its main The regex find-and-replace I use for migrating code (note these don't work with multi-line expressions) are: ``` line\(([^=]*), %\) line(end = $1) line\((.*), %, (.*)\) line(end = $1, tag = $2) lineTo\((.*), %\) line(endAbsolute = $1) lineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) extrude\((.*), %\) extrude(length = $1) extrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) ``` # Selected notes from commits before I squash them all * Fix test 'yRelative to horizontal distance' Fixes: - Make a lineTo helper - Fix pathToNode to go through the labeled arg .arg property * Fix test by changing lookups into transformMap Parts of the code assumed that `line` is always a relative call. But actually now it might be absolute, if it's got an `endAbsolute` parameter. So, change whether to look up `line` or `lineTo` and the relevant absolute or relative line types based on that parameter. * Stop asserting on exact source ranges When I changed line to kwargs, all the source ranges we assert on became slightly different. I find these assertions to be very very low value. So I'm removing them. * Fix more tests: getConstraintType calls weren't checking if the 'line' fn was absolute or relative. * Fixed another queryAst test There were 2 problems: - Test was looking for the old style of `line` call to choose an offset for pathToNode - Test assumed that the `tag` param was always the third one, but in a kwarg call, you have to look it up by label * Fix test: traverse was not handling CallExpressionKw * Fix another test, addTagKw addTag helper was not aware of kw args. * Convert close from positional to kwargs If the close() call has 0 args, or a single unlabeled arg, the parser interprets it as a CallExpression (positional) not a CallExpressionKw. But then if a codemod wants to add a tag to it, it tries adding a kwarg called 'tag', which fails because the CallExpression doesn't need kwargs inserted into it. The fix is: change the node from CallExpression to CallExpressionKw, and update getNodeFromPath to take a 'replacement' arg, so we can replace the old node with the new node in the AST. * Fix the last test Test was looking for `lineTo` as a substring of the input KCL program. But there's no more lineTo function, so I changed it to look for line() with an endAbsolute arg, which is the new equivalent. Also changed the getConstraintInfo code to look up the lineTo if using line with endAbsolute. * Fix many bad regex find-replaces I wrote a regex find-and-replace which converted `line` calls from positional to keyword calls. But it was accidentally applied to more places than it should be, for example, angledLine, xLine and yLine calls. Fixes this. * Fixes test 'Basic sketch › code pane closed at start' Problem was, the getNodeFromPath call might not actually find a callExpressionKw, it might find a callExpression. So the `giveSketchFnCallTag` thought it was modifying a kwargs call, but it was actually modifying a positional call. This meant it tried to push a labeled argument in, rather than a normal arg, and a lot of other problems. Fixed by doing runtime typechecking. * Fix: Optional args given with wrong type were silently ignored Optional args don't have to be given. But if the user gives them, they should be the right type. Bug: if the KCL interpreter found an optional arg, which was given, but was the wrong type, it would ignore it and pretend the arg was never given at all. This was confusing for users. Fix: Now if you give an optional arg, but it's the wrong type, KCL will emit a type error just like it would for a mandatory argument. --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-04 08:31:43 -06:00
|> line(end = [5, -15])
|> xLine(length = -10)
KCL: Use keyword arguments for line, lineTo, extrude and close (#5249) Part of #4600. PR: https://github.com/KittyCAD/modeling-app/pull/4826 # Changes to KCL stdlib - `line(point, sketch, tag)` and `lineTo(point, sketch, tag)` are combined into `line(@sketch, end?, endAbsolute?, tag?)` - `close(sketch, tag?)` is now `close(@sketch, tag?)` - `extrude(length, sketch)` is now `extrude(@sketch, length)` Note that if a parameter starts with `@` like `@sketch`, it doesn't have any label when called, so you call it like this: ``` sketch = startSketchAt([0, 0]) line(sketch, end = [3, 3], tag = $hi) ``` Note also that if you're using a `|>` pipeline, you can omit the `@` argument and it will be assumed to be the LHS of the `|>`. So the above could be written as ``` sketch = startSketchAt([0, 0]) |> line(end = [3, 3], tag = $hi) ``` Also changes frontend tests to use KittyCAD/kcl-samples#139 instead of its main The regex find-and-replace I use for migrating code (note these don't work with multi-line expressions) are: ``` line\(([^=]*), %\) line(end = $1) line\((.*), %, (.*)\) line(end = $1, tag = $2) lineTo\((.*), %\) line(endAbsolute = $1) lineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) extrude\((.*), %\) extrude(length = $1) extrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) ``` # Selected notes from commits before I squash them all * Fix test 'yRelative to horizontal distance' Fixes: - Make a lineTo helper - Fix pathToNode to go through the labeled arg .arg property * Fix test by changing lookups into transformMap Parts of the code assumed that `line` is always a relative call. But actually now it might be absolute, if it's got an `endAbsolute` parameter. So, change whether to look up `line` or `lineTo` and the relevant absolute or relative line types based on that parameter. * Stop asserting on exact source ranges When I changed line to kwargs, all the source ranges we assert on became slightly different. I find these assertions to be very very low value. So I'm removing them. * Fix more tests: getConstraintType calls weren't checking if the 'line' fn was absolute or relative. * Fixed another queryAst test There were 2 problems: - Test was looking for the old style of `line` call to choose an offset for pathToNode - Test assumed that the `tag` param was always the third one, but in a kwarg call, you have to look it up by label * Fix test: traverse was not handling CallExpressionKw * Fix another test, addTagKw addTag helper was not aware of kw args. * Convert close from positional to kwargs If the close() call has 0 args, or a single unlabeled arg, the parser interprets it as a CallExpression (positional) not a CallExpressionKw. But then if a codemod wants to add a tag to it, it tries adding a kwarg called 'tag', which fails because the CallExpression doesn't need kwargs inserted into it. The fix is: change the node from CallExpression to CallExpressionKw, and update getNodeFromPath to take a 'replacement' arg, so we can replace the old node with the new node in the AST. * Fix the last test Test was looking for `lineTo` as a substring of the input KCL program. But there's no more lineTo function, so I changed it to look for line() with an endAbsolute arg, which is the new equivalent. Also changed the getConstraintInfo code to look up the lineTo if using line with endAbsolute. * Fix many bad regex find-replaces I wrote a regex find-and-replace which converted `line` calls from positional to keyword calls. But it was accidentally applied to more places than it should be, for example, angledLine, xLine and yLine calls. Fixes this. * Fixes test 'Basic sketch › code pane closed at start' Problem was, the getNodeFromPath call might not actually find a callExpressionKw, it might find a callExpression. So the `giveSketchFnCallTag` thought it was modifying a kwargs call, but it was actually modifying a positional call. This meant it tried to push a labeled argument in, rather than a normal arg, and a lot of other problems. Fixed by doing runtime typechecking. * Fix: Optional args given with wrong type were silently ignored Optional args don't have to be given. But if the user gives them, they should be the right type. Bug: if the KCL interpreter found an optional arg, which was given, but was the wrong type, it would ignore it and pretend the arg was never given at all. This was confusing for users. Fix: Now if you give an optional arg, but it's the wrong type, KCL will emit a type error just like it would for a mandatory argument. --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-04 08:31:43 -06:00
|> line(endAbsolute = [-40, 0])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch002, length = 10)
`
const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(angle = 0, length = 4, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 2, tag = $rectangleSegmentB001)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)
extrude001 = extrude(sketch001, length = 10)
sketch002 = startSketchOn(extrude001, face = rectangleSegmentB001)
|> circle(
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
center = [-1, 2],
radius = .5
)
plane001 = offsetPlane(XZ, offset = -5)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
sketch003 = startSketchOn(plane001)
|> circle(center = [0, 0], radius = 5)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
`
test.describe('Feature Tree pane', () => {
test(
'User can go to definition and go to function definition',
{ tag: '@desktop' },
Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312) * Add back stream idle mode * Shut up codespell * Correct serialization; only expose at user level * cargo fmt * tsc lint fmt * Move engineStreamMachine as a global actor; tons of more work * Fix up everything after bumping kittycad/lib * Remove camera sync * Use pause/play iconology * Add back better ping indicator * wip * Fix streamIdleMode checkbox being wonky * yarn fmt * Massive extinction event for waitForExecutionDone; try to stop projects view switching from crashing * Clear diagnostics when unmounting code editor! * wip * Rework initial root projects dir + deflake many projects tests * More e2e fixes * Deflake revolve some revolve tests * Fix the rest of the mfing tests * yarn fmt * yarn lint * yarn tsc * Fix tsc after rebase * wip * less flaky point and click * wip * Fixup after rebase * Fix more tests * Fix 2 more * Fix up named-views tests * yarn fmt lint tsc * Fix up new changes * Get rid of 1 cyclic dependency * Fix another cyclic mfer! * fmt * fmt tsc * Fix zoom to fit being frigged * a new list of circular deps * Remove NetworkHealthIndicator test that was shit * Fix the bad reload repeat issue kevin started on * Fix zoom to fit at the right moments... * Fix cache count numbers in editor test * Remove a test race - poll window info. * Qualify fail function * Try something * Use scene.connectionEstablished * Hopefully fix snapshots at least * Add app console.log * Fix native menu tests more * tsc lint * Fix camera failure * Try again * Test attempt number 15345203, action! * Add back old window detection heuristic * Remove firstWindow to complete the work of 2342d04fe244c327cdb1a1a721e5a125c08a2909 * Tweak some tests for MacOS * Tweak "set appearance" test for MacOS Revert this if it messes up any other platform's color checks! * Are you serious? This was all that needed formatting? * More color tweaks Local MacOS and CI MacOS don't agree * Fixes on apperance e2e test for stream idle branch (#6168) pierremtb/stream-idle-revamp-appearance-fixes * Another apperance fix * Skip one native menu test to make stream idle green (#6169) * pierremtb/stream-idle-revamp-more-fixes * Fix lint * Update snapshot for test_generate_settings_docs --------- Co-authored-by: lee-at-zoo-corp <lee@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-04-07 07:08:31 -04:00
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 })
await fsp.writeFile(
join(bracketDir, 'main.kcl'),
FEATURE_TREE_EXAMPLE_CODE,
'utf-8'
)
})
await test.step('setup test', async () => {
await homePage.expectState({
projectCards: [
{
title: 'test-sample',
fileCount: 1,
},
],
sortBy: 'last-modified-desc',
})
await homePage.openProject('test-sample')
Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312) * Add back stream idle mode * Shut up codespell * Correct serialization; only expose at user level * cargo fmt * tsc lint fmt * Move engineStreamMachine as a global actor; tons of more work * Fix up everything after bumping kittycad/lib * Remove camera sync * Use pause/play iconology * Add back better ping indicator * wip * Fix streamIdleMode checkbox being wonky * yarn fmt * Massive extinction event for waitForExecutionDone; try to stop projects view switching from crashing * Clear diagnostics when unmounting code editor! * wip * Rework initial root projects dir + deflake many projects tests * More e2e fixes * Deflake revolve some revolve tests * Fix the rest of the mfing tests * yarn fmt * yarn lint * yarn tsc * Fix tsc after rebase * wip * less flaky point and click * wip * Fixup after rebase * Fix more tests * Fix 2 more * Fix up named-views tests * yarn fmt lint tsc * Fix up new changes * Get rid of 1 cyclic dependency * Fix another cyclic mfer! * fmt * fmt tsc * Fix zoom to fit being frigged * a new list of circular deps * Remove NetworkHealthIndicator test that was shit * Fix the bad reload repeat issue kevin started on * Fix zoom to fit at the right moments... * Fix cache count numbers in editor test * Remove a test race - poll window info. * Qualify fail function * Try something * Use scene.connectionEstablished * Hopefully fix snapshots at least * Add app console.log * Fix native menu tests more * tsc lint * Fix camera failure * Try again * Test attempt number 15345203, action! * Add back old window detection heuristic * Remove firstWindow to complete the work of 2342d04fe244c327cdb1a1a721e5a125c08a2909 * Tweak some tests for MacOS * Tweak "set appearance" test for MacOS Revert this if it messes up any other platform's color checks! * Are you serious? This was all that needed formatting? * More color tweaks Local MacOS and CI MacOS don't agree * Fixes on apperance e2e test for stream idle branch (#6168) pierremtb/stream-idle-revamp-appearance-fixes * Another apperance fix * Skip one native menu test to make stream idle green (#6169) * pierremtb/stream-idle-revamp-more-fixes * Fix lint * Update snapshot for test_generate_settings_docs --------- Co-authored-by: lee-at-zoo-corp <lee@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-04-07 07:08:31 -04:00
await scene.connectionEstablished()
await scene.settled(cmdBar)
await toolbar.openFeatureTreePane()
Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312) * Add back stream idle mode * Shut up codespell * Correct serialization; only expose at user level * cargo fmt * tsc lint fmt * Move engineStreamMachine as a global actor; tons of more work * Fix up everything after bumping kittycad/lib * Remove camera sync * Use pause/play iconology * Add back better ping indicator * wip * Fix streamIdleMode checkbox being wonky * yarn fmt * Massive extinction event for waitForExecutionDone; try to stop projects view switching from crashing * Clear diagnostics when unmounting code editor! * wip * Rework initial root projects dir + deflake many projects tests * More e2e fixes * Deflake revolve some revolve tests * Fix the rest of the mfing tests * yarn fmt * yarn lint * yarn tsc * Fix tsc after rebase * wip * less flaky point and click * wip * Fixup after rebase * Fix more tests * Fix 2 more * Fix up named-views tests * yarn fmt lint tsc * Fix up new changes * Get rid of 1 cyclic dependency * Fix another cyclic mfer! * fmt * fmt tsc * Fix zoom to fit being frigged * a new list of circular deps * Remove NetworkHealthIndicator test that was shit * Fix the bad reload repeat issue kevin started on * Fix zoom to fit at the right moments... * Fix cache count numbers in editor test * Remove a test race - poll window info. * Qualify fail function * Try something * Use scene.connectionEstablished * Hopefully fix snapshots at least * Add app console.log * Fix native menu tests more * tsc lint * Fix camera failure * Try again * Test attempt number 15345203, action! * Add back old window detection heuristic * Remove firstWindow to complete the work of 2342d04fe244c327cdb1a1a721e5a125c08a2909 * Tweak some tests for MacOS * Tweak "set appearance" test for MacOS Revert this if it messes up any other platform's color checks! * Are you serious? This was all that needed formatting? * More color tweaks Local MacOS and CI MacOS don't agree * Fixes on apperance e2e test for stream idle branch (#6168) pierremtb/stream-idle-revamp-appearance-fixes * Another apperance fix * Skip one native menu test to make stream idle green (#6169) * pierremtb/stream-idle-revamp-more-fixes * Fix lint * Update snapshot for test_generate_settings_docs --------- Co-authored-by: lee-at-zoo-corp <lee@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-04-07 07:08:31 -04:00
await expect
.poll(() => page.getByText('Feature tree').count())
.toBeGreaterThan(1)
})
async function testViewSource({
operationName,
operationIndex,
expectedActiveLine,
}: {
operationName: string
operationIndex: number
expectedActiveLine: string
}) {
await test.step(`Go to definition of the ${operationName}`, async () => {
await toolbar.viewSourceOnOperation(operationName, operationIndex)
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: [expectedActiveLine],
})
await expect(
editor.activeLine.first(),
`${operationName} code should be scrolled into view`
).toBeVisible()
})
}
await testViewSource({
operationName: 'Offset Plane',
operationIndex: 0,
expectedActiveLine: 'plane001 = offsetPlane(XY, offset = 10)',
})
await testViewSource({
operationName: 'Extrude',
operationIndex: 1,
KCL: Use keyword arguments for line, lineTo, extrude and close (#5249) Part of #4600. PR: https://github.com/KittyCAD/modeling-app/pull/4826 # Changes to KCL stdlib - `line(point, sketch, tag)` and `lineTo(point, sketch, tag)` are combined into `line(@sketch, end?, endAbsolute?, tag?)` - `close(sketch, tag?)` is now `close(@sketch, tag?)` - `extrude(length, sketch)` is now `extrude(@sketch, length)` Note that if a parameter starts with `@` like `@sketch`, it doesn't have any label when called, so you call it like this: ``` sketch = startSketchAt([0, 0]) line(sketch, end = [3, 3], tag = $hi) ``` Note also that if you're using a `|>` pipeline, you can omit the `@` argument and it will be assumed to be the LHS of the `|>`. So the above could be written as ``` sketch = startSketchAt([0, 0]) |> line(end = [3, 3], tag = $hi) ``` Also changes frontend tests to use KittyCAD/kcl-samples#139 instead of its main The regex find-and-replace I use for migrating code (note these don't work with multi-line expressions) are: ``` line\(([^=]*), %\) line(end = $1) line\((.*), %, (.*)\) line(end = $1, tag = $2) lineTo\((.*), %\) line(endAbsolute = $1) lineTo\((.*), %, (.*)\) line(endAbsolute = $1, tag = $2) extrude\((.*), %\) extrude(length = $1) extrude\(([^=]*), ([a-zA-Z0-9]+)\) extrude($2, length = $1) close\(%, (.*)\) close(tag = $1) ``` # Selected notes from commits before I squash them all * Fix test 'yRelative to horizontal distance' Fixes: - Make a lineTo helper - Fix pathToNode to go through the labeled arg .arg property * Fix test by changing lookups into transformMap Parts of the code assumed that `line` is always a relative call. But actually now it might be absolute, if it's got an `endAbsolute` parameter. So, change whether to look up `line` or `lineTo` and the relevant absolute or relative line types based on that parameter. * Stop asserting on exact source ranges When I changed line to kwargs, all the source ranges we assert on became slightly different. I find these assertions to be very very low value. So I'm removing them. * Fix more tests: getConstraintType calls weren't checking if the 'line' fn was absolute or relative. * Fixed another queryAst test There were 2 problems: - Test was looking for the old style of `line` call to choose an offset for pathToNode - Test assumed that the `tag` param was always the third one, but in a kwarg call, you have to look it up by label * Fix test: traverse was not handling CallExpressionKw * Fix another test, addTagKw addTag helper was not aware of kw args. * Convert close from positional to kwargs If the close() call has 0 args, or a single unlabeled arg, the parser interprets it as a CallExpression (positional) not a CallExpressionKw. But then if a codemod wants to add a tag to it, it tries adding a kwarg called 'tag', which fails because the CallExpression doesn't need kwargs inserted into it. The fix is: change the node from CallExpression to CallExpressionKw, and update getNodeFromPath to take a 'replacement' arg, so we can replace the old node with the new node in the AST. * Fix the last test Test was looking for `lineTo` as a substring of the input KCL program. But there's no more lineTo function, so I changed it to look for line() with an endAbsolute arg, which is the new equivalent. Also changed the getConstraintInfo code to look up the lineTo if using line with endAbsolute. * Fix many bad regex find-replaces I wrote a regex find-and-replace which converted `line` calls from positional to keyword calls. But it was accidentally applied to more places than it should be, for example, angledLine, xLine and yLine calls. Fixes this. * Fixes test 'Basic sketch › code pane closed at start' Problem was, the getNodeFromPath call might not actually find a callExpressionKw, it might find a callExpression. So the `giveSketchFnCallTag` thought it was modifying a kwargs call, but it was actually modifying a positional call. This meant it tried to push a labeled argument in, rather than a normal arg, and a lot of other problems. Fixed by doing runtime typechecking. * Fix: Optional args given with wrong type were silently ignored Optional args don't have to be given. But if the user gives them, they should be the right type. Bug: if the KCL interpreter found an optional arg, which was given, but was the wrong type, it would ignore it and pretend the arg was never given at all. This was confusing for users. Fix: Now if you give an optional arg, but it's the wrong type, KCL will emit a type error just like it would for a mandatory argument. --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frank Noirot <frank@kittycad.io> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-04 08:31:43 -06:00
expectedActiveLine: 'extrude001 = extrude(sketch002, length = 10)',
})
await testViewSource({
operationName: 'Revolve',
operationIndex: 0,
expectedActiveLine: 'revolve001 = revolve(sketch001, axis = X)',
})
await testViewSource({
operationName: 'Triangle',
operationIndex: 0,
expectedActiveLine: 'triangle()',
})
await test.step('Go to definition on the triangle function', async () => {
await toolbar.goToDefinitionOnOperation('Triangle', 0)
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: ['export fn triangle() {'],
})
await expect(
editor.activeLine.first(),
'Triangle function definition should be scrolled into view'
).toBeVisible()
})
}
)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
test(
`User can edit sketch (but not on offset plane yet) from the feature tree`,
{ tag: '@desktop' },
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
async ({ context, homePage, scene, editor, toolbar, page }) => {
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
await context.addInitScript((initialCode) => {
localStorage.setItem('persistCode', initialCode)
}, FEATURE_TREE_SKETCH_CODE)
await page.setBodyDimensions({ width: 1000, height: 500 })
await homePage.goToModelingScene()
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
await test.step('force re-exe', async () => {
await page.waitForTimeout(1000)
await editor.replaceCode('90', '91')
await page.waitForTimeout(1500)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
})
await test.step('On a default plane should work', async () => {
await (await toolbar.getFeatureTreeOperation('Sketch', 0)).dblclick()
await expect(
toolbar.exitSketchBtn,
'We should be in sketch mode now'
).toBeVisible()
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: ['sketch001 = startSketchOn(XZ)'],
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
})
await toolbar.exitSketchBtn.click()
})
await test.step('On an extrude face should *not* work', async () => {
// Tooltip is getting in the way of clicking, so I'm first closing the pane
await toolbar.closeFeatureTreePane()
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
await page.waitForTimeout(1000)
await editor.replaceCode('91', '90')
await page.waitForTimeout(2000)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
await (await toolbar.getFeatureTreeOperation('Sketch', 1)).dblclick()
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
await expect(
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
toolbar.exitSketchBtn,
'We should be in sketch mode now'
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
).toBeVisible()
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: [
'sketch002=startSketchOn(extrude001,face=rectangleSegmentB001)',
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
],
})
await toolbar.exitSketchBtn.click()
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
})
await test.step('On an offset plane should work', async () => {
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
// Tooltip is getting in the way of clicking, so I'm first closing the pane
await toolbar.closeFeatureTreePane()
await (await toolbar.getFeatureTreeOperation('Sketch', 2)).dblclick()
await editor.expectState({
highlightedCode: '',
diagnostics: [],
Allow multiple profiles in the same sketch (#5196) * Revert "Revert multi-profile (#4812)" This reverts commit efe8089b08dd8bdade517f04ace2c81a5e096434. * fix poor 1000ms wait UX * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * trigger CI * Add Rust side artifacts for startSketchOn face or plane (#4834) * Add Rust side artifacts for startSketchOn face or plane * move ast digging --------- Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch> * lint * lint * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores) * trigger CI * chore: disabled file watcher which prevents faster file write (#4835) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * partial fixes * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Trigger CI * Fix up all the tests * Fix partial execution * wip * WIP * wip * rust changes to make three point confrom to same as others since we're not ready with name params yet * most of the fix for 3 point circle * get overlays working for circle three point * fmt * fix types * cargo fmt * add face codef ref for walls and caps * fix sketch on face after updates to rust side artifact graph * some things needed for multi-profile tests * bad attempts at fixing rust * more * more * fix rust * more rust fixes * overlay fix * remove duplicate test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * lint and typing * maybe fix a unit test * small thing * fix circ dep * fix unit test * fix some tests * fix sweep point-and-click test * fix more tests and add a fix me * fix more tests * fix electron specific test * tsc * more test tweaks * update docs * commint snaps? * is clippy happy now? * clippy again * test works now without me changing anything big-fixed-itself * small bug * make three point have cross hair to make it consistent with othe rtools * fix up state diagram * fmt * add draft point for first click of three point circ * 1 test for three point circle * 2 test for three point circle * clean up * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * remove bad doc comment * remove test skip * remove onboarding test changes * Update src/lang/modifyAst.ts Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Update output from simulation tests * Fix to use correct source ranges This also reduces cloning. * Change back to skipping face cap none and both * Update output after changing back to skipping none and both * Fix clippy warning * fix profile start snap bug * add path ids to cap * fix going into edit sketch * make other startSketchOn's work * fix snapshot test * explain function name * Update src/lib/rectangleTool.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * rename error * remove file tree from diff * Update src/clientSideScene/segments.ts Co-authored-by: Frank Noirot <frank@zoo.dev> * nit * Prevent double write to KCL code on revolve * Update output after adding cap-to-path graph edge * Fix edit/select sketch-on-cap via feature tree * clean up for face codeRef * fix changing tools part way through circle/rect tools * fix delete of circle profile * fix close profiles * fix closing profile bug (tangentArcTo being ignored) * remove stale comment * Delete paths associated with sketch when the sketch plane is deleted * Add support for deleting sketches on caps (not walls) * get delet working for walls * make delet of extrusions work for multi profile * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Delete the sketch statement too on the cap and wall cases * Don't write to file in `split-sketch-pipe-if-needed` unless necessary * Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile` It is already debounced internally. If we await it, we will have to wait for a debounced timeout * docs * fix circ dep * tsc * fix selection enter sketch weirdness * test fixes * comment out and fixme for delete related tests * add skip wins * try and get last test to pass --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: 49lf <ircsurfer33@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-15 00:57:04 +11:00
activeLines: ['sketch003=startSketchOn(plane001)'],
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
})
await expect(
toolbar.exitSketchBtn,
'We should be in sketch mode now'
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
).toBeVisible()
})
}
)
test(`User can edit an extrude operation from the feature tree`, async ({
context,
homePage,
scene,
editor,
toolbar,
cmdBar,
page,
}) => {
const initialInput = '23'
const initialCode = `sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
renamedExtrude = extrude(sketch001, length = ${initialInput})`
const newParameterName = 'length001'
const expectedCode = `${newParameterName} = 23
sketch001 = startSketchOn(XZ)
|> circle(center = [0, 0], radius = 5)
renamedExtrude = extrude(sketch001, length = ${newParameterName})`
const editedParameterValue = '23 * 2'
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
await context.folderSetupFn(async (dir) => {
const testDir = join(dir, 'test-sample')
await fsp.mkdir(testDir, { recursive: true })
await fsp.writeFile(join(testDir, 'main.kcl'), initialCode, 'utf-8')
})
await test.step('setup test', async () => {
await homePage.expectState({
projectCards: [
{
title: 'test-sample',
fileCount: 1,
},
],
sortBy: 'last-modified-desc',
})
await homePage.openProject('test-sample')
Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312) * Add back stream idle mode * Shut up codespell * Correct serialization; only expose at user level * cargo fmt * tsc lint fmt * Move engineStreamMachine as a global actor; tons of more work * Fix up everything after bumping kittycad/lib * Remove camera sync * Use pause/play iconology * Add back better ping indicator * wip * Fix streamIdleMode checkbox being wonky * yarn fmt * Massive extinction event for waitForExecutionDone; try to stop projects view switching from crashing * Clear diagnostics when unmounting code editor! * wip * Rework initial root projects dir + deflake many projects tests * More e2e fixes * Deflake revolve some revolve tests * Fix the rest of the mfing tests * yarn fmt * yarn lint * yarn tsc * Fix tsc after rebase * wip * less flaky point and click * wip * Fixup after rebase * Fix more tests * Fix 2 more * Fix up named-views tests * yarn fmt lint tsc * Fix up new changes * Get rid of 1 cyclic dependency * Fix another cyclic mfer! * fmt * fmt tsc * Fix zoom to fit being frigged * a new list of circular deps * Remove NetworkHealthIndicator test that was shit * Fix the bad reload repeat issue kevin started on * Fix zoom to fit at the right moments... * Fix cache count numbers in editor test * Remove a test race - poll window info. * Qualify fail function * Try something * Use scene.connectionEstablished * Hopefully fix snapshots at least * Add app console.log * Fix native menu tests more * tsc lint * Fix camera failure * Try again * Test attempt number 15345203, action! * Add back old window detection heuristic * Remove firstWindow to complete the work of 2342d04fe244c327cdb1a1a721e5a125c08a2909 * Tweak some tests for MacOS * Tweak "set appearance" test for MacOS Revert this if it messes up any other platform's color checks! * Are you serious? This was all that needed formatting? * More color tweaks Local MacOS and CI MacOS don't agree * Fixes on apperance e2e test for stream idle branch (#6168) pierremtb/stream-idle-revamp-appearance-fixes * Another apperance fix * Skip one native menu test to make stream idle green (#6169) * pierremtb/stream-idle-revamp-more-fixes * Fix lint * Update snapshot for test_generate_settings_docs --------- Co-authored-by: lee-at-zoo-corp <lee@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-04-07 07:08:31 -04:00
await scene.settled(cmdBar)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
await toolbar.openFeatureTreePane()
})
await test.step('Double click on the extrude operation', async () => {
await (await toolbar.getFeatureTreeOperation('Extrude', 0))
.first()
.dblclick()
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: [
`renamedExtrude = extrude(sketch001, length = ${initialInput})`,
],
})
await cmdBar.expectState({
commandName: 'Extrude',
stage: 'arguments',
currentArgKey: 'length',
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
currentArgValue: initialInput,
headerArguments: {
Length: initialInput,
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
},
highlightedHeaderArg: 'length',
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
})
})
await test.step('Add a parameter for distance argument and submit', async () => {
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
await expect(cmdBar.currentArgumentInput).toBeVisible()
await cmdBar.variableCheckbox.click()
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
headerArguments: {
// The calculated value is shown in the argument summary
Length: initialInput,
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
},
commandName: 'Extrude',
})
await cmdBar.progressCmdBar()
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: [
`renamedExtrude = extrude(sketch001, length = ${newParameterName})`,
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
],
})
await editor.expectEditor.toContain(expectedCode, {
shouldNormalise: true,
})
})
await test.step('Edit the parameter via the feature tree', async () => {
const parameter = await toolbar.getFeatureTreeOperation('Parameter', 0)
await parameter.dblclick()
await cmdBar.expectState({
commandName: 'Edit parameter',
currentArgKey: 'value',
currentArgValue: '23',
headerArguments: {
Name: newParameterName,
Value: '23',
},
stage: 'arguments',
highlightedHeaderArg: 'value',
})
await cmdBar.argumentInput
.locator('[contenteditable]')
.fill(editedParameterValue)
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
commandName: 'Edit parameter',
headerArguments: {
Name: newParameterName,
Value: '46', // Shows calculated result
},
})
await cmdBar.progressCmdBar()
await editor.expectEditor.toContain(editedParameterValue)
})
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
})
test(`User can edit an offset plane operation from the feature tree`, async ({
context,
homePage,
scene,
editor,
toolbar,
cmdBar,
}) => {
const testCode = (value: string) => `p = offsetPlane(XY, offset = ${value})`
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
const initialInput = '10'
const initialCode = testCode(initialInput)
const newInput = '5 + 10'
const expectedCode = testCode(newInput)
await context.folderSetupFn(async (dir) => {
const testDir = join(dir, 'test-sample')
await fsp.mkdir(testDir, { recursive: true })
await fsp.writeFile(join(testDir, 'main.kcl'), initialCode, 'utf-8')
})
await test.step('setup test', async () => {
await homePage.expectState({
projectCards: [
{
title: 'test-sample',
fileCount: 1,
},
],
sortBy: 'last-modified-desc',
})
await homePage.openProject('test-sample')
Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312) * Add back stream idle mode * Shut up codespell * Correct serialization; only expose at user level * cargo fmt * tsc lint fmt * Move engineStreamMachine as a global actor; tons of more work * Fix up everything after bumping kittycad/lib * Remove camera sync * Use pause/play iconology * Add back better ping indicator * wip * Fix streamIdleMode checkbox being wonky * yarn fmt * Massive extinction event for waitForExecutionDone; try to stop projects view switching from crashing * Clear diagnostics when unmounting code editor! * wip * Rework initial root projects dir + deflake many projects tests * More e2e fixes * Deflake revolve some revolve tests * Fix the rest of the mfing tests * yarn fmt * yarn lint * yarn tsc * Fix tsc after rebase * wip * less flaky point and click * wip * Fixup after rebase * Fix more tests * Fix 2 more * Fix up named-views tests * yarn fmt lint tsc * Fix up new changes * Get rid of 1 cyclic dependency * Fix another cyclic mfer! * fmt * fmt tsc * Fix zoom to fit being frigged * a new list of circular deps * Remove NetworkHealthIndicator test that was shit * Fix the bad reload repeat issue kevin started on * Fix zoom to fit at the right moments... * Fix cache count numbers in editor test * Remove a test race - poll window info. * Qualify fail function * Try something * Use scene.connectionEstablished * Hopefully fix snapshots at least * Add app console.log * Fix native menu tests more * tsc lint * Fix camera failure * Try again * Test attempt number 15345203, action! * Add back old window detection heuristic * Remove firstWindow to complete the work of 2342d04fe244c327cdb1a1a721e5a125c08a2909 * Tweak some tests for MacOS * Tweak "set appearance" test for MacOS Revert this if it messes up any other platform's color checks! * Are you serious? This was all that needed formatting? * More color tweaks Local MacOS and CI MacOS don't agree * Fixes on apperance e2e test for stream idle branch (#6168) pierremtb/stream-idle-revamp-appearance-fixes * Another apperance fix * Skip one native menu test to make stream idle green (#6169) * pierremtb/stream-idle-revamp-more-fixes * Fix lint * Update snapshot for test_generate_settings_docs --------- Co-authored-by: lee-at-zoo-corp <lee@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-04-07 07:08:31 -04:00
await scene.settled(cmdBar)
Add edit flows for extrude and offset plane operations (#5045) * Start implementing a "prepareToEdit" callback for extrude * Start of generic edit flow for operations * Actually invoking command bar send generically on double-click * Refactor: break out non-React hook helper to calculate Kcl expression value * Add unit tests, fmt * Integrate helper to get calculated KclExpression * Clean up unused imports, simplify use of `programMemoryFromVariables` * Implement basic extrude editing * Refactor: move DefaultPlanesStr to its own lib file * Add support for editing offset planes * Add Edit right-click menu option * Turn off edit flow for sketch for now * Add e2e tests for sketch and offset plane editing, fix bug found with offset plane editing * Add failing e2e extrude edit test * Remove action version of extrude AST mod * Fix behavior when adding a constant while editing operation, fixing e2e test * Patch in changes from 61b02b570394f11afbd04d0d126d87305165c73c * Remove shell's prepareToEdit * Add other Surface types to `artifactIsPlaneWithPaths` * refactor: rename `item` to `operation` * Allow `prepareToEdit` to fail with a toast, signal sketch-on-offset is unimplemented * Rework sketch e2e test to test several working and failing cases * Fix tsc errors related to making `codeRef` optional * Make basic error messages more friendly * fmt * Reset modifyAst.ts to main * Fix broken artifactGraph unit test * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Remove unused import * Look at this (photo)Graph *in the voice of Nickelback* * Make the offset plane insert at the end, not one before * Fix bug caught by e2e test failure with "Command needs review" logic * Update src/machines/modelingMachine.ts Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> * Remove console logs per @pierremtb * Update src/components/CommandBar/CommandBarHeader.tsx Co-authored-by: Jonathan Tran <jonnytran@gmail.com> * Use better programMemory init thanks @jtran * Fix tsc post merge of #5068 * Fix logic for `artifactIsPlaneWithPaths` post-merge * Need to disable the sketch-on-face case now that artifactGraph is in Rust. Will active in a future PR (cc @jtran) * Re-run CI after snapshots * Update FeatureTreePane to not use `useCommandsContext`, missed during merge * Fix merge issue, import location change on edited file * fix click test step, which I believe is waiting for context scripts to load * Convert toolbarFixture.exeIndicator to getter We need to convert all these selectors on fixtures to getters, because they can go stale if called on the fixture constructor. * Missed a dumb little thing in toolbarFixture.ts * Fix goof with merge * fmt * Another dumb missed thing during merge I gotta get used to the LazyGit merge tool I'm not good at it yet * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Conver sceneFixture's exeIndicator to a getter Locators on fixtures will be frozen from the time of the fixture's initialization, I'm increasingly convinced * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * Post-kwargs E2E test cleanup * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-05 19:33:40 -05:00
await toolbar.openFeatureTreePane()
})
await test.step('Double click on the offset plane operation', async () => {
await (await toolbar.getFeatureTreeOperation('Offset Plane', 0))
.first()
.dblclick()
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: [initialCode],
})
await cmdBar.expectState({
commandName: 'Offset plane',
stage: 'arguments',
currentArgKey: 'distance',
currentArgValue: initialInput,
headerArguments: {
Plane: '1 plane',
Distance: initialInput,
},
highlightedHeaderArg: 'distance',
})
})
await test.step('Edit the distance argument and submit', async () => {
await expect(cmdBar.currentArgumentInput).toBeVisible()
await cmdBar.currentArgumentInput.locator('.cm-content').fill(newInput)
await cmdBar.progressCmdBar()
await cmdBar.expectState({
stage: 'review',
headerArguments: {
Plane: '1 plane',
// We show the calculated value in the argument summary
Distance: '15',
},
commandName: 'Offset plane',
})
await cmdBar.progressCmdBar()
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: [expectedCode],
})
})
})
test(`Delete sketch on offset plane and all profiles from feature tree`, async ({
context,
page,
homePage,
scene,
editor,
toolbar,
cmdBar,
}) => {
const beforeKclCode = `plane001 = offsetPlane(XY, offset = 5)
sketch001 = startSketchOn(plane001)
profile001 = circle(sketch001, center = [0, 20], radius = 12)
profile002 = startProfile(sketch001, at = [0, 7.25])
|> xLine(length = 13.3)
profile003 = startProfile(sketch001, at = [0, -4.93])
|> line(endAbsolute = [-5.56, 0])`
await context.folderSetupFn(async (dir) => {
const testProject = join(dir, 'test-sample')
await fsp.mkdir(testProject, { recursive: true })
await fsp.writeFile(join(testProject, 'main.kcl'), beforeKclCode, 'utf-8')
})
// One dumb hardcoded screen pixel value
const testPoint = { x: 650, y: 250 }
const sketchColor: [number, number, number] = [149, 149, 149]
const planeColor: [number, number, number] = [74, 74, 74]
await homePage.openProject('test-sample')
Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312) * Add back stream idle mode * Shut up codespell * Correct serialization; only expose at user level * cargo fmt * tsc lint fmt * Move engineStreamMachine as a global actor; tons of more work * Fix up everything after bumping kittycad/lib * Remove camera sync * Use pause/play iconology * Add back better ping indicator * wip * Fix streamIdleMode checkbox being wonky * yarn fmt * Massive extinction event for waitForExecutionDone; try to stop projects view switching from crashing * Clear diagnostics when unmounting code editor! * wip * Rework initial root projects dir + deflake many projects tests * More e2e fixes * Deflake revolve some revolve tests * Fix the rest of the mfing tests * yarn fmt * yarn lint * yarn tsc * Fix tsc after rebase * wip * less flaky point and click * wip * Fixup after rebase * Fix more tests * Fix 2 more * Fix up named-views tests * yarn fmt lint tsc * Fix up new changes * Get rid of 1 cyclic dependency * Fix another cyclic mfer! * fmt * fmt tsc * Fix zoom to fit being frigged * a new list of circular deps * Remove NetworkHealthIndicator test that was shit * Fix the bad reload repeat issue kevin started on * Fix zoom to fit at the right moments... * Fix cache count numbers in editor test * Remove a test race - poll window info. * Qualify fail function * Try something * Use scene.connectionEstablished * Hopefully fix snapshots at least * Add app console.log * Fix native menu tests more * tsc lint * Fix camera failure * Try again * Test attempt number 15345203, action! * Add back old window detection heuristic * Remove firstWindow to complete the work of 2342d04fe244c327cdb1a1a721e5a125c08a2909 * Tweak some tests for MacOS * Tweak "set appearance" test for MacOS Revert this if it messes up any other platform's color checks! * Are you serious? This was all that needed formatting? * More color tweaks Local MacOS and CI MacOS don't agree * Fixes on apperance e2e test for stream idle branch (#6168) pierremtb/stream-idle-revamp-appearance-fixes * Another apperance fix * Skip one native menu test to make stream idle green (#6169) * pierremtb/stream-idle-revamp-more-fixes * Fix lint * Update snapshot for test_generate_settings_docs --------- Co-authored-by: lee-at-zoo-corp <lee@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-04-07 07:08:31 -04:00
await scene.settled(cmdBar)
await test.step(`Verify we see the sketch`, async () => {
await scene.expectPixelColor(sketchColor, testPoint, 10)
})
await test.step('Delete sketch via feature tree selection', async () => {
const operationButton = await toolbar.getFeatureTreeOperation('Sketch', 0)
await operationButton.click({ button: 'left' })
await page.keyboard.press('Delete')
await scene.expectPixelColor(planeColor, testPoint, 10)
})
await test.step(`Verify the code changed`, async () => {
await editor.expectEditor.toContain('plane001 =')
await editor.expectEditor.not.toContain('sketch001 =')
await editor.expectEditor.not.toContain('profile002 = ')
})
await test.step(`Delete the remaining plane via feature tree`, async () => {
const operationButton = await toolbar.getFeatureTreeOperation(
'Offset Plane',
0
)
await operationButton.click({ button: 'left' })
await page.keyboard.press('Delete')
// Verify the plane code is gone, and https://github.com/KittyCAD/modeling-app/issues/5988 is fixed.
await editor.expectEditor.not.toContain('plane001 =')
})
})
})