Files
modeling-app/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts

115 lines
4.2 KiB
TypeScript
Raw Permalink Normal View History

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'
Migrate Text-to-CAD (edit) to multi-file endpoint (#6066) * start of migrate to multi file endpoint * get some relative path stuff sorted * blobifying files, and making selections work with imports working * add write to disk * warn about big projects * update known circular * update snapshot * remove log * tweak selection filters * Update src/components/ModelingMachineProvider.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fmt * fix one thing * typo * raw dog form data like a fucking peasant * remove fake data * fmt * steal Kevin's stuff * good progress * clean up * fix writing to files when response returns * comment the terriable code * push fix of sorts * better fix * spot of clean up * fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast * fix: handling more error flows by dismissing the toast * chore: leaving a comment for a confusing workflow * fix: trying to clean up some async logic * fix: trying to fix a few things at once... * fix: fixing toast success * fix: how did this desync? * fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem * fix: typo * Change back to `spawnChild`, forego `actors` by reference * fix: updating PR comments * fix: found a bug with paths from rust! it is actually OS paths! * fix: updated type still is failing tsc * fix: the type of the machine was wrong, we always set it to at least '' * fix: idk man * Fix happy path test (button labels) --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-08 03:54:40 +10:00
import path from 'path'
import 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
/* eslint-disable jest/no-conditional-expect */
/**
* Snapshot Tests for Text-to-CAD API Requests
*
* These tests are primarily designed to capture the requests sent to the Text-to-CAD API
* rather than to verify application behavior. Unlike regular tests, these tests:
*
* 1. Don't assert much about the application's response or state changes
* 2. Focus on setting up specific scenarios and triggering API requests
* 3. Use the captureTextToCadRequestSnapshot() method to save request payloads to snapshot files
*
* The main purpose is to maintain a collection of real-world API request examples that can be:
* - Used for regression testing the (AI) API
* - Referenced when making changes to the Text-to-CAD integration, particularly the meta-prompts
* the frontend adds to the user's prompt
*
* These tests intentionally don't wait for or verify responses, as we're primarily
* interested in capturing the outgoing requests for documentation and analysis.
*
*/
Migrate Text-to-CAD (edit) to multi-file endpoint (#6066) * start of migrate to multi file endpoint * get some relative path stuff sorted * blobifying files, and making selections work with imports working * add write to disk * warn about big projects * update known circular * update snapshot * remove log * tweak selection filters * Update src/components/ModelingMachineProvider.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fmt * fix one thing * typo * raw dog form data like a fucking peasant * remove fake data * fmt * steal Kevin's stuff * good progress * clean up * fix writing to files when response returns * comment the terriable code * push fix of sorts * better fix * spot of clean up * fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast * fix: handling more error flows by dismissing the toast * chore: leaving a comment for a confusing workflow * fix: trying to clean up some async logic * fix: trying to fix a few things at once... * fix: fixing toast success * fix: how did this desync? * fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem * fix: typo * Change back to `spawnChild`, forego `actors` by reference * fix: updating PR comments * fix: found a bug with paths from rust! it is actually OS paths! * fix: updated type still is failing tsc * fix: the type of the machine was wrong, we always set it to at least '' * fix: idk man * Fix happy path test (button labels) --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-08 03:54:40 +10:00
const fileWithImport = `import "b.kcl" as b
sketch001 = startSketchOn(XZ)
profile001 = startProfile(sketch001, at = [57.81, 250.51])
|> line(end = [121.13, 56.63], tag = $seg02)
|> line(end = [83.37, -34.61], tag = $seg01)
|> line(end = [19.66, -116.4])
|> line(end = [-221.8, -41.69])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(profile001, length = 200)
sketch002 = startSketchOn(XZ)
|> startProfile(at = [-73.64, -42.89])
|> xLine(length = 173.71)
|> line(end = [-22.12, -94.4])
|> xLine(length = -156.98)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude002 = extrude(sketch002, length = 50)
Migrate Text-to-CAD (edit) to multi-file endpoint (#6066) * start of migrate to multi file endpoint * get some relative path stuff sorted * blobifying files, and making selections work with imports working * add write to disk * warn about big projects * update known circular * update snapshot * remove log * tweak selection filters * Update src/components/ModelingMachineProvider.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fmt * fix one thing * typo * raw dog form data like a fucking peasant * remove fake data * fmt * steal Kevin's stuff * good progress * clean up * fix writing to files when response returns * comment the terriable code * push fix of sorts * better fix * spot of clean up * fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast * fix: handling more error flows by dismissing the toast * chore: leaving a comment for a confusing workflow * fix: trying to clean up some async logic * fix: trying to fix a few things at once... * fix: fixing toast success * fix: how did this desync? * fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem * fix: typo * Change back to `spawnChild`, forego `actors` by reference * fix: updating PR comments * fix: found a bug with paths from rust! it is actually OS paths! * fix: updated type still is failing tsc * fix: the type of the machine was wrong, we always set it to at least '' * fix: idk man * Fix happy path test (button labels) --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-08 03:54:40 +10:00
b
`
const importedFile = `sketch003 = startSketchOn(XY)
|> startProfile(at = [52.92, 157.81])
|> angledLine(angle = 0, length = 176.4, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 53.4,
tag = $rectangleSegmentB001,
)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
Migrate Text-to-CAD (edit) to multi-file endpoint (#6066) * start of migrate to multi file endpoint * get some relative path stuff sorted * blobifying files, and making selections work with imports working * add write to disk * warn about big projects * update known circular * update snapshot * remove log * tweak selection filters * Update src/components/ModelingMachineProvider.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fmt * fix one thing * typo * raw dog form data like a fucking peasant * remove fake data * fmt * steal Kevin's stuff * good progress * clean up * fix writing to files when response returns * comment the terriable code * push fix of sorts * better fix * spot of clean up * fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast * fix: handling more error flows by dismissing the toast * chore: leaving a comment for a confusing workflow * fix: trying to clean up some async logic * fix: trying to fix a few things at once... * fix: fixing toast success * fix: how did this desync? * fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem * fix: typo * Change back to `spawnChild`, forego `actors` by reference * fix: updating PR comments * fix: found a bug with paths from rust! it is actually OS paths! * fix: updated type still is failing tsc * fix: the type of the machine was wrong, we always set it to at least '' * fix: idk man * Fix happy path test (button labels) --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-08 03:54:40 +10:00
extrude(sketch003, length = 20)
`
Migrate Text-to-CAD (edit) to multi-file endpoint (#6066) * start of migrate to multi file endpoint * get some relative path stuff sorted * blobifying files, and making selections work with imports working * add write to disk * warn about big projects * update known circular * update snapshot * remove log * tweak selection filters * Update src/components/ModelingMachineProvider.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fmt * fix one thing * typo * raw dog form data like a fucking peasant * remove fake data * fmt * steal Kevin's stuff * good progress * clean up * fix writing to files when response returns * comment the terriable code * push fix of sorts * better fix * spot of clean up * fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast * fix: handling more error flows by dismissing the toast * chore: leaving a comment for a confusing workflow * fix: trying to clean up some async logic * fix: trying to fix a few things at once... * fix: fixing toast success * fix: how did this desync? * fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem * fix: typo * Change back to `spawnChild`, forego `actors` by reference * fix: updating PR comments * fix: found a bug with paths from rust! it is actually OS paths! * fix: updated type still is failing tsc * fix: the type of the machine was wrong, we always set it to at least '' * fix: idk man * Fix happy path test (button labels) --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-08 03:54:40 +10:00
Add 3 point arc (#5722) * bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day 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) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-18 11:14:12 +11:00
test.describe('edit with AI example snapshots', () => {
test(
`change colour`,
Migrate Text-to-CAD (edit) to multi-file endpoint (#6066) * start of migrate to multi file endpoint * get some relative path stuff sorted * blobifying files, and making selections work with imports working * add write to disk * warn about big projects * update known circular * update snapshot * remove log * tweak selection filters * Update src/components/ModelingMachineProvider.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fmt * fix one thing * typo * raw dog form data like a fucking peasant * remove fake data * fmt * steal Kevin's stuff * good progress * clean up * fix writing to files when response returns * comment the terriable code * push fix of sorts * better fix * spot of clean up * fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast * fix: handling more error flows by dismissing the toast * chore: leaving a comment for a confusing workflow * fix: trying to clean up some async logic * fix: trying to fix a few things at once... * fix: fixing toast success * fix: how did this desync? * fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem * fix: typo * Change back to `spawnChild`, forego `actors` by reference * fix: updating PR comments * fix: found a bug with paths from rust! it is actually OS paths! * fix: updated type still is failing tsc * fix: the type of the machine was wrong, we always set it to at least '' * fix: idk man * Fix happy path test (button labels) --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-08 03:54:40 +10:00
// TODO this is more of a snapshot, but atm it needs to be manually run locally to update the files
{ tag: ['@desktop'] },
Add 3 point arc (#5722) * bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day 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) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-18 11:14:12 +11:00
async ({ context, homePage, cmdBar, editor, page, scene }) => {
Migrate Text-to-CAD (edit) to multi-file endpoint (#6066) * start of migrate to multi file endpoint * get some relative path stuff sorted * blobifying files, and making selections work with imports working * add write to disk * warn about big projects * update known circular * update snapshot * remove log * tweak selection filters * Update src/components/ModelingMachineProvider.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * fmt * fix one thing * typo * raw dog form data like a fucking peasant * remove fake data * fmt * steal Kevin's stuff * good progress * clean up * fix writing to files when response returns * comment the terriable code * push fix of sorts * better fix * spot of clean up * fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast * fix: handling more error flows by dismissing the toast * chore: leaving a comment for a confusing workflow * fix: trying to clean up some async logic * fix: trying to fix a few things at once... * fix: fixing toast success * fix: how did this desync? * fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem * fix: typo * Change back to `spawnChild`, forego `actors` by reference * fix: updating PR comments * fix: found a bug with paths from rust! it is actually OS paths! * fix: updated type still is failing tsc * fix: the type of the machine was wrong, we always set it to at least '' * fix: idk man * Fix happy path test (button labels) --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev> Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com> Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com> Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-08 03:54:40 +10:00
const project = 'test-dir'
await context.folderSetupFn(async (dir) => {
const projectDir = path.join(dir, project)
await fsp.mkdir(projectDir, { recursive: true })
// Create the imported file
await fsp.writeFile(path.join(projectDir, 'b.kcl'), importedFile)
// Create the main file that imports
await fsp.writeFile(path.join(projectDir, 'main.kcl'), fileWithImport)
})
await homePage.openProject(project)
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 3 point arc (#5722) * bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day 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) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-18 11:14:12 +11:00
const body1CapCoords = { x: 571, y: 351 }
const [clickBody1Cap] = scene.makeMouseHelpers(
body1CapCoords.x,
body1CapCoords.y
)
const submittingToast = page.getByText('Submitting to Text-to-CAD API...')
Add 3 point arc (#5722) * bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day 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) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-18 11:14:12 +11:00
await test.step('wait for scene to load select body and check selection came through', async () => {
await clickBody1Cap()
await editor.expectState({
highlightedCode: '',
activeLines: ['|>startProfile(at=[-73.64,-42.89])'],
Add 3 point arc (#5722) * bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day 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) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-18 11:14:12 +11:00
diagnostics: [],
})
})
Add 3 point arc (#5722) * bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day 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) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-18 11:14:12 +11:00
await test.step('fire off edit prompt', async () => {
await cmdBar.captureTextToCadRequestSnapshot(test.info())
await cmdBar.openCmdBar('promptToEdit')
await page.waitForTimeout(100)
await cmdBar.progressCmdBar()
Add 3 point arc (#5722) * bare minimum * start of segment util added * remove redundant handle * some probably buggy handling of arc handles, can fix later * probably bug implementation of update args, but data flow through is mostly there can fix bugs after * fix update for arc * fix math for center handle * fix up length indicator * tweak math * stub out xState logic for arc * more progress on adding point and click, implemented more of sketchLineHelper for arc * small unrelated tweak * fix up draft arc bugs * fix arc last click * fix draft segment animation and add comment * add draft point snapping for arcs * add helper stuff to arc * clone arc point and click as base for arc-three-point * rust change for arc three point * can draw three point arc * make arcTo editable * can add new three point arc, so long as it continues existing profile * get overlays working * make snap to for continuing profile work for three point arcs * add draft animation * tangent issue fix * action rename * tmp test fix up * fix silly bug * fix couple problems causing tests to fail * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * fix up * add delet segment test for new segments * update docs * draft segments should look right * add test for dragging new segment handles * arc tools can be chained now * make three point arc can start a new profile (not only extend existing paths) * add test for equiping and unequiping the tool plus drawing with it * fix console noise * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * clean up * update rust/docs * put toolbar mode check into fixture * do thing for lee * use TEST_COLORSs * fix colors * don't await file write * remove commented code * remove unneeded template strings * power to **2 * remove magic numbers * more string templates * some odd bits of clean up * arc should be enable in dev * A snapshot a day 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) * add new simulation test * fix test code from kwark migration * issues Frank found * fix deleting half complete ark * fix * small fix on dele index * tsc post main merge * fix up snaping to profile start * add cross hari for three point arc * block snapping if it's the only segment * add tests for canceling arcTo halfway through --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-18 11:14:12 +11:00
// being specific about the color with a hex means asserting pixel color is more stable
await page
.getByTestId('cmd-bar-arg-value')
.fill('make this neon green please, use #39FF14')
await page.waitForTimeout(100)
await cmdBar.progressCmdBar()
await expect(submittingToast).toBeVisible()
})
}
)
})