* Add a setting for showScaleGrid
* Fix up setting persistence, move under modeling
* Make the setting actually do something
* the lamest fmt I've seen in a while
* Fix clippy warnings
* Add snapshot tests for grid (first time using Playwright masks)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Re-run CI after new screenshots added
---------
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Rework zooming
* Adjust sketch mode zoom
* Do not retry failures
* typo
* use sha as file upload id
* again
* again
* again
* again
* Fix camera moving too
* Use virtual fps instead of buffering for mouse
---------
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* Add coredump to refresh button - this one indicates that there should be something like a core dump that is triggered.
* Added lower right control bug report button - included custom toasts for bug reporting, supports fallback bug reporting when app cannot generate a core dump
* Do not show more than one error toast at a time
* use sha as file upload id
* again
* again
* again
* again
* fmt
* Hopefully fix flakiness
* move to macos-14-large
---------
Co-authored-by: Paul Tagliamonte <paul@zoo.dev>
Co-authored-by: Paul R. Tagliamonte <paul@kittycad.io>
When I originally wrote the walk stuff, I wanted to be able to stop a
traversal by returning false. That didn't get implemented in the first
rev, so this will actually build that out so returning false will stop
the walk.
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* start to gut and seperate the kcl lint from execute
* fix type signature
* re-add old codepath when not wasm
* also lint in the mock
* fix syntax
* fix message
Previously these functions could not be used with `#[stdlib]` proc-macro:
```rust
fn someFn(data: &'a str) {}
fn someFn<'a>(data: Foo<'a>) {}
```
But now they can.
* Add command configs for sketch tools
* Update Constrain dropdown to be noun
* Update Cargo.lock
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Update E2E test references to "Constraints" button
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Start of basic test (not yet failing)
* Add a little logging to get the lay of the scene object land
* Move test colors to utility, test broken
* Get accurate test that is only broken with highlighted color behavior
* Working implementation but now initial segment color sticks around too long
* Make sure segment base color is always the theme color
* Remove console logs, refactor a couple lines to use if statements instead of inline booleans
* Fix new test
* Make origin color update like the other segment types
* fmt
* Fix issue where initially-selected segments lose highlight after hover
* Undo this tweaking of the selection logic, this is really only about the clientSideEntities
* Remove unused exports
* Remove unnecessary code change from ModelingMachineProvider
* Remove newline
* Update src/clientSideScene/sceneEntities.ts
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* allow for editing a sketch where extrude or revolve is in the same pipe
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* update tests
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* add playwright test for extrude
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* add test for revolve
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* remove log
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* update out of bounds
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* more
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* be in charge of own fate for code mirror versions
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* Revert "be in charge of own fate for code mirror versions"
This reverts commit 796ecfdd8f.
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* Make sure we always reset the code on important steps no matter what the user did to it
* Convert comments in codeManager to JSDoc comments so they appear in diagnostics
* Was using the wrong codeManager callback
* Make sure editorView is available before resetting code
* Add Playwright test that shows the code being reset
* Fix up text that looks like linksÏ
* fmt
* Skip test on MacOS, make test more reliable on Chrome
* Update cargo-clippy to run based on paths on PRs as well
* playw fix
* try keep reports
* add fix me
* try one last thing
* fmt
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
Clear the AST if there was a parse error.
This leads to an unfortunate loop (good -> invalid -> original) that
wouldn't clear the diagnostics from the invalid step.
Adds a new library, the kcl-test-server. It lets you easily start a HTTP server with one endpoint, which accepts JSON. The JSON body contains a KCL program and a test name. The server has a pool of active engine sessions, and when it gets a KCL program, it executes it on one of those engine sessions.
This addresses part of #2580 but currently the sketch-on-face tests don't pass with this new test server yet.
This is a library, not a binary, because I want to use it in both the wasm-lib unit tests and in the zoo CLI.
* WIP: Break the tauri e2e tests apart
Will fix#2658
* Clean up
* Longer before timeout
* Also exclude tauri tests from vitest
* Utils fn back in app.spec.ts
* Remove utils
* Change before back to it
* Remove explicit mocha dep
* Revert other attemps at fixing the browser issues. mocha dep was the issue
* Clean up
* Signin/out sep with auth flows
* Lint
---------
Co-authored-by: Frank Noirot <frank@zoo.dev>
* Remove tab hotkey from selection input
* Add dismiss button to the command bar
* update Cargo.lock
* tweak close button styles
* Switch from padding to margin for positioning without messing up focus outline
* Revert "update Cargo.lock"
This reverts commit 862a6897ba.
* Restore Cargo.lock I hate VSCode sometimes
* Update Cargo.lock in src-tauri, fix clippy
---------
Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
Sometimes the `src-tauri/` project gets out of date Cargo.lock. This
adds a CI check to prevent it.
This can happen because `src-tauri` is a separate Cargo project from
`src/wasm-lib`, but the former includes the latter as a dependency. So,
when wasm-lib updates a dep (e.g. bump databake from 1.7 to 1.8), the
former will, upon recompilation, pull in the newer databake dep. But
programmers in the wasm-lib repo don't usually work in the src-tauri repo
and so the src-tauri repo doesn't get updated.
* Add in a prototype KCL linter
This is a fork-and-replce of an experimental project I hacked up called
"kcl-vet", which was mostly the same code. This integrates kcl-vet into
the kcl_lib crate, which will let us use this from the zoo cli, as well
as via wasm in the lsp. this contains the intial integration with the
lsp, adding all lints as informational to start.
I need to go back and clean some of this up (and merge some of this back
into other parts of kcl_lib); but this has some pretty good progress
already.
Co-authored-by: jess@zoo.dev
Signed-off-by: Paul R. Tagliamonte <paul@zoo.dev>
* ty clippy :)
* add in a lint test
* add in some docstrings
* whoops
* sigh
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* uno reverse card
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* wtf stop it robot fuck
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)"
This reverts commit 5b18f3c035.
* hurm
* try harder to type slower
* try harder? this all passes locally.
* try this now
* simplify, add debugging for trace
* fix enter use
* re-order again
* reorder a bit more
* enter
* ok fine no other enters?
* nerd
* wip
* move control of clearing to typescript
* move result out
* err check
* remove log
* remove clear
* remove add to diag
* THERE CAN BE ONLY ONE
* _err
* dedupe
* Revert "dedupe"
This reverts commit f66de88200.
* attempt to dedupe
* clear diagnostics on mock execute, too
* handle dupe diagnostics
* fmt
* dedupe tsc
* == vs ===
* fix dedupe
* return this to the wasm for now
* clear the map every go around
this is different than the old code isnce it won't republish
---------
Signed-off-by: Paul R. Tagliamonte <paul@zoo.dev>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* add bug icon, swap out refresh icon
* remove lame theme color outline from tooltips
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Basic context menu components
* Working context menu!
* Show keyboard shortcuts in file tree context menu
* Add context menu to Gizmo
* Little polish on components
* Add a test for the gizmo, firm up other gizmo tests
* Updated Cargo lock
* Updated Cargo.lock
* Remove zoom throttling
And use the mouse zoom for sketch mode
* test tweaks
* test tweak
---------
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
* Remove debug logging from Engine Connection
Left console.log('connectionstatechange: ' + event.target?.connectionState) intentionally
* Bring that beat back
@lf94 request that we keep this one and also make sure it's in coredump.
* gizmo 2.0
nice and clickable
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* initial mouse position fix
when the scene first loads, mouse position is 0,0, which renders the gizmo selected.
* animation loop / disposal optimization
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* reset camera tweak
* add cam target to debug panel
* test stub
* reset camera position handle removed from gizmo
it is now a button in the debug panel
* gizmo refactoring
* small fix
* reset camera view
bug fix
* nicer updateCameraToAxis
now gizmo rotates around the target instead of world 0,0,0
* micro refactoring
* playwright update
* playwright remove timeout + fmt
* hide gizmo while loading stream
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)"
This reverts commit f0a506d6b9.
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)"
This reverts commit 2781261331.
* try make gizmo test more realiable
* tweak
* refactoring
* increase timeout time
* 1 sec wait after mouse click
* 3 sec timeout
* better clickPosition
* test with 10 sec timeout
* 0.5 sec timeout
* add passive update for gizmo to avoid some edge cases
* default_camera_get_settings after click
* try and remove timeouts
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
* Make sketch and extrude produce separate top-level constants
* Fix most tests
* Add a breaking test for sketch on face AST mod
* Use `extrude` instead of `part`
* Implement @Irev-Dev's branch changes from https://github.com/KittyCAD/modeling-app/pull/2472
* Get extrude on face working
* Update incorrect sketch on face test
* Update unit tests
* Fix up E2E test changes
* fmt
* Fix a couple of goofed up test updates
* More specific names for paths to node sent to modelingMachine
* Bump down playwright workers for now
* Slightly more explicit type coercion
* Update snapshot tests
* Missed one other new flow test that wasn't updated to use "sketch001"
* Typo
* Damn missed one more sorry
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Re-run CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* I think the multiple sketches test reverted from under me
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add keyboard custom icon
* Refactor Settings to be more modular
* Add basic keybindings view to settings
* Add more shortcuts
* Add link to see keyboard shortcuts tab
* Little more bottom padding
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add keybindings to settings search
* Add a playwright test for opening the the keyboard shortcuts
* fmt
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Reapply "Add ping pong health, remove a timeout interval, fix up netwo… (#1771)
This reverts commit 1913519f68.
* Fix build errors
* Add new error states to network status notification
* Remove unused variable
* Refactor to use Context API for network status
* Don't do any stream events if network is not ok
* Catch LSP errors on bad auth
* Show when authentication is bad (cookie header only)
* Fix formatting
* Fix up types
* Revert awaiting on lsp failure
* Fix tsc
* wip
* wip
* fmt
* Fix typing
* Incorporate ping health; yarn make:dev; faster video stream loss notice
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* run ci pls
* run ci pls
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* run ci pls again
* Remove unused variables
* Add new instructions on running Playwright anywhere
* Please the Playwright. Praise the Playwright.
* Correct a vitest
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* ci again
* Fix tests unrelated to this PR
* Fix flakiness in for segments tests
* Bump to 2 workers
* fmt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* fmt
* fmt
* Fixups
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* ci
* Set workers to 1
* Wait for network status listeners before connecting
* Fix initial connection requirements and trying 2 workers again
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Update rectangle code gen to use profileStart to close shape
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Re-run CI
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* WIP: Get existing tauri e2e tests to work on Windows
Will fix#2393
* Enable windows stage (will fail)
* WIP msedge version sync
* Move setup edge before build
* Manual debug build (no action)
* Specify v119 for npm package
* Fixes on auth test
* Working test on win10
* Clean up
* Disable yarn cache to help debug the mismatch issue
* Revert "Disable yarn cache to help debug the mismatch issue"
This reverts commit e6abc7db42.
* Explicit webviewOptions and remove tauri driver fork
* Double \\ workaround for windows
* Clean up
* Clean up and readme
* Quick fix
* Lint
* Clippy fix
* Back to tauri-action and disable windows CI tests for early merge
* Back to 10sec delay
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Timer reset
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Trigger CI
* Back to 1 pw worker
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* migrate one constraint
* typo
* update snap to y, snap to x, horz align, vert align, equal length
* add some e2e tests
* add e2e test for snap to axis contsraits
* remove works for now
* Add loading and success toasts to export engine command
* Move doExport out to a test utility, test visibility of loading spinner
* Add playwright test for export success toast
* Update Cargo.lock
* Remove loading assertion, it flashes too quickly for Playwright to pick up
* Navigate between files with single-click
* Better semantic name for optional event passed into FileTree
* Bug fix: reset modeling state when navigating to a new file
* Add more context to E2E test TODO comment
* Newly-created file tree items are immediately set to renaming mode
* Bug fix: redirect to working file if you delete your current one
* Remove ContextMenu, unrelated branch
* Turn off autocorrect in renaming form
* Gracefully handle renaming a folder that our current file is inside of
* Update cargo.lock
* Fix renaming queue
* Navigate to newly-created files
* Make delete project and delete file/folder share deletion confirmation component
* Bug fix: navigate to project root if we delete our current file's parent directory
* Don't navigate to newly-created directories
* remove semver from snapshots
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* trigger ci
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* start of overlay work
* add new icons
* add constraint symbols
* add three dots
* add primary colours
* refactor how we get constraint info for overlays
* refactor how we get constraint info for overlays
* get symbols working for tangential arc too
* extra data on constraint info
* add initial delete
* fix types and circular dep issue after rebase
* fix quirk with horz vert line overlays
* fix setup and tear down of overlays
* remove overlays that are too small
* throttle overlay updates and prove tests selecting html instead of hardcoded px coords
* initial show overaly on segment hover
* remove overlays when tool is equipped
* dounce overlay updates
* tsc
* make higlighting robust to small changes in source ranges
* replace with variable for unconstrained values, and improve styles for popover
* background tweak
* make overlays unconstrain inputs
* fix small regression
* write query for finding related tag references
* make delete segment safe
* typo
* un used imports
* test deleteSegmentFromPipeExpression
* add getConstraintInfo test
* test removeSingleConstraintInfo
* more tests
* tsc
* add tests for overlay buttons
* rename tests
* fmt
* better naming structure
* more reliablity
* more test tweaks
* fix selection test
* add delete segments with overlays tests
* dependant tag tests for segment delet
* typo
* test clean up
* fix some perf issus
* clean up
* clean up
* make things a little more dry
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* trigger ci
* Make constraint hover popovers readable on light mode
* Touch up the new variable dialog
* Little touch-up to three-dot menu style
* fix highlight issue
* fmt
* use optional chain
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)"
This reverts commit be3d61e4a3.
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* disable var panel in sketch mode
* fix overlay tests after mergi in main
* test tweak
* try fix ubuntu
* fmt
* more test tweaks
* tweak
* tweaks
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Frank Noirot <frank@kittycad.io>
* actually test that we dont exit sketch mode on first escape
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* better test
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* zoom to fit on load
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* lint
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* add zoom to fit calls to the correct places
* update comment
* clean up comment
* add snapshot test zoom to git
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* subscribe to camera updates from zoom to fit
* fix types
* partial test fix
* updatges
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* fix another test
* remove my enhancements
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Check the winnow ParseError before indexing
From the winnow docs at[1]
> The location in ParseError::input where parsing failed
>
> Note: This is an offset, not an index, and may point to the end of input
> (input.len()) on eof errors.
This will bounds check the index before slicing into the `input` vec,
and return an EOF erorr rather than an unknown token error.
[1]: https://docs.rs/winnow/latest/winnow/error/struct.ParseError.html#method.offset
I have a hunch somewhere something is mixing up bytes and chars (more
specifically, a codepoint or grapheme), which is causing bounds to go
past the end of the list since something is talking byte indexes and
the other is dealing with char/codepoint indexes.
For now this is going to fix the crash, but the EOF error may be masking
an actual bad token error in some cases? Our code looks right, so I'm
not quite sure what is going on in the winnow internals here.
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* draft #2279
Add client side gizmo #2279, work in progress
* draft #2279
unreliableSubscriptions
* draft #2279
nice Gizmo
* blue ring
give the canvas a round shape and a border, wrapping rounded div element around the canvas
* Refactor Gizmo Component
Extracted reusable constants
Modularized the code
Simplified the useEffect logic
Added TypeScript type annotations
Improved overall code structure and readability
* remove old gizmo
* fmt
* styling and relocation
Add className "pointer-events-none" to gizmo wrapper div (for now to prevent context menu)
Make LowerRightControls container element have these classNames: flex flex-col items-end gap-3
Move gizmo into LowerRightControls.tsx as the first child of the section element
Remove the fixed styling from the gizmo div so it flows in flexbox
* fmt
* fix camera up problem
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* up tweak
* Revert "up tweak"
This reverts commit a53a0ef240.
* test tweak
* tweak test
---------
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Frank Noirot <frank@kittycad.io>
There are many places in the executor codebase which evaluate an AST expression and produce a KCL memory item. They could be deduplicated and put into one central location.
Fixes <https://github.com/KittyCAD/modeling-app/issues/1931>.
Simplify the fuzzer a bit
This is the same code, but we'll offload the string parsing to the fuzz
lib, and we can inline the `if Ok(v)`
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* Save part images when navigating home
* Load part images in project cards if available
* Polish home page
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Merge branch 'main' into franknoirot/project-images
* Mostly restored link + form functionality
* Working cards with images
* Comment out project image stuff
* Little style tweaks
* Remove unused imports
* More minor styling tweaks
* Merge branch 'main' into franknoirot/project-images
* Was using the wrong imported `Project` type
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Revert any docs changes
* Revert wasm-lib divergences
* Move ProjectCard into its component folder
* Remove unused hook useSaveVideoFrame
* Remove "hideOnLevel" config from theme setting
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* plumbus fixes
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* Simplify the pentagon test
* Fix up triangle png
* Triangle plumbuses now face the camera
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Port forward to ts-rs 8.1
We're just waiting on a release that includes a PR that we sent[1] for this
to use the cargo version. For now we'll have to use the git release.
[1]: c5109a00e4
* Add keyboard shortcuts for sketch and modeling tools
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Add a playwright test
* skip linux
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* fmt fml
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* Give more generous test timeout for worst case engine runs
* Fix up test mouse clicks after zoom bug fixes
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
* make rust function with lots of tests
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* pull thru function to tauri and app
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* one more test;
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* Cut release v0.21.6
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* trigger ci
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* make sure there is at least one kcl file in the dir to show in list
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* open the correct file not assuming main.kcl
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* add file path tests
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* update settings paths
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* new images
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>
Reset inSequence back to 1 every time we connect to the Engine,
otherwise we'll continue to think the current sequence is a high number
(while the engine has no memory of the last session -- and may even be a
new engine instance!) and ignore messages until we pass that counter
again.
Signed-off-by: Paul Tagliamonte <paul@zoo.dev>
* Add stdlib functions for getting sketch profile start and its components
* Fix it up and actually generate snapshots
* cargo fmt
* Use `.to` instead of `.from`
* Update docs with EXPECTORATE=overwrite
* Add README
* fmt
* Update flow test to account for more autocompletion options when typing "start"
---------
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* Disable logo link in browser, clean up menu components' organization
* Include the app name in Tauri as screenreader-only text
* Fix tsc issue in component test
* Add a playwright test to ensure logo is never a link in the browser
* Update broken component tests
* Add some JSDocs comments to types, convert some existing comments.
* Add JSDoc comments to EngineCommandManager
* Add deprecation message to `lastArtifactMap`
* fmt
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Rerun CI
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* sketch dies on exit XY sketch
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* trigger ci
* fix test
* fix test
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Set default extrude distance expression to something more sensible, like 5
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* Rerun CI
* run CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* CI
* Use old 5 + 7 for highlight test it's touchy
* Same with sketch on face it seems to work better with 5 + 7 and that's fine
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Disable all pane resize handles except right
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Ensure onboarding buttons are visible on shorter screens
* Fix dismiss button hover styling
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Move the command bar out to the right in the AppHeader
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* trigger ci
* trigger ci
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Revert "Revert "client side sketch updating properly with direct changes to t… (#2286)"
This reverts commit e7ab645267.
* rejig out side of xstate
* test tweak
* more test tweak
* refactor some codeManager stuff
* tsc
* try and fix tests
* revert small uneeded change
* fix
* snapshot tweak
* more test tweak
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)
* small tweak
* disable bad test
* fmt
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Bring back tauri e2e tests
Fixes#2061 once green
* Fix if
* Add bail mocha opt and more cleanup, disable second dir test
* Add mocha types and tsconfig
* Add 10sec delay for auth (worked in 22.04 local docker)
* Add back close settings click
* Disable open file
* Re-enable settings test
* Handle error page
* Back to brower.execute location.href
* Add --force to tauri-driver install (I think because of cache)
---------
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* Remove tauri.release-macos.conf on debug builds
* BUILD_RELEASE: true
* Back to conditional BUILD_RELEASE for merge
* Remove tauri.release-macos.conf.json
* Search and highlight, no scroll yet
* Tweak toggle look
* Style search, fix state changes
* Separate out settings components
* Include description in results, minor style tweaks
* Fix tsc import
* Remove unused imports in Settings
* fmt
It's not permissible to transition the bundle policy during runtime, so
we need to maintain max-bundle, even if we know there's no ICE and it
won't matter any.
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* Add test clicking through each onboarding step
* Revert "get rid of code pane shit (#2259)"
This reverts commit d341681c0d.
* Fix the missing #code-pane id
* fmt
* WIP: automate release, get PR info from commit
* Get version from PR title in script
* Add create release script call under comment, will wait for next release to test
* Test with v0.19.0
* Change to draft
* Clean up after v0.19.0 test
* Test for v0.19.1
* Clean up after test
---------
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* more spped up wasm build
* try download again
* clean up
* rando change to rust to check it builds wasm
* make workflow more grokable/commented
* Revert "rando change to rust to check it builds wasm"
This reverts commit d2d9926b4b.
2024-04-25 22:27:28 +00:00
636 changed files with 171412 additions and 45475 deletions
./get-latest-wasm-bundle.sh # this will download the latest main wasm bundle
```
That will build the WASM binary and put in the `public` dir (though gitignored)
finally, to run the web app only, run:
@ -68,7 +74,13 @@ finally, to run the web app only, run:
yarn start
```
## Developing in Chrome
If you're not an KittyCAD employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development` 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 ofcourse, 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
@ -77,24 +89,6 @@ 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".
## Running tests
First, start the dev server following "Running a development build" above.
Then in another terminal tab, run:
```
yarn test
```
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.
For running the rust (not tauri rust though) only, you can
```bash
cd src/wasm-lib
cargo test
```
## Tauri
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
@ -152,6 +146,7 @@ console.log(
- `)
)
```
grab the md list and delete any that are older than the last bump
2. Merge the PR
@ -181,39 +176,51 @@ $ cargo +nightly fuzz run parser
docker run --network host --rm --init -it playwright/chrome:playwright-1.43.1
```
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>
```
An example of a `<test suite>` is: `e2e/playwright/flow-tests.spec.ts`
YOU WILL NEED A PLAYWRIGHT-SECRETS.ENV FILE:
```bash
# ./e2e/playwright/playwright-secrets.env
token=<your-token>
snapshottoken=<your-snapshot-token>
```
then replace "your-token" with a dev token from dev.zoo.dev/account/api-tokens
then:
run playwright
```
yarn playwright test
```
run a specific test suite
```
yarn playwright test src/e2e-tests/example.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)
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.
@ -258,12 +265,42 @@ Where `./store` should look like this
</details>
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:nowatch
```
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
```bash
cd src/wasm-lib
cargo test
```
#### 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.
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.
@ -289,3 +326,26 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
```
</details>
### Tauri e2e tests
#### Windows (local only until the CI edge version mismatch is fixed)
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.