Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple profiles in the same sketch #5196

Merged
merged 143 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
1e9cf6f
Revert "Revert multi-profile (#4812)"
Irev-Dev Dec 17, 2024
e60cabb
fix poor 1000ms wait UX
Irev-Dev Dec 17, 2024
30edf2a
Merge remote-tracking branch 'origin' into kurt-bring-back-multi-profile
Irev-Dev Dec 17, 2024
c696f08
A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)
github-actions[bot] Dec 17, 2024
2c40e8a
trigger CI
Irev-Dev Dec 17, 2024
3865637
Add Rust side artifacts for startSketchOn face or plane (#4834)
jtran Dec 19, 2024
1b9f5f2
Merge remote-tracking branch 'origin' into kurt-bring-back-multi-profile
Irev-Dev Dec 20, 2024
9f93346
lint
Irev-Dev Dec 20, 2024
e9086c5
lint
Irev-Dev Dec 20, 2024
913f264
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos…
github-actions[bot] Dec 20, 2024
7197b6c
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Dec 20, 2024
9f323c2
A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
github-actions[bot] Dec 20, 2024
68c8974
trigger CI
Irev-Dev Dec 20, 2024
6add1d7
chore: disabled file watcher which prevents faster file write (#4835)
nadr0 Dec 20, 2024
0642e49
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Dec 20, 2024
6c9d14a
partial fixes
Irev-Dev Dec 20, 2024
b09c240
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Dec 20, 2024
2bb548c
Trigger CI
pierremtb Dec 20, 2024
d3e4b12
Merge branch 'main' into kurt-bring-back-multi-profile
jtran Jan 9, 2025
fcf3272
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Jan 9, 2025
3344208
Trigger CI
jtran Jan 9, 2025
30397ba
Fix up all the tests
lf94 Jan 9, 2025
5fe3023
Fix partial execution
lf94 Jan 10, 2025
482487c
Merge branch 'main' into lf94/kurt-bring-back-multi-profile
lf94 Jan 15, 2025
648616c
Merge branch 'main' into lf94/kurt-bring-back-multi-profile
lf94 Jan 16, 2025
32e8975
wip
lf94 Jan 17, 2025
9008648
WIP
lf94 Jan 24, 2025
b3467bb
wip
lf94 Jan 27, 2025
33468c4
rust changes to make three point confrom to same as others since we'r…
Irev-Dev Jan 31, 2025
5a5138a
most of the fix for 3 point circle
Irev-Dev Jan 31, 2025
84d1745
get overlays working for circle three point
Irev-Dev Feb 3, 2025
d2f0865
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 3, 2025
4ec4469
fmt
Irev-Dev Feb 3, 2025
774e3ef
fix types
Irev-Dev Feb 3, 2025
1a67d34
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 3, 2025
481bef8
cargo fmt
Irev-Dev Feb 3, 2025
f2c76b0
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 3, 2025
663076f
add face codef ref for walls and caps
Irev-Dev Feb 4, 2025
40e4f22
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 4, 2025
87eabef
fix sketch on face after updates to rust side artifact graph
Irev-Dev Feb 4, 2025
d8dc49b
some things needed for multi-profile tests
Irev-Dev Feb 4, 2025
5ef0a1e
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 5, 2025
72272d5
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 5, 2025
4bb23bc
bad attempts at fixing rust
Irev-Dev Feb 5, 2025
42178fa
more
Irev-Dev Feb 5, 2025
e063622
more
Irev-Dev Feb 5, 2025
ced49f8
fix rust
Irev-Dev Feb 5, 2025
4ce6054
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 5, 2025
36d4830
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 5, 2025
0fd18c1
more rust fixes
Irev-Dev Feb 5, 2025
d8a9abb
overlay fix
Irev-Dev Feb 6, 2025
d70ebca
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 6, 2025
bcf3790
remove duplicate test
Irev-Dev Feb 6, 2025
f94671f
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 6, 2025
84ae567
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Feb 6, 2025
ee54cdd
lint and typing
Irev-Dev Feb 6, 2025
45416df
maybe fix a unit test
Irev-Dev Feb 6, 2025
d3afa38
small thing
Irev-Dev Feb 6, 2025
a7f4b0f
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 7, 2025
3190292
fix circ dep
Irev-Dev Feb 7, 2025
09cfbc1
fix unit test
Irev-Dev Feb 7, 2025
235e6a1
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 7, 2025
1f5f429
fix some tests
Irev-Dev Feb 7, 2025
7a79292
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 9, 2025
e075622
fix sweep point-and-click test
Irev-Dev Feb 9, 2025
064a41d
fix more tests and add a fix me
Irev-Dev Feb 9, 2025
6360b8a
fix more tests
Irev-Dev Feb 10, 2025
f4f0533
fix electron specific test
Irev-Dev Feb 10, 2025
6a16e47
tsc
Irev-Dev Feb 10, 2025
6b1cc36
more test tweaks
Irev-Dev Feb 10, 2025
6df5e70
update docs
Irev-Dev Feb 10, 2025
ab6995b
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 10, 2025
a8b7328
commint snaps?
Irev-Dev Feb 10, 2025
3379cc4
is clippy happy now?
Irev-Dev Feb 10, 2025
e60b0e6
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 10, 2025
2501a98
clippy again
Irev-Dev Feb 10, 2025
3e1f858
test works now without me changing anything big-fixed-itself
Irev-Dev Feb 10, 2025
db895d6
small bug
Irev-Dev Feb 10, 2025
77902d5
make three point have cross hair to make it consistent with othe rtools
Irev-Dev Feb 10, 2025
5713bfd
fix up state diagram
Irev-Dev Feb 10, 2025
40fb6a4
fmt
Irev-Dev Feb 10, 2025
680fc30
add draft point for first click of three point circ
Irev-Dev Feb 10, 2025
2227287
1 test for three point circle
Irev-Dev Feb 10, 2025
1d8348c
2 test for three point circle
Irev-Dev Feb 10, 2025
b213834
clean up
Irev-Dev Feb 10, 2025
4a0d852
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Feb 10, 2025
e1494c9
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Feb 10, 2025
5580631
remove bad doc comment
Irev-Dev Feb 10, 2025
5d22308
remove test skip
Irev-Dev Feb 10, 2025
89b0ccb
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 10, 2025
8f0a40b
remove onboarding test changes
Irev-Dev Feb 10, 2025
22c0003
Update src/lang/modifyAst.ts
Irev-Dev Feb 10, 2025
11a678d
Update output from simulation tests
jtran Feb 10, 2025
11eceef
Fix to use correct source ranges
jtran Feb 10, 2025
58ec610
Change back to skipping face cap none and both
jtran Feb 11, 2025
508e1c9
Update output after changing back to skipping none and both
jtran Feb 11, 2025
ad8e306
Fix clippy warning
jtran Feb 11, 2025
5ae92bc
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 11, 2025
cba2349
fix profile start snap bug
Irev-Dev Feb 11, 2025
a686fe9
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 11, 2025
83f458f
Merge branch 'main' into kurt-multi-profile-again
jtran Feb 11, 2025
4a8897b
Merge branch 'main' into kurt-multi-profile-again
jtran Feb 12, 2025
1854064
add path ids to cap
Irev-Dev Feb 12, 2025
4a8e582
fix going into edit sketch
Irev-Dev Feb 12, 2025
de526ae
make other startSketchOn's work
Irev-Dev Feb 12, 2025
a78ec6c
fix snapshot test
Irev-Dev Feb 12, 2025
41340c8
explain function name
Irev-Dev Feb 12, 2025
520f899
Update src/lib/rectangleTool.ts
Irev-Dev Feb 12, 2025
60dcf9d
rename error
Irev-Dev Feb 12, 2025
dc7b901
remove file tree from diff
Irev-Dev Feb 12, 2025
5f8ae22
Update src/clientSideScene/segments.ts
Irev-Dev Feb 12, 2025
c1db093
nit
Irev-Dev Feb 12, 2025
8a920b6
Prevent double write to KCL code on revolve
franknoirot Feb 12, 2025
039092e
Update output after adding cap-to-path graph edge
jtran Feb 12, 2025
bd10c65
Fix edit/select sketch-on-cap via feature tree
franknoirot Feb 12, 2025
500d92d
Merge branch 'main' into kurt-multi-profile-again
jtran Feb 12, 2025
d7f834f
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 13, 2025
9a89926
clean up for face codeRef
Irev-Dev Feb 13, 2025
b390e3e
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 13, 2025
9999e4e
fix changing tools part way through circle/rect tools
Irev-Dev Feb 13, 2025
0208eec
fix delete of circle profile
Irev-Dev Feb 13, 2025
b937934
fix close profiles
Irev-Dev Feb 13, 2025
b4d1a36
fix closing profile bug (tangentArcTo being ignored)
Irev-Dev Feb 13, 2025
bf1a42f
remove stale comment
Irev-Dev Feb 13, 2025
3747db0
Delete paths associated with sketch when the sketch plane is deleted
franknoirot Feb 12, 2025
09f3e6e
Add support for deleting sketches on caps (not walls)
franknoirot Feb 13, 2025
42016b7
get delet working for walls
Irev-Dev Feb 13, 2025
df89774
make delet of extrusions work for multi profile
Irev-Dev Feb 13, 2025
4ea1338
A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubunt…
github-actions[bot] Feb 13, 2025
acb399a
Delete the sketch statement too on the cap and wall cases
franknoirot Feb 13, 2025
4acf74f
Don't write to file in `split-sketch-pipe-if-needed` unless necessary
franknoirot Feb 13, 2025
18d5bb3
Don't wait for file write to complete within `updateEditorWithAstAndW…
franknoirot Feb 13, 2025
07bde26
docs
Irev-Dev Feb 13, 2025
592f139
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 13, 2025
44a54b4
fix circ dep
Irev-Dev Feb 13, 2025
2b84186
tsc
Irev-Dev Feb 13, 2025
b7658ed
fix selection enter sketch weirdness
Irev-Dev Feb 14, 2025
d9e3f14
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 14, 2025
f8a67c8
test fixes
Irev-Dev Feb 14, 2025
3a4de8d
Merge remote-tracking branch 'origin' into kurt-multi-profile-again
Irev-Dev Feb 14, 2025
e261541
comment out and fixme for delete related tests
Irev-Dev Feb 14, 2025
9a01225
add skip wins
Irev-Dev Feb 14, 2025
54459fa
try and get last test to pass
Irev-Dev Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/kcl/appearance.md

Large diffs are not rendered by default.

52,128 changes: 34,468 additions & 17,660 deletions docs/kcl/std.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/kcl/types/Face.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ A face.
| `id` |`string`| The id of the face. | No |
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
| `value` |`string`| The tag of the face. | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the faces X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the faces Y axis be? | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A face. | No |
Expand Down
23 changes: 23 additions & 0 deletions docs/kcl/types/Path.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,29 @@ a complete arc
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |


----
A base path.

**Type:** `object`





## Properties

| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `type` |enum: `CircleThreePoint`| | No |
| `p1` |`[number, number]`| Point 1 of the circle | No |
| `p2` |`[number, number]`| Point 2 of the circle | No |
| `p3` |`[number, number]`| Point 3 of the circle | No |
| `from` |`[number, number]`| The from point. | No |
| `to` |`[number, number]`| The to point. | No |
| `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No |
| `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No |


----
A path that is horizontal.

Expand Down
4 changes: 2 additions & 2 deletions docs/kcl/types/Plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ A plane.
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| A plane. | No |
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the planes X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the planes Y axis be? | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A plane. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
Expand Down
8 changes: 4 additions & 4 deletions docs/kcl/types/SketchSurface.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ A plane.
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
| `value` |[`PlaneType`](/docs/kcl/types/PlaneType)| A sketch type. | No |
| `origin` |[`Point3d`](/docs/kcl/types/Point3d)| Origin of the plane. | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the planes X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the planes Y axis be? | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the plane's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
| `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`| | No |
Expand All @@ -53,8 +53,8 @@ A face.
| `id` |`string`| The id of the face. | No |
| `artifactId` |[`ArtifactId`](/docs/kcl/types/ArtifactId)| The artifact ID. | No |
| `value` |`string`| The tag of the face. | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the faces X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the faces Y axis be? | No |
| `xAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's X axis be? | No |
| `yAxis` |[`Point3d`](/docs/kcl/types/Point3d)| What should the face's Y axis be? | No |
| `zAxis` |[`Point3d`](/docs/kcl/types/Point3d)| The z-axis (normal). | No |
| `solid` |[`Solid`](/docs/kcl/types/Solid)| The solid the face is on. | No |
| `units` |[`UnitLen`](/docs/kcl/types/UnitLen)| A sketch type. | No |
Expand Down
27 changes: 17 additions & 10 deletions e2e/playwright/basic-sketch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,26 @@ async function doBasicSketch(
const startXPx = 600
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
if (openPanes.includes('code')) {
await expect(u.codeLocator).toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %)`)
await expect(u.codeLocator).toContainText(
`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001)`
)
}
await page.waitForTimeout(500)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 10)
await page.waitForTimeout(500)

if (openPanes.includes('code')) {
await expect(u.codeLocator).toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %)
await expect(u.codeLocator)
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|> xLine(${commonPoints.num1}, %)`)
}
await page.waitForTimeout(500)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
if (openPanes.includes('code')) {
await expect(u.codeLocator).toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %)
await expect(u.codeLocator)
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt
}, sketch001)
|> xLine(${commonPoints.num1}, %)
|> yLine(${commonPoints.num1 + 0.01}, %)`)
} else {
Expand All @@ -79,8 +82,10 @@ async function doBasicSketch(
await page.waitForTimeout(200)
await page.mouse.click(startXPx, 500 - PUR * 20)
if (openPanes.includes('code')) {
await expect(u.codeLocator).toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %)
await expect(u.codeLocator)
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt
}, sketch001)
|> xLine(${commonPoints.num1}, %)
|> yLine(${commonPoints.num1 + 0.01}, %)
|> xLine(${commonPoints.num2 * -1}, %)`)
Expand Down Expand Up @@ -137,8 +142,10 @@ async function doBasicSketch(

// Open the code pane.
await u.openKclCodePanel()
await expect(u.codeLocator).toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt(${commonPoints.startAt}, %)
await expect(u.codeLocator)
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt
}, sketch001)
|> xLine(${commonPoints.num1}, %, $seg01)
|> yLine(${commonPoints.num1 + 0.01}, %)
|> xLine(-segLen(seg01), %)`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ test.describe(
},
}

const code = `sketch001 = startSketchOn('${plane}')
|> startProfileAt([0.9, -1.22], %)`
const code = `sketch001 = startSketchOn('${plane}')profile001 = startProfileAt([0.9, -1.22], sketch001)`

await u.openDebugPanel()

Expand Down
68 changes: 25 additions & 43 deletions e2e/playwright/feature-tree-pane.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sketch002 = startSketchOn(plane001)
extrude001 = extrude(sketch002, length = 10)
`

const FEAUTRE_TREE_SKETCH_CODE = `sketch001 = startSketchOn('XZ')
const FEATURE_TREE_SKETCH_CODE = `sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLine([0, 4], %, $rectangleSegmentA001)
|> angledLine([
Expand Down Expand Up @@ -153,33 +153,16 @@ test.describe('Feature Tree pane', () => {
`User can edit sketch (but not on offset plane yet) from the feature tree`,
{ tag: '@electron' },
async ({ context, homePage, scene, editor, toolbar, page }) => {
const unavailableToastMessage = page.getByText(
'Editing sketches on faces or offset planes through the feature tree is not yet supported'
)
await context.addInitScript((initialCode) => {
localStorage.setItem('persistCode', initialCode)
}, FEATURE_TREE_SKETCH_CODE)
await page.setBodyDimensions({ width: 1000, height: 500 })
await homePage.goToModelingScene()

await context.folderSetupFn(async (dir) => {
const bracketDir = join(dir, 'test-sample')
await fsp.mkdir(bracketDir, { recursive: true })
await fsp.writeFile(
join(bracketDir, 'main.kcl'),
FEAUTRE_TREE_SKETCH_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')
await scene.waitForExecutionDone()
await toolbar.openFeatureTreePane()
await test.step('force re-exe', async () => {
await page.waitForTimeout(1000)
await editor.replaceCode('90', '91')
await page.waitForTimeout(1500)
})

await test.step('On a default plane should work', async () => {
Expand All @@ -199,24 +182,23 @@ test.describe('Feature Tree pane', () => {
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()
await page.waitForTimeout(1000)
await editor.replaceCode('91', '90')
await page.waitForTimeout(2000)
await (await toolbar.getFeatureTreeOperation('Sketch', 1)).dblclick()

await expect(
unavailableToastMessage,
'We should see a toast message about this'
toolbar.exitSketchBtn,
'We should be in sketch mode now'
).toBeVisible()
await unavailableToastMessage.waitFor({ state: 'detached' })
// TODO - turn on once we update the artifactGraph in Rust
// to include the proper source location for the extrude face
// await expect(
// toolbar.exitSketchBtn,
// 'We should be in sketch mode now'
// ).toBeVisible()
// await editor.expectState({
// highlightedCode: '',
// diagnostics: [],
// activeLines: ['|>circle({center=[-1,2],radius=.5},%)'],
// })
// await toolbar.exitSketchBtn.click()
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: [
'sketch002=startSketchOn(extrude001,rectangleSegmentB001)',
],
})
await toolbar.exitSketchBtn.click()
})

await test.step('On an offset plane should *not* work', async () => {
Expand All @@ -226,7 +208,7 @@ test.describe('Feature Tree pane', () => {
await editor.expectState({
highlightedCode: '',
diagnostics: [],
activeLines: ['|>circle({center=[0,0],radius=5},%)'],
activeLines: ['sketch003=startSketchOn(plane001)'],
})
await expect(
toolbar.exitSketchBtn,
Expand Down
Loading
Loading