* Back button on SignIn page leads to Home page
Fixes#6413
* Add regression test for the bug, and for new cancel button
* Full sign in e2e test
* Good bot
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Turn on uom checks
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Convert all lengths to mm for engine calls
Signed-off-by: Nick Cameron <nrc@ncameron.org>
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Change polygon to keyword args
* Update docs
* Update generated output
* Update docs to mention the default for inscribed
* Appease clippy
* Remove tag parameter
* Update docs since removing tag
* Remove inscribed from autocomplete snippet since the default is true
Update onboarding interactive numbers test to use editor fixture
Trying to bring it down from the leaderboard of failed tests.
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update test to check for deletion of only operation
* Allow updateEditorWithAstAndWriteToFile to clear AST
* Update src/lang/codeManager.ts
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
* Weave `isDeleting` through to `deleteSelectionPromise`
* fmt
---------
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Add error to console exception
* Ignore in codespell
* Increase retry on snapshots
* Fixme's all around
---------
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
* Add fixmes to bad snapshots tests
* max attempts to 5 on snapshots
* Skip revolve on windows
* Another one
* Add fixme to edit with ML snapshot test
* fmt
* Use absolute import, fix lint
* Disable another test
---------
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
* Remove all use of bold mono font
A few mono font points are left, mostly for numbers which look better in
monospace.
* make React happy with `clipRule`
* WIP: Add point-and-click Import for geometry
Will eventually fix#6120
Right now the whole loop is there but the codemod doesn't work yet
* Better pathToNOde, log on non-working cm dispatch call
* Add workaround to updateModelingState not working
* Back to updateModelingState with a skip flag
* Better todo
* Change working from Import to Insert, cleanups
* Sister command in kclCommands to populate file options
* Improve path selector
* Unsure: move importAstMod to kclCommands onSubmit 😶
* Add e2e test
* Clean up for review
* Add native file menu entry and test
* No await yo lint said so
* WIP: UX improvements around foreign file imports
Fixes#6152
* WIP: Set translate and rotate via point-and-click on imports. Boilerplate code
Will eventually close#6020
* Full working loop of rotate and translate pipe mutation, including edits, only on module imports. VERY VERBOSE
* Add first e2e test for set transform. Bunch of caveats listed as TODOs
* @lrev-Dev's suggestion to remove a comment
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Update to scene.settled(cmdBar)
* Add partNNN default name for alias
* Lint
* Lint
* Fix unit tests
* Add sad path insert test
Thanks @Irev-Dev for the suggestion
* Add step insert test
* Lint
* Add test for second foreign import thru file tree click
* WIP: Add point-and-click Load to copy files from outside the project into the project
Towards #6210
* Move Insert button to modeling toolbar, update menus and toolbars
* Add default value for local name alias
* Aligning tests
* Fix tests
* Add padding for filenames starting with a digit
* Lint
* Lint
* Update snapshots
* Merge branch 'main' into pierremtb/issue6210-Add-point-and-click-Load-to-copy-files-from-outside-the-project-into-the-project
* Add disabled transform subbutton
* Allow start of Transform flow from toolbar with selection
* Merge kcl-samples and local disk load into one 'Load external model' command
* Fix em tests
* Fix test
* Add test for file pick import, better input
* Fix non .kcl loading
* Lint
* Update snapshots
* Fix issue leading to test failure
* Fix clone test
* Add note
* Fix nested clone issue
* Clean up for review
* Add valueSummary for path
* Fix test after path change
* Clean up for review
* Support much wider range for transform
* Set display names
* Bug fixed itself moment...
* Add test for extrude tranform
* Oops missed a thing
* Clean up selection arg
* More tests incl for variable stuff
* Fix imports
* Add supportsTransform: true on all solids returning operations
* Fix edit flow on variables, add test
* Split transform command into translate and rotate
* Clean up and comment
* Clean up operations.ts
* Add comment
* Improve assemblies test
* Support more things
* Typo
* Fix test after unit change on import
* Last clean up for review
* Fix remaining test
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Use the engineStreamState that's available right there silly
* fix lint
* Just look at playing/paused
---------
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
* Fix so that just commands regenerate ast output
* Update just command to include manifest
* Fix overwrite-sim-test kcl_samples to generate manifest
This is the command used in CI.
* wip
* sketch a bit more; going to pull this out of tests next
* wip
* lock start things
* this was a bad idea
* Revert "this was a bad idea"
This reverts commit a2092e7ed6.
* prepare prelude before spawning
* error
* poop
* yike
* :(
* ok
* Reapply "this was a bad idea"
This reverts commit fafdf41093.
* chip away more
* man this is bad
* fix rebase add feature flag
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* get rid of execution kind
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* clippy
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* logs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* no extra executes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* race w batch
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* cluppy
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* no printlns
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* no printlns
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* fix source ranges
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* batch shit
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>
* fix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* fix some bugs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* fix error
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* cut 1
* preserve mem
* re-ad deep_clone
the helper we were calling was pushing a new call, which was hanging
out. we can skip the middleman since we already have something properly
prepared, just without a stdlib in some cases.
* skip non-kcl
* clean up source range bug
* error message changed
the uuids also changed because the error is hit before execute even
starts.
* typo
* rensnapshot a few
* order things
* MAYBE REVERT LATER:
attempt at an ordering
* snapsnap
* Revert "snapsnap"
This reverts commit 7350b32c7d.
* Revert "MAYBE REVERT LATER:"
This reverts commit ab49f3e85f.
* ugh
* poop
* poop2
* lint
* tranche 1
* more
* more snaps
* snap
* more
* update
* MAYBE REVERT THIS
* cache multi-file
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* addd tests
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* set to false
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* add test outputs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* clippy
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* kcl-py-bindings uses carwheel
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* update snapshots
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>
Co-authored-by: Paul R. Tagliamonte <paul@zoo.dev>
Co-authored-by: Paul Tagliamonte <paultag@gmail.com>
Previously, KCL would silently ignore any duplicated keyword args, setting the parameter to one arbitrarily-chosen argument. Now this is instead a parse error.
I've tested that
1. The error message makes sense
2. The error is on a reasonable part of the source code
3. The error doesn't prevent other kinds of parse errors being picked up later
Thanks for noticing this one Frank!
The engine fixed the start angle for helices, but our e2e test has a
pixel check so it broke. I made the test change the `startAngle` by
`-90` rather than try to hunt around for a new working pixel value.
* Switch to a 6-core profile for mac
* Bump workers percentage to optimize for CPU count (#6329)
* Bump macOS workers percentage to optimize for CPU count
* Handle floor math
---------
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
* maybe use biome
* import organising
* Removed unused new fmt commands; fix to not use linter
* Don't use fmt:generated - fmt is fast, but also use Makefile for this sort of thing
---------
Co-authored-by: lee-at-zoo-corp <lee@zoo.dev>
* use artifact id for sketch mode entry plane
* fix up re-eval as best as possible
* remove some async dodgyness
* fmt
* fix old sycronous re-execute shit
* add a test
* fix existing test
* add toast for error state
* spelling
* test stuff
* fmt
* fix toast
* test fix
* some other fix ups
* fix test
* KCL: Convert angledLineThatIntersects to use kwargs
* Update KCL tests and samples
* WIP
* Fix tsc and lint errors
* Fix missing cases
* Fix modifyAst unit tests
* Fix sketch unit tests
* Fix std unit tests
* Fix to not have extra docs
* Fix more unit tests
* Fix bench test
* Fix e2e tests to use new kw args
* tiny lint
* Fix adding constraint from UI to work
* Fix to use labeledArg constraints and use the correct order of args
* Fix selections e2e test
* Fix e2e test expectation
App was working as expected, but the e2e test was
expecting the old code, not the new code.
* Fix order of constraints in unit test
* Update docs
* Fix KCL formatting
* Update output
---------
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
* first draft of making segment snap to previous arc's last tangent
* ability to force/disable line snap, threshold in screen space
* mouseEvent refactor tsc errors fixed
* cleanups, extract getTanPreviousPoint function
* add snap line support when previous segment is ARC
* small cleanups
* remove unused planeNodePath param from onDragSegment
* renaming
* Enable snapping when placing the segment point in onClick
* refactor getSnappedDragPoint to include axis intersection
* handle snapping to both axis and tangent direction
* snap refinements
* small cleanups
* lint
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* generate tag for previous arc when snapping current straight segment
* using previous arc's tag in snapped angledLine
* angledLine uses object instead of array now
* use more general snap object instead
* snap tangent line visualized when snapping occurs
* remove unused scale param from createLine
* prettier
* fix bug where segment body is not drawn
* fix generated kcl error introduced in merge from main - modifiedAst needs to be passed to addNewSketchLn
* add support for snapping to negative tangent direction
* fix findTangentDirection for THREE_POINT_ARC_SEGMENT
* fix tsc error by introducing overrideExpr
* fix missing ccw for 3 point arc, fix tan_previous_point calculation for 3 point arcs
* resolve clippy until confirmation for circle radius
* fix runtime error when drawing a 3 point arc
* add unit tests to closestPointoOnRay
* unrelated react warning fixed
* add playwright test for tangent snapping
* better fix for tan_previous_point
* fix lint
* add simulation test for tangent_to_3_point_arc
* Fix simulation test output
* Add missing simulation test output files
* fix tangent snapping bug: use current group instead of last group in activeSegments
* make testcombos.test happy
* cleanup merge
* fix merge mistake, tsc error
* update tangent_to_3_point_arc simulation test
* fix angledLine related breaking tests
* minimum distance added before snapping to tangent
* circle is always ccw regardless of the order of points for tangential info calculation
* fix snapping when different unit is used other than mm
* update test: Straight line snapping to previous tangent
* update rust snapshot test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
* WIP: Add point-and-click Import for geometry
Will eventually fix#6120
Right now the whole loop is there but the codemod doesn't work yet
* Better pathToNOde, log on non-working cm dispatch call
* Add workaround to updateModelingState not working
* Back to updateModelingState with a skip flag
* Better todo
* Change working from Import to Insert, cleanups
* Sister command in kclCommands to populate file options
* Improve path selector
* Unsure: move importAstMod to kclCommands onSubmit 😶
* Add e2e test
* Clean up for review
* Add native file menu entry and test
* No await yo lint said so
* WIP: UX improvements around foreign file imports
Fixes#6152
* @lrev-Dev's suggestion to remove a comment
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Update to scene.settled(cmdBar)
* Add partNNN default name for alias
* Lint
* Lint
* Fix unit tests
* Add sad path insert test
Thanks @Irev-Dev for the suggestion
* Add step insert test
* Lint
* Add test for second foreign import thru file tree click
* WIP: Add point-and-click Load to copy files from outside the project into the project
Towards #6210
* Move Insert button to modeling toolbar, update menus and toolbars
* Add default value for local name alias
* Aligning tests
* Fix tests
* Add padding for filenames starting with a digit
* Lint
* Lint
* Update snapshots
* Merge branch 'main' into pierremtb/issue6210-Add-point-and-click-Load-to-copy-files-from-outside-the-project-into-the-project
* Add disabled transform subbutton
* Merge kcl-samples and local disk load into one 'Load external model' command
* Fix em tests
* Fix test
* Add test for file pick import, better input
* Fix non .kcl loading
* Lint
* Update snapshots
* Fix issue leading to test failure
* Fix clone test
* Add note
* Fix nested clone issue
* Clean up for review
* Add valueSummary for path
* Fix test after path change
* Clean up for review
* Update src/lib/kclCommands.ts
Thanks @franknoirot!
Co-authored-by: Frank Noirot <frank@zoo.dev>
* Improve path input arg
* Fix tests
* Merge branch 'main' into pierremtb/issue6210-Add-point-and-click-Load-to-copy-files-from-outside-the-project-into-the-project
* Fix path header not showing and improve tests
* Clean up
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
Co-authored-by: Frank Noirot <frank@zoo.dev>
* Add an engine error type for an "outage"
* Add a loading spinner back to the stream just for engine connection
* Refactor Loading spinner to account for early errors
* Add styling and state logic for unrecoverable errors in Loading
* Let engine error messages contain markdown
* Clarify 'too many connections' error message
* Add a "VeryLongLoadTime" error that suggests checking firewall
* Give the engine connection spinner a test ID and use it
* Use a dropdown for stream idle setting
* Add support for undefined values in dropdowns
* Move cache bust to the beginning of engine open for reconnections
* yarn tsc
* Don't setup model feature highlighters until the connection is ready
* Wait 2s to give engine time to serve video, then listen for modeling commands
* Undo teardown
* yarn fmt
* Fix circular module dependency; fmt & lint & tsc
* Fix editor-test waiting for 2 instead of 1
* Increment another 2 numbers ...
---------
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* More units of measure work
Signed-off-by: Nick Cameron <nrc@ncameron.org>
* Update CSG output since engine change
---------
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Nick Cameron <nrc@ncameron.org>
The connection can't be bad if there is not yet `:galaxy-brain:`.
But seriously this behavior regressed share links because we would bail
from the command palette because the connection wasn't healthy.
* initPromise in main.ts
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* move initPromise so dep tree doesnt shit the bed
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* fix: moving toast application state:
* fix: forgot the await on the expect calls, ts didn't yell at me?
* fix: cleaning up the camera move e2e code
* fix: lint,tsc,fmt
* Unblock on macOS for now
---------
Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
* pierremtb/issue6256-another-test
* yarn to npm install
* Revert "yarn to npm install"
This reverts commit 4a3daf950f.
* yarn to npm install
* Force IS_RELEASE=true
* Clean up for review
* Send test results to an API
* Include platform
* Include target
* Return earlier
* Include actual commit SHA
* Include PR number
* Rename variables for clarity
* add tests for calculate_circle_center - the first one succeeds with the current impl
* fix calculate_circle_center
* comment cleanup
* clippy
* comment format
* update circle_three_point sim test snapshot for slight floating point changes introduced by calculate_circle_center refactor
* use TAU instead of 2 * PI
* clippy
* Add CSG operations to the artifact graph
* Add tool IDs for subtract
* Fix names to match modeling-cmds now that it's done
* Update output since adding CSG ops
* Update formatting
* Add extra solid ids to the graph
* Fix to not add duplicates to the graph
* fix: increasing timeout to reduce failures..?
* fix: removing debugging code
* Remove unnecessary pixel color check
* Only close the command palette on disconnection events
This code closes the palette on *any* network event, including it
getting established. This made tests like "Create a few projects using
the default project name" unreliable.
Also adds a block comment about how we should do something more
sophisticated than bail out in the future.
* Show a toast to explain why the user just lost their command flow
* Remove unnecessary click in test. `fill` focuses already
* Oop don't spam this disconnection toast if the palette isn't open
Honoring exhausting hook dependency checks
* Skip circle snapshot test, it's being weird
* Disable the export button if engine connection is unavailable
* Refactor useDemoCode to hopefully be more reliable
* allow weak connections to receive demo code
* revert Refactor useDemoCode to hopefully be more reliable
Commit:
2625c14783 [2625c1478]
---------
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
Co-authored-by: Andrew Varga <grizzly33@gmail.com>
* Improve ActionButtonDropdown selection
* center rectangle icon fixed
* ignore Esc key when displaying hotkeys
* add ability to escape 3 point circle tool
* remove focus from ActionButton, ActionButtonDropdown
* remove focus outline from buttons
* remember lastly selected multi action item
* Add tests for toolbar buttons
* fix sketch-tests by turning toolbar dropdown arrays into an object with an id - this got broken because dropdown now remember the last selected option so we cant rely on cant reference the first option in tests
* update other tests with open menu click
* WIP: Add point-and-click Import for geometry
Will eventually fix#6120
Right now the whole loop is there but the codemod doesn't work yet
* Better pathToNOde, log on non-working cm dispatch call
* Add workaround to updateModelingState not working
* Back to updateModelingState with a skip flag
* Better todo
* Change working from Import to Insert, cleanups
* Sister command in kclCommands to populate file options
* Improve path selector
* Unsure: move importAstMod to kclCommands onSubmit 😶
* Add e2e test
* Clean up for review
* Add native file menu entry and test
* No await yo lint said so
* WIP: UX improvements around foreign file imports
Fixes#6152
* @lrev-Dev's suggestion to remove a comment
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Update to scene.settled(cmdBar)
* Add partNNN default name for alias
* Lint
* Lint
* Fix unit tests
* Add sad path insert test
Thanks @Irev-Dev for the suggestion
* Add step insert test
* Lint
* Add test for second foreign import thru file tree click
* Add default value for local name alias
* Aligning tests
* Fix tests
* Add padding for filenames starting with a digit
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Fix unclickable state, don't show warning if query present
* Leave a note about need for a web test
* Fix browser share links by waiting for network connection
* Don't worry about engineConnection on home route
* WIP: Add point-and-click Import for geometry
Will eventually fix#6120
Right now the whole loop is there but the codemod doesn't work yet
* Better pathToNOde, log on non-working cm dispatch call
* Add workaround to updateModelingState not working
* Back to updateModelingState with a skip flag
* Better todo
* Change working from Import to Insert, cleanups
* Sister command in kclCommands to populate file options
* Improve path selector
* Unsure: move importAstMod to kclCommands onSubmit 😶
* Add e2e test
* Clean up for review
* Add native file menu entry and test
* No await yo lint said so
* @lrev-Dev's suggestion to remove a comment
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Update to scene.settled(cmdBar)
* Lint
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* 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 2342d04fe2
* 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>
* attempt to import win-ca on windows
otherwise we won't see system x509 cert authorities, which leaves people
high and dry if they're using an enterprise mitm tls box (😢)
* first pass at adding test for Only showing axis planes when there are no errors
* fix test Only show axis planes when there are no errors
* PR feedback
* Remove E2E test behavior for projection toggle UI
Even though the test is `fixme`'d this should make it easier to
ressurect. The test is still flaky but it runs now.
* Remove projection toggle from the UI
Get rid of risky useEffect in restart onboarding flow
In certain cases this would cause an infinite loop in the web version of
the app. We should eliminate all uses of this "fire and listen with a
useEffect" antipattern in the code base, it was a mistake I introduced.
This uses the XState `waitFor` function to wait **only once** for the
transition to complete, with some error handling in case it fails.
* chore: skeleton for building and creating menus. Need electron to renderer interface to dynamically set the menu
* chore: skeleton typing for communication between nodes and web side
* chore: more skeleton for the different roles within the menu options, need more type safety
* chore: adding more skeleton and templates of what the menus could be
* chore: implemented first pass for helpRole links
* fix: syntax issue stopped the build step
* feature: loading different menus based on your page
* feature: Home page file role implemented
* chore: handling the build workflow for the signin page
* fix: moving edit actionst to the edit menu
* chore: adding preferences to the file role
* chore: redoing help roles based on the question mark widget
* fix: auto fmt
* chore: examples of accelerator strings for Menu.MenuItems keyboard shortcuts!
* chore: oddly specific toggle API for disabling MenuItems from JS. No rules!
* fix: do not implement a custom label disable thingy, use id on menu and use the native APIga
* fix: auto fmt
* fix: adding some typechecks and auto fmt fixes
* fix: trying to fix custom type?
* fix: nvm we back, the lsp on my editor borked for a second
* fix: adding one more level to the custom type for the labels
* chore: cleaning up type definitions to read easier
* fix: resolving yarn lint errors
* chore: adding file sign out
* chore: adding more file bar actions
* chore: ready for PR draft
* fix: preemptive GC collectoin bug fix if somehow a user interacts with a menu while it is being GCed
* fix: linking the OG source
* fix: set application menu to null to avoid default electron menu
* chore: trying to add more typescript
* chore: BIG workflow changes... better typing, less IPC junk
* fix: remapping the icp functions to the cb option select...
* chore: all og events are rehooked up with new workflow pattern
* feat: adding more options to the native bar!
* fix: todo
* chore: cleaning up some menus and adding more
* fix: desktop vs browser and lint errors
* fix: typescript did not like sample electorn JS code for the basic templates with isMac conditionals...
* fix: PR clean up
* fix: more PR cleanup
* A snapshot a day keeps the bugs away! 📷🐛
* fix: added the new help menu to the default sign in and modeling page
* fix: disabled two menu actions within sign in page since they will not do anything.
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* fix: mergining main, auto fixes
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* fix: saving off progress found an IPC on/off bug thanks electron!
* fix: fixed ipc renderer off/remove listener bug
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* chore: skeleton layout for the file menu in the modeling page.
* fix: adding types
* A snapshot a day keeps the bugs away! 📷🐛
* fix: more skeleton
* feat: adding file preferences project settings
* feat: adding share current part link to file menu
* fix: report a bug to refresha and report a bug
* fix: new type for webContents send payload that does not brick TS
* fix: removing import file from url since it is not working in the command palette for manual user input
* fix: removing old comment
* chore: adding user default units
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* fix: trying to create a new file but I don't think this the correct workflow...
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* fix: disabling create a file and folder until we get it properly implemented at the commad bar level
* fix: hooking up more commands
* fix: auto fixes
* chore: adding standard views
* chore: adding some E2E tests.
* chore: added E2E tests for each file menu
* fix: auto fixes
* chore: adding more edit role E2E tests
* chore: e2e test
* chore: adding help role e2e test
* A snapshot a day keeps the bugs away! 📷🐛
* chore: e2e test for all the menu options you can interact with in the frontend
* chore: hooking up more menu actions
* chore: adding pane actions
* fix: mac only menu fix and added start sketch
* chore: big edit for state management and command registration
* fix: auto fixes, tsc
* fix: codespell typo
* chore: implementing E2E tests for the menus since we cleared them.
* chore: file export current part e2e test
* chore: added all file role tests in modeling page
* chore: modeling page edit e2e tests
* chore: implemented view e2e test for modeling page
* chore: add all design e2e playright tests
* fix: auto linter,fmt
* chore: added modeling help role e2e tests
* fix: ugh this function isn't available in electron evalulate
* fix: new default project name
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* WIP: Change the name of the app
Fixes#5971
* Force release build
* More renames
* Fix release builds on PR
* Remove alpha on home page, replace with nightly if nightly
* Change appId back to dev.zoo.modeling-app after updater test failure
* Cleanup towards review
* Lint
* Lint plus @jacebrowning's suggestion
* Lint
* Rename operations to be more generic grouping
* Add group enum
* Add module instance groups
* Change to export all operation ts-rs types to the same file
* Fix Feature Tree display of modules to use name
* Ignore clippy warning
* Update output after operation changes
* Change module instances in Feature Tree use to import icon
* Fix error message when attempting to delete module instance
* Change default project name to 'untitled'
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* A snapshot a day keeps the bugs away! 📷🐛
* Clean up
* More renaming
* Fix test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Remove trivial floating promise in authMachine
* Add catch statement so LSP promise is considered non-floating
* Remove trivial float in AllSettingsFields
* Add error reporting for ensureWasmInit
* Remove pointless floating promise in Modeling
* Add comment and reportRejection to floating promise in "set selection"
* Read comment, put back await that should be there
* Fix dumb imports rebase botch
* Missed an import
---------
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* fix sketch mode scale issue
* fmt
* Fix snapshot tests in kurt-5621-scale-issue (#6111)
* Change test function to share units with settings (#6114)
* Change test function to share units with settings
* Consolidate to the same module
---------
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* Map dependencies between Windows scripts
* Skip unix-specific command on Windows
* Handle missing directory
* Explicitly run with PowerShell
This makes the scripts with work CMD out-of-the-box.
* Update main.kcl
Finally making this bracket smarter
correcting fillet issues
single body w/ SSI extruded cuts
it even works as a sendcutsend upload now
* Update kcl-samples simulation test output
* Update main.kcl
descriptive variable names
* Update kcl-samples simulation test output
* Update main.kcl
spelling corrections
* Update kcl-samples simulation test output
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Josh Gomez <114548659+jgomez720@users.noreply.github.com>
2025-04-01 11:28:09 -07:00
1678 changed files with 6059583 additions and 262177 deletions
const message = '`src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
const message = '`public/kcl-samples/bracket/main.kcl` or `src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=readme-ov-#installation).
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
```
fnm install --corepack-enabled
fnm use
```
Install the NPM dependencies with:
```
npm install
```
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
```
# macOS/Linux
npm run install:rust
npm run install:wasm-pack:sh
# Windows
npm run install:rust:windows
npm run install:wasm-pack:cargo
```
Then to build the WASM layer, run:
```
# macOS/Linux
npm run build:wasm
# Windows
npm run build:wasm:windows
```
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `npm run install:tools:windows`.
```
# macOS/Linux
npm run fetch:wasm
# Windows
npm run fetch:wasm:windows
```
That will build the WASM binary and put in the `public` dir (though gitignored).
Finally, to run the web app only, run:
```
npm start
```
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
### Development environment variables
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `dev.zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
### Developing in Chrome
Chrome is in the process of rolling out a new default which
If you're having trouble logging into the `modeling-app`, you may need to
enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies".
## Desktop
To spin up the desktop app, `npm install` and `npm run build:wasm` need to have been done before hand then:
```
npm run tron:start
```
This will start the application and hot-reload on changes.
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
To package the app for your platform with electron-builder, run `npm run tronb:package:dev` (or `npm run tronb:package:prod` to point to the .env.production variables).
## Checking out commits / Bisecting
Which commands from setup are one off vs. need to be run every time?
The following will need to be run when checking out a new commit and guarantees the build is not stale:
```bash
npm install
npm run build:wasm
npm start # or npm run build:local && npm run serve for slower but more production-like build
```
## Before submitting a PR
Before you submit a contribution PR to this repo, please ensure that:
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
- You have separated out refactoring commits from feature commits as much as possible
- You have run all of the following commands locally:
-`npm run fmt`
-`npm run tsc`
-`npm run test`
- Here they are all together: `npm run fmt && npm run tsc && npm run test`
## Release a new version
#### 1. Create a 'Cut release $VERSION' issue
It will be used to document changelog discussions and release testing.
Create a new tag and push it to the repo. The `semantic-release.sh` script will automatically bump the minor part, which we use the most. For instance going from `v0.27.0` to `v0.28.0`.
```
VERSION=$(./scripts/semantic-release.sh)
git tag $VERSION
git push origin --tags
```
This will trigger the `build-apps` workflow, set the version, build & sign the apps, and generate release files as well as updater-test artifacts.
The workflow should be listed right away [in this list](https://github.com/KittyCAD/modeling-app/actions/workflows/build-apps.yml?query=event%3Apush)).
#### 3. Manually test artifacts
##### Release builds
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in 2.).
Manually test against this [list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
##### Updater-test builds
The other `build-apps` output in the release `build-apps` workflow (triggered by 2.) is `updater-test-{arch}-{platform}`. It's a semi-automated process: for macOS, Windows, and Linux, download the corresponding updater-test artifact file, install the app, run it, expect an updater prompt to a dummy v0.255.255, install it and check that the app comes back at that version.
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
#### 5. Close the issue
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
You will need a `./e2e/playwright/playwright-secrets.env` file:
```bash
$ touch ./e2e/playwright/playwright-secrets.env
$ cat ./e2e/playwright/playwright-secrets.env
token=<dev.zoo.dev/account/api-tokens>
snapshottoken=<zoo.dev/account/api-tokens>
```
or use `export` to set the environment variables `token` and `snapshottoken`.
#### Snapshot tests (Google Chrome on Ubuntu only)
Only Ubunu and Google Chrome is supported for the set of tests evaluating screenshot snapshots.
If you don't run Ubuntu locally or in a VM, you may use a GitHub Codespace.
```
npm run playwright -- install chrome
npm run test:snapshots
```
You may use `-- --update-snapshots` as needed.
#### Electron flow tests (Chromium on Ubuntu, macOS, Windows)
```
npm run playwright -- install chromium
npm run test:playwright:electron:local
```
You may use `-- -g "my test"` to match specific test titles, or `-- path/to/file.spec.ts` for a test file.
#### Debugger
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
If you want to limit to a single browser use `--project="webkit"` or `firefox`, `Google Chrome`
Or comment out browsers in `playwright.config.ts`.
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `npm run playwright codegen -b wk --load-storage ./store localhost:3000`
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
### Unit and component tests
If you already haven't, run the following:
```
npm
npm run build:wasm
npm start
```
and finally:
```
npm run test:unit
```
For individual testing:
```
npm run test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
### Rust tests
**Dependencies**
-`KITTYCAD_API_TOKEN`
-`cargo-nextest`
-`just`
#### Setting KITTYCAD_API_TOKEN
Use the production zoo.dev token, set this environment variable before running the tests
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
# Make sure you installed just
cd rust
just test
```
```bash
# Without just
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
cd rust
exportRUST_BRACKTRACE="full"&& cargo nextest run --workspace --test-threads=1
```
Where `XXX` is an API token from the production engine (NOT the dev environment).
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
```
cd rust
KITTYCAD_API_TOKEN=XXX cargo run nextest
```
### Mapping CI CD jobs to local commands
When you see the CI CD fail on jobs you may wonder three things
- Do I have a bug in my code?
- Is the test flaky?
- Is there a bug in `main`?
To answer these questions the following commands will give you confidence to locate the issue.
#### Static Analysis
Part of the CI CD pipeline performs static analysis on the code. Use the following commands to mimic the CI CD jobs.
The following set of commands should get us closer to one and done commands to instantly retest issues.
```
npm run test-setup
```
> Gotcha, are packages up to date and is the wasm built?
```
npm run tsc
npm run fmt:check
npm run lint
npm run test:unit:local
```
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
#### E2E Tests
**Playwright Electron**
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
```
npm run test:playwright:electron:local
npm run test:playwright:electron:windows:local
npm run test:playwright:electron:macos:local
npm run test:playwright:electron:ubuntu:local
```
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
#### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.
How to interpret failing playwright tests?
If your tests fail, click through to the action and see that the tests failed on a line that includes `await page.getByTestId('loading').waitFor({ state: 'detached' })`, this means the test fail because the stream never started. It's you choice if you want to re-run the test, or ignore the failure.
We run on ubuntu and macos, because safari doesn't work on linux because of the dreaded "no RTCPeerConnection variable" error. But linux runs first and then macos for the same reason that we limit the number of parallel tests to 1 because we limit stream connections per user, so tests would start failing we if let them run together.
If something fails on CI you can download the artifact, unzip it and then open `playwright-report/data/<UUID>.zip` with https://trace.playwright.dev/ to see what happened.
#### Getting started writing a playwright test in our app
Besides following the instructions above and using the playwright docs, our app is weird because of the whole stream thing, which means our testing is weird. Because we've just figured out this stuff and therefore docs might go stale quick here's a 15min vid/tutorial
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.
To enable memory metrics, build with `--features dhat-heap`.
Compared to other CAD software, getting Zoo Modeling App up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
Compared to other CAD software, getting Zoo Design Studio up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
## Windows
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
2. Once downloaded, run the installer `Zoo Modeling App-{version}-{arch}-win.exe` which should take a few seconds.
2. Once downloaded, run the installer `Zoo Design Studio-{version}-{arch}-win.exe` which should take a few seconds.
3. The installation happens at `C:\Program Files\Zoo Modeling App`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
3. The installation happens at `C:\Program Files\Zoo Design Studio`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
## macOS
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
2. Once downloaded, open the disk image `Zoo Modeling App-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
2. Once downloaded, open the disk image `Zoo Design Studio-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
3. You can then open your `Applications` directory and double-click on `Zoo Modeling App` to open.
3. You can then open your `Applications` directory and double-click on `Zoo Design Studio` to open.
## Linux
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
2. Install the dependencies needed to run the [AppImage format](https://appimage.org/).
- On Ubuntu, install the FUSE library with these commands in a terminal.
@ -30,7 +30,7 @@ Compared to other CAD software, getting Zoo Modeling App up and running is quick
sudo apt install libfuse2
```
- Optionally, follow [these steps](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md#initial-setup) to install `appimaged`. It is a daemon that makes interacting with AppImage files more seamless.
- Once installed, copy the downloaded `Zoo Modeling App-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
- Once installed, copy the downloaded `Zoo Design Studio-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
- `appimaged` should automatically find it and make it executable. If not, run:
A CAD application from the future, brought to you by the [Zoo team](https://zoo.dev).
Modeling App is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
Design Studio is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
- All artifacts—including parts and assemblies—should be represented as human-readable code. At the end of the day, your CAD project should be "plain text"
- This makes version control—which is a solved problem in software engineering—trivial for CAD
- All GUI (or point-and-click) interactions should be actions performed on this code representation under the hood
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Modeling App
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Design Studio
- Everything graphics _has_ to be built for the GPU
- Most CAD applications have had to retrofit support for GPUs, but our geometry engine is made for GPUs (primarily Nvidia's Vulkan), getting the order of magnitude rendering performance boost with it
- Make the resource-intensive pieces of an application auto-scaling
@ -19,11 +19,11 @@ Modeling App is our take on what a modern modelling experience can be. It is app
We are excited about what a small team of people could build in a short time with our API. We welcome you to try our API, build your own applications, or contribute to ours!
Modeling App is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
Design Studio is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
The 3D view in Modeling App is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
The 3D view in Design Studio is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
## Tools
## Technology
- UI
- [React](https://react.dev/)
@ -38,471 +38,16 @@ The 3D view in Modeling App is just a video stream from our hosted geometry engi
We recommend downloading the latest application binary from our [releases](https://github.com/KittyCAD/modeling-app/releases) page. If you don't see your platform or architecture supported there, please file an issue.
## Get started
If you'd like to try out upcoming changes sooner, you can also download those from our [nightly releases](https://zoo.dev/modeling-app/download/nightly) page.
We recommend downloading the latest application binary from [our Releases page](https://github.com/KittyCAD/modeling-app/releases). If you don't see your platform or architecture supported there, please file an issue.
## Developing
## Running a development build
Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=readme-ov-#installation).
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
```
fnm install --corepack-enabled
fnm use
```
Install the NPM dependencies with:
```
yarn install
```
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
```
# macOS/Linux
yarn install:rust
yarn install:wasm-pack:sh
# Windows
yarn install:rust:windows
yarn install:wasm-pack:cargo
```
Then to build the WASM layer, run:
```
# macOS/Linux
yarn build:wasm
# Windows
yarn build:wasm:windows
```
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `yarn install:tools:windows`.
```
# macOS/Linux
yarn fetch:wasm
# Windows
yarn fetch:wasm:windows
```
That will build the WASM binary and put in the `public` dir (though gitignored).
Finally, to run the web app only, run:
```
yarn start
```
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
### Development environment variables
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `dev.zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
### Developing in Chrome
Chrome is in the process of rolling out a new default which
If you're having trouble logging into the `modeling-app`, you may need to
enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies".
## Desktop
To spin up the desktop app, `yarn install` and `yarn build:wasm` need to have been done before hand then:
```
yarn tron:start
```
This will start the application and hot-reload on changes.
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
To package the app for your platform with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables).
## Checking out commits / Bisecting
Which commands from setup are one off vs. need to be run every time?
The following will need to be run when checking out a new commit and guarantees the build is not stale:
```bash
yarn install
yarn build:wasm
yarn start # or yarn build:local && yarn serve for slower but more production-like build
```
## Before submitting a PR
Before you submit a contribution PR to this repo, please ensure that:
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
- You have separated out refactoring commits from feature commits as much as possible
- You have run all of the following commands locally:
-`yarn fmt`
-`yarn tsc`
-`yarn test`
- Here they are all together: `yarn fmt && yarn tsc && yarn test`
## Release a new version
#### 1. Create a 'Cut release $VERSION' issue
It will be used to document changelog discussions and release testing.
Create a new tag and push it to the repo. The `semantic-release.sh` script will automatically bump the minor part, which we use the most. For instance going from `v0.27.0` to `v0.28.0`.
```
VERSION=$(./scripts/semantic-release.sh)
git tag $VERSION
git push origin --tags
```
This will trigger the `build-apps` workflow, set the version, build & sign the apps, and generate release files as well as updater-test artifacts.
The workflow should be listed right away [in this list](https://github.com/KittyCAD/modeling-app/actions/workflows/build-apps.yml?query=event%3Apush)).
#### 3. Manually test artifacts
##### Release builds
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in 2.).
Manually test against this [list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
##### Updater-test builds
The other `build-apps` output in the release `build-apps` workflow (triggered by 2.) is `updater-test-{arch}-{platform}`. It's a semi-automated process: for macOS, Windows, and Linux, download the corresponding updater-test artifact file, install the app, run it, expect an updater prompt to a dummy v0.255.255, install it and check that the app comes back at that version.
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
#### 5. Close the issue
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
You will need a `./e2e/playwright/playwright-secrets.env` file:
```bash
$ touch ./e2e/playwright/playwright-secrets.env
$ cat ./e2e/playwright/playwright-secrets.env
token=<dev.zoo.dev/account/api-tokens>
snapshottoken=<your-snapshot-token>
```
For a portable way to run Playwright you'll need Docker.
#### Generic example
After that, open a terminal and run:
```bash
docker run --network host --rm --init -it playwright/chrome:playwright-x.xx.x
```
and in another terminal, run:
```bash
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
```
#### Specific example
open a terminal and run:
```bash
docker run --network host --rm --init -it playwright/chrome:playwright-1.46.0
```
and in another terminal, run:
```bash
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" e2e/playwright/command-bar-tests.spec.ts
```
run a specific test change the test from `test('...` to `test.only('...`
(note if you commit this, the tests will instantly fail without running any of the tests)
**Gotcha**: running the docker container with a mismatched image against your `./node_modules/playwright` will cause a failure. Make sure the versions are matched and up to date.
run headed
```
yarn playwright test --headed
```
run with step through debugger
```
PWDEBUG=1 yarn playwright test
```
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
If you want to limit to a single browser use `--project="webkit"` or `firefox`, `Google Chrome`
Or comment out browsers in `playwright.config.ts`.
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `yarn playwright codegen -b wk --load-storage ./store localhost:3000`
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
### Unit and component tests
If you already haven't, run the following:
```
yarn
yarn build:wasm
yarn start
```
and finally:
```
yarn test:unit
```
For individual testing:
```
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
### Rust tests
**Dependencies**
-`KITTYCAD_API_TOKEN`
-`cargo-nextest`
-`just`
#### Setting KITTYCAD_API_TOKEN
Use the production zoo.dev token, set this environment variable before running the tests
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
# Make sure you installed just
cd rust
just test
```
```bash
# Without just
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
cd rust
exportRUST_BRACKTRACE="full"&& cargo nextest run --workspace --test-threads=1
```
Where `XXX` is an API token from the production engine (NOT the dev environment).
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
```
cd rust
KITTYCAD_API_TOKEN=XXX cargo run nextest
```
### Mapping CI CD jobs to local commands
When you see the CI CD fail on jobs you may wonder three things
- Do I have a bug in my code?
- Is the test flaky?
- Is there a bug in `main`?
To answer these questions the following commands will give you confidence to locate the issue.
#### Static Analysis
Part of the CI CD pipeline performs static analysis on the code. Use the following commands to mimic the CI CD jobs.
The following set of commands should get us closer to one and done commands to instantly retest issues.
```
yarn test-setup
```
> Gotcha, are packages up to date and is the wasm built?
```
yarn tsc
yarn fmt-check
yarn lint
yarn test:unit:local
```
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
#### E2E Tests
**Playwright Electron**
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
```
yarn test:playwright:electron:local
yarn test:playwright:electron:windows:local
yarn test:playwright:electron:macos:local
yarn test:playwright:electron:ubuntu:local
```
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
#### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.
How to interpret failing playwright tests?
If your tests fail, click through to the action and see that the tests failed on a line that includes `await page.getByTestId('loading').waitFor({ state: 'detached' })`, this means the test fail because the stream never started. It's you choice if you want to re-run the test, or ignore the failure.
We run on ubuntu and macos, because safari doesn't work on linux because of the dreaded "no RTCPeerConnection variable" error. But linux runs first and then macos for the same reason that we limit the number of parallel tests to 1 because we limit stream connections per user, so tests would start failing we if let them run together.
If something fails on CI you can download the artifact, unzip it and then open `playwright-report/data/<UUID>.zip` with https://trace.playwright.dev/ to see what happened.
#### Getting started writing a playwright test in our app
Besides following the instructions above and using the playwright docs, our app is weird because of the whole stream thing, which means our testing is weird. Because we've just figured out this stuff and therefore docs might go stale quick here's a 15min vid/tutorial
Finally, if you'd like to run a development build or contribute to the project, please visit our [contributor guide](CONTRIBUTING.md) to get started.
## KCL
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib).
### Logging
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.
To enable memory metrics, build with `--features dhat-heap`.
To contribute to the KittyCAD Language, see the [README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib) for KCL.
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | Which sketch should this path be added to? | Yes |
| `angle` | [`number`](/docs/kcl/types/number) | Which angle should the line be drawn at? | Yes |
| `length` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `lengthX` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `lengthY` | [`number`](/docs/kcl/types/number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteX` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteY` | [`number`](/docs/kcl/types/number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this line | No |
@ -10,8 +10,10 @@ Draw an angled line from the current origin, constructing a line segment such th
```js
angledLineThatIntersects(
data:AngledLineThatIntersectsData,
sketch:Sketch,
angle:number,
intersectTag:TagIdentifier,
offset?:number,
tag?:TagDeclarator,
):Sketch
```
@ -21,9 +23,11 @@ angledLineThatIntersects(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`AngledLineThatIntersectsData`](/docs/kcl/types/AngledLineThatIntersectsData) | Data for drawing an angled line that intersects with a given line. | Yes |
excerpt: "Documentation of modules for the KCL language for the Zoo Modeling App."
excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio."
layout: manual
---
@ -95,7 +95,7 @@ import "tests/inputs/cube.obj"
When importing a GLTF file, the bin file will be imported as well.
Import paths are relative to the current project directory. Imports currently only work when
using the native Modeling App, not in the browser.
using the native Design Studio, not in the browser.
### Supported values
@ -109,3 +109,98 @@ Coordinate systems:
-`zoo` (the default), forward: -Y, up: +Z, handedness: right
-`opengl`, forward: +Z, up: +Y, handedness: right
-`vulkan`, forward: +Z, up: -Y, handedness: left
### Performance
Parallelized foreign-file imports now let you overlap file reads, initialization,
and rendering. To maximize throughput, you need to understand the three distinct
stages—reading, initializing (background render start), and invocation (blocking)
—and structure your code to defer blocking operations until the end.
#### Foreign Import Execution Stages
1.**Import (Read) Stage**
```norun
import "tests/inputs/cube.step" as cube
```
- Reads the file from disk and makes its API available.
- **Does _not_** start Engine rendering or block your script.
2. **Initialization (Background Render) Stage**
```norun
import "tests/inputs/cube.step" as cube
myCube = cube // <- This line starts background rendering
```
- Invoking the imported symbol (assignment or plain call) triggers Engine rendering _in the background_.
- This kick‑starts the render pipeline but doesn’t block—you can continue other work while the Engine processes the model.
3. **Invocation (Blocking) Stage**
```norun
import "tests/inputs/cube.step" as cube
myCube = cube
myCube
|> translate(z=10) // <- This line blocks
```
- Any method call (e.g., `translate`, `scale`, `rotate`) waits for the background render to finish before applying transformations.
- This is the only point where your script will block.
> **Nuance:** Foreign imports differ from pure KCL modules—calling the same import symbol multiple times (e.g., `screw` twice) starts background rendering twice.
#### Best Practices
##### 1. Defer Blocking Calls
Initialize early but delay all transformations until after your heavy computation:
```norun
import "tests/inputs/cube.step" as cube // 1) Read
myCube = cube // 2) Background render starts
// --- perform other operations and calculations or setup here ---
myCube
|> translate(z=10) // 3) Blocks only here
```
##### 2. Encapsulate Imports in Modules
Keep `main.kcl` free of reads and initialization; wrap them:
```norun
// imports.kcl
import "tests/inputs/cube.step" as cube // Read only
export myCube = cube // Kick off rendering
```
```norun
// main.kcl
import myCube from "imports.kcl" // Import the initialized object
Both calling methods right on `cube` immediately or leaving an implicit import without assignment introduce blocking.
#### Future Improvements
Upcoming releases will auto‑analyze dependencies and only block when truly necessary. Until then, explicit deferral and modular wrapping give you the best performance.
@ -10,9 +10,11 @@ Create a regular polygon with the specified number of sides that is either inscr
```js
polygon(
data:PolygonData,
sketchSurfaceOrGroup:SketchOrSurface,
tag?:TagDeclarator,
radius:number,
numSides:u64,
center:[number],
inscribed?:bool,
):Sketch
```
@ -21,9 +23,11 @@ polygon(
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`PolygonData`](/docs/kcl/types/PolygonData) | Data for drawing a polygon | Yes |
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on | Yes |
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the polygon | Yes |
| `numSides` | `u64` | The number of sides in the polygon | Yes |
| `center` | [`[number]`](/docs/kcl/types/number) | The center point of the polygon | Yes |
| `inscribed` | [`bool`](/docs/kcl/types/bool) | Whether the polygon is inscribed (true, the default) or circumscribed (false) about a circle with the specified radius | No |
### Returns
@ -35,12 +39,12 @@ polygon(
```js
// Create a regular hexagon inscribed in a circle of radius 10
hex=startSketchOn(XY)
|>polygon({
|>polygon(
radius=10,
numSides=6,
center=[0,0],
inscribed=true
},%)
inscribed=true,
)
example=extrude(hex,length=5)
```
@ -50,12 +54,12 @@ example = extrude(hex, length = 5)
```js
// Create a square circumscribed around a circle of radius 5
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.