* Fix unrelated bug, settings button in the home sidebar
doesn't go to the home settings after my previous fixes to routes
* Turn on "Replay Onboarding" button in home settings
* Use ONBOARDING_PROJECT_NAME in both places
* Fix formatting
* TypeError Fix
* removed not needed console log
* took into account adamchalmers feedback and fixed cl type error
* pretty up
* Irev-dev feedback fixes issue
* Create useAbsoluteFilePath hook
* Fix "report bug" link on Error page
* Replace relative URL to settings with absolute URL
* Replace other absolute file URLs to use common hook
* Use named const for default browser file name
* Fix UI tests that now rely on useRouteLoaderData()
Signed-off-by: Frank Noirot <frank@kittycad.io>
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
This will avoid letting the stack think its ready until it times out,
and will hopefully help with faster retry logic in the future
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* Remove duplicated tests
These tests already were copied to tokeniser2.rs, so removing them doesn't affect code coverage.
* Move tokeniser to its own module
Now there's a module for tokens, and the tokenizer/lexer implementation is private within the token module.
* New tokenizer, using Winnow instead of regexes.
Between 1.3x and 4.4x speedup on lexer benchmarks :)
* Use dispatch instead of alt
Most of the time, if you know the first character of a token, you can narrow down its potential possible token types, instead of just trying each token type until one succeeds.
This further speeds up the lexer. Compared to main, this branch is now between 3x and 12x faster than main.
* Start to restructure the Engine's connectio to the backend
1) Add in a tearDown stub for when the Engine is torn down. This is now
distinct from a 'close', which will not stop connect from trying
again. Running tearDown will mark the connection to not be retried
and close active connections.
2) Move the retry logic out of connect and into the constructor. It will
attempt to reconnect at the same rate as we had previously.
3) The timeout will now only close the connection, not restart it.
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* Don't continue on dead conn & setTimeout on init only
* Clean up extra setTimeout
* Keep track of connection timeouts and clear on close
* Fix tsc by defining Timeout
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* appease the format gods
---------
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
Co-authored-by: Adam Sunderland <adam@kittycad.io>
* Use an actor to manage the Tokio engine connection
This means EngineManager trait's methods take &self not &mut self, and the tokio implementation can be cloned.
* Clean up code
* Add Cmd + / to support windows, update walkthrough
* Fix#628 dark mode <select> bg color
* Fix#621 by narrowing margins and moving to left
---------
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
* Fix#593: don't prevent default on link click
* Use absolute/explicit path for settings
Trying to test fix for #594
* Broken: replace almost all relative URLs with absolute
* Clean up to use clean useDismiss with absolute path
* Merge branch 'main' into franknoirot/ux-papercuts-3a
* Add buttons to home, reload, clear, and bug report on error screen
* Fix#593: don't prevent default on link click
* Use absolute/explicit path for settings
Trying to test fix for #594
* Broken: replace almost all relative URLs with absolute
* add relative jump backs util
* dot dot slash everywhere
* use usLocation not window.location
* the one that got away
* fmt 🤦♂️
---------
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
Break out windows sed in CI action
Add run-script-os, break apart find-replace for each
Fix importmeta command typos
Fix windows commands in packag.json and ci.yml
I actually ran these on my windows machine
Update package.json
call remove-import-meta from ci
fucking sed
updates
only remove import meta pre tests
updates
fix order
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* Properly show dark logo in System-light theme
* Fix linting errors for fill-rule and clip-rule
* Support system-light theme on Parametric Modeling step as well
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Fix line number ref in Parametric Modeling copy
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Copyediting tweaks
* Fix part name disappearing even when there is space
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Update Introduction
* Update Camera step
* Change link to expectations
Co-authored-by: Josh Gomez <114548659+jgomez720@users.noreply.github.com>
* Set outline for onboarding
* Add Streaming step
* Remove Units step
* Add default kcl script
* Add Code Editor step
* Add Parametric Modeling step
* Add Interactive Numbers step
* Update bracket to use sqrt
* Add Command K step
* Assuage @jessfraz's code itchies
* Add User Menu step
* Add Project Menu step
* Add Export step
* Improve error page to actually show error
* Update the sketch step
* Add Future Work section
* Bring back the bracket code on the final step
* Set up the code to the bracket when starting onboarding
* Fix missing import
* Don't throw away users code if not empty
* Prompt the user if they have content in their file
---------
Co-authored-by: Josh Gomez <114548659+jgomez720@users.noreply.github.com>
This'll let us handle JSON encoding in one place, as well as adding any
logging or anything. Not a huge deal, but it's a minor cleanup I made
while looking into an unrelated bug.
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* addNewSketchLn should close when latest point matches start
* Fix types
* Include close in test case
* Add handling for continuing to sketch
* Fix types again
* close line edits (#523)
* add close to pipe
* undo some previous changes
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Change updater to msi over nsis, more common to sign
* Add sign-windows-msi from docs
* Add secrets and enable step
* Update ci.yml
* Add todo and fix download.json
* Add @replit/codemirror-interact
Signed off by Frank Noirot <frank@kittycad.io>
* Add support for Alt + Meta + Shift for 0.01 increment
* Remove pixelsPerIncrement
This doesn't work because we have to rely on movementX, which means
only mouse movements of 3px or greater register while dragging. Although
I would eventually like to control the screen speed of incrementing,
I'd rather have consistent behavior for now.
Signed off by Frank Noirot <frank@kittycad.io>
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
We have been catching the error thrown by the getUser fetch,
but since our state machine needs to fire onError we should
actually *not* wrap it in a try/catch statement.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Refactor: rename CADProgram to CameraSystem
* Fix buttonDownInStream always set to 0
This is problematic because the left mouse
button ID is actually 0. If no button is
pressed we should set back to undefined.
* Fix: middle mouse button ID is 1, not 3
* Add "Trackpad Friendly" camera system setting
Signed off by Frank Noirot <frank@kittycad.io>
* Allow camera configs to be lenient on first click
* Add in a Metrics request/response handler
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* Update @kittycad/lib to 0.0.37
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* Fix up type issues
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* yarn fmt
* Remove VITE_KC_CONNECTION_WEBRTC_REPORT_STATS_MS
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
---------
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Move format code button to menu item
by extending CollapsiblePanel to take an optional
menu React element.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Style tweaks
* Add shortcuts for format and cmd bar to codemirror
* Move convert to variable into code menu
Signed off by Frank Noirot <frank@kittycad.io>
* Add keyboard shortcut to convert to variable
* Remove convert to variable from toolbar
* Refactor: move TextEditor to its own component
* Set a better convertToVar shortcut
* Style and ergonomic polish for convertToVar modal
* Use named constants for shortcuts 😇
* Try yet another keyboard shortcut
* Fix formatting
* remove isShiftDown from app.tsx
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
The Promises are created behind a shouldTrace, so they'll be undefined
if you shouldn't be tracing. As a result, we need to guard the resoluton
of the promises.
Thanks @mlfarrell for spotting this in local dev!
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* Add camera handler config object
Using definitions of camera controls of various
CAD incumbents from Onshape's onboarding.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Refactor: alphabetize settingsMachine
* Refactor: add descriptions to MouseGuards
* Refactor: don't destructure mousemove event
* Refactor: button down in stream as int, not bool
* Honor current camera control settings
* Add cameraControls to settings
* Refactor: alphabetize settings imports
* Refactor: break out cameraControls to own file
* Fix camera control setting in command bar
* Fix formatting on generated type file
* dont use "as" in App.tsx guards
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Don't use "as" in Stream.tsx
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Don't use "as" in settingsMachine.ts
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Add type to cadPrograms
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Kurt review
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Set named const as default project name
* Refactor: move base units into settings machine
Signed off by Frank Noirot <frank@kittycad.io>
* Reset default when creating with blank name
Signed off by Frank Noirot <frank@kittycad.io>
* Make it impossible to set empty defaultProjectName
Signed off by Frank Noirot <frank@kittycad.io>
* Make it impossible to assign empty strings
to defaultProjectName
Signed off by Frank Noirot <frank@kittycad.io>
* Fix: allow tooltips to overflow code pane
while keeping the same vertical and horizontal
scroll behavior that we've had.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Style tooltips in light and dark mode
* Fix: properly display autocomplete info as HTML
We were parsing it from md to html, but displaying
the parsed html as a string in the info box.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Fix z-index of command bar to show over code panel
* Let user set text wrapping in editor
* Style hover tooltips
* Fix failing tests
by not including line wrapping plugin in test mode
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Refactor: let Stream handle control drag status
* Fix: prevent app rerender on mouse move
By not setting the highlight range unless things
actually need to change. Setting the highlight range
still causes an app rerender, though.
Signed-off-by: Frank Noirot <frank@kittycad.io>
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Don't fetch for user if in dev with a local engine
But rather return a dummy user (created by @paultag) so that
teammates using locally-running engines can bypass auth.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Use env var to be more explicit
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Redo how Spans are used from the Engine
I don't like all the Sentry-specific stuff we've got to work around, and
I want to add a bunch more spans and more cleanly end the transaction.
This isn't generic enough to pull out of this code (yet?), but we
clearly need some class of abstraction due to the highly async pattern
in the WebRTC code.
I want to add in more tags, but there are a lot of events we need to
wait on. I'd like to hook into the <video> 'play' eventListener, but
it's hard to do from all the way down in the Engine.
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* Fix up camera step copy and pane opacity for step
* Fix broken onboarding redirect with double slash
* Fix pane height for web bug from blur filter
I found a bug with browser behavior, at least on Chrome.
If you use `backdrop-filter: blur()` at all, you can't
have any children that overflow. The browser will ignore
any attempt and make those children max full-height.
This broke our side panels after I added blur, but
only in Chrome/browser target.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Fix bug with unit system
Changing the unit system didn't also change the
base unit in the onboarding anymore. It needed
updated to use XState the same way as `/settings`
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Fix AppHeader item spacing when there's no toolbar
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Add basic Popover functionality
* Fix up light mode of basic bar
* Add support for 2D and 3D mode styling
* Turn toolbar buttons back on
* Remove ActionButton until after tool logic refactor
* Add transitions
* Add styles to always center toolbar in header
* Only show the Replay Onboarding button in file settings
Resolves#351. Eventually we will implement more sophisticated
logic for which settings should be shown where.
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Remove unnecessary console.log
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Respond to system theme changes in real-time
If the user has their "theme" setting to "system".
I tried to use the [XState invoked callback approach](https://xstate.js.org/docs/guides/communication.html#invoking-callbacks),
but I could not find any way to respond to the latest context/state values within the
media listener; I kept receiving stale state.
Signed-off-by: Frank Noirot <frank@kittycad.io>
---------
Signed-off-by: Frank Noirot <frank@kittycad.io>
* Start to clean up Sentry now that the app is back up again.
Remove Sentry from local development I thought .env.development
was for dev.kc.io, not just local dev. Someone can add this to .local
if they need to test the Sentry stuff for now.
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
Collect WebRTC Statistical Information
Add in some instrumentation to track the duration of the setup phase,
and set up a job to make periodic use of the WebRTC Statistics API
to collect information about the connection (specifically, each track),
including transport-level information, timing information and bandwidth
information.
Sentry isn't the best place for that information, but it'll work until we
can work out a good long-term solution for it.
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* Add XState and naive ActionBar
* Add basic dialog and combobox
* Selectable commands in command bar
* Add a few (broken) file actions
* Home commands
* Add subcommand descriptions, cleanup on navigate
* Refactor: move command creation and types to lib
* Refactor to allow any machine to add commands
* Add auth to command bar, add ability to hide cmds
* Refactor: consolidate theme utilities
* Add settings as machine and command set
* Fix: type tweaks
* Fix: only allow auth to navigate from signin
* Remove zustand-powered settings
* Fix: remove zustand settings from App
* Fix: browser infinite redirect
* Feature: allow commands to be hidden per-platform
* Fix: tsc errors
* Fix: hide default project directory from cmd bar
* Polish: transitions, css tweaks
* Feature: label current value in options settings
* Fix broken debug panel UI
* Refactor: move settings toasts to actions
* Tweak: css rounding
* Fix: set default directory recursion and reload 🐞
* Refactor: move machines to their own directory
* Fix formatting
* @Irev-Dev clean-up catches, import cleanup
* Fix up message structure to match the new Engine messages
The types are still jacked up, I reckon we need to bump the node
@KittyCAD dep.
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
* update types
* fmt
* export tsc
* fmt again
---------
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
In the future, this should be sent as telemetry, but at least this would
give us a bit of info about the latency sitatuion locally if we start
seeing the refresh happen a lot.
Signed-off-by: Paul Tagliamonte <paul@kittycad.io>
Because we gate a lot of things off this.foo?, leaving the closed
websocket/pc/etc in-place was causing a noisy log, and mucking with
reestablishing a broken connection.
While I was in here, I fixed a style nit from yarn.
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* Build out EngineConnection's retry and timeout logic
* Migrate the EngineConnection to be an EventTarget for other parts of the
code (mostly the EngineManager, but maybe others?) to listen to, rather
than having a boolean 'done' promise, and remove callbacks in favor of
the eventListeners.
* When a WebRTC connection is online, send a 'ping' command every 10 seconds.
The UDP stream likely needs something similar, but the connection is
maintained by the WebRTC video stream for now.
* Begin to migrate code to use a more generic object "send" helper
which can handle the JSON encoding, as well as connection retry logic
in the future.
* Add a watchdog to trigger 5 seconds after a connection is initiated
to cancel and retry the connection if it's not become ready by the
time it wakes up. This won't watch an established connection yet.
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* Remove scroll handling, honor zoom on drag + ctrl
* Add back ability to zoom with mouse wheel, but properly
* Add TODO for 'any' removal
* Update kittycad lib to remove 'any'
* Start to add things to updater section
* Fix public key
* Fix conf.json
* Add secrets
* Add localhost updater endpoint
* Revert "Add localhost updater endpoint"
This reverts commit e9e08868aa.
* Add localhost updater endpoint
* Bump to 0.0.4
* Back to current v0.0.3 with localhost updater
* Bump to 0.0.4 for testing purpose
* Back to 0.0.3 and ngrok https endpoint
* Bump to fake 0.0.4
* revert 19761baba6 and back to 0.0.3
* Revert "revert 19761baba6 and back to 0.0.3"
This reverts commit 763cc1ee47.
* Back to 0.0.3, new releases endpoint
* Add template static json endpoint
* Add Google Cloud actions
* Test multi-job single-workflow CI for build, test, release
* Clean up
* Reorg to comply with non-persistence
* Reshuffle to speed things up
* Clean up
* Missing node sync in build-test-web
* Further download test
* Clean up
* Test simpler name, add TODOs, preparing endpoint.json
* Draft static endpoint generation
* Fix a few things on endpoint.json
* Test google cloud upload
* Replace non-existing version with temporary
* Try to have working test upload to bucket
* Fixes, version output, first attemp at test release and endpoint upload
* Fix jq
* Try to fix json
* Fix typo
* Fix attempt
* Trying to fix the version issue
* Add back test release upload to bucket
* WIP
* parent: false
* One upload per release
* WIP
* Test bump to 0.0.4
* Back to 0.0.3 with test endpoint URL
* Bump to 0.0.4 for testing purpose
* Remove test/ dir, put back release check
* Back to 0.0.3
* Clean up
The front-end and the back-end communicate with three channels. The
first is the WebSocket connection to the Engine API. Once that
connection is online, a WebRTC connection is negotiated, which contains
one video stream from the server to us for the GUI, and a second, which
is a binary data channel from us to the server, which we send JSON over
for real-time events like mouse positioning.
The lifecycle of the WebRTC connection and the WebSocket connection are
tied, since if the WebSocket connection breaks down, the WebRTC
connection must get restarted (to get a connection to the *same* backend
that we have an open WebSocket connection to).
This starts a move to split the WebRTC and WebSocket pair to be managed
by a new class (EngineConnection), which will only start and maintain
the WebSocket and WebRTC channels. Anything using the EngineConnection
will be able to communnicate commands without needing to add control
logic for the underlying data channels.
Signed-off-by: Paul R. Tagliamonte <paul@kittycad.io>
* Light mode style fixes
* Fix dismissing onboarding for nested routes
* Refactor: move export button to user side panel
* Refactor: add project data to modeling page loader
* Add new ProjectSidebarMenu
* Convert AppHeader to use ProjectSidebarMenu
* Move ExportButton to ProjectSidebarMenu
* Fix: hide default dir setting in Web
* Add DownloadAppBanner when in Prod
* Add unit tests to ProjectSidebarMenu
* Tiny CSS rounding tweak to sidebars
* Fix formatting in unit tests
* Update icons and logos to use full-color Kitt
* Fix: dim UI on camera drag, not click
* Bugfix: don't toast on every change of defaultDir
* Refactor app to live under /file/:id
* Stub out Tauri-only home page
* home reads and writes blank files to defaultDir
* Fix initial directory creation
* Make file names editable
* Refactor onboarding to use normal fns for load issues
* Feature: load and write files to and from disk
* Feature: Add file deletion, break out FileCard component
* Fix settings close URLs to be relative, button types
* Add filename and link to AppHeader
* Style tweaks: scrollbar, header name, card size
* Style: add header, empty state to Home
* Refactor: load file in route loader
* Move makePathRelative to lib to fix tests
* Fix App test
* Use '$nnn' default name scheme
* Fix type error on ActionButton
* Fix type error on ActionButton
* @adamchalmers review
* Fix merge mistake
* Refactor: rename all things "file" to "project"
* Feature: migrate to <project-name>/main.kcl setup
* Fix tsc test
* @Irev-Dev review part 1: renames and imports
* @Irev-Dev review pt 2: simplify file list refresh
* @Irev-Dev review pt 3: filter out non-projects
* @Irev-review pt 4: folder conventions + home auth
* Add sort functionality to new welcome page (#255)
* Add todo for Sentry
* WIP: Add release process
Test version change in tauri.conf.json
* Add bump-jsons script
* Trigger build on release and upload artifacts there (untested)
* Test
* Revert "Test"
This reverts commit 3c0c2ae39c.
* Bump to 0.0.3
* Update README
* WIP Build jobs
* Remove 'add missing import'
* Add yarn build:wasm
* Clean up
* Trying larger runner for ubuntu
* --verbose
* Back to docs
* WIP
* upload artifacts
* WIP Windows
* WIP Windows
* WIP Windows
* WIP Windows
* WIP Windows
* Clean up
* Clean up diff
* Better upload artifact
* Clean up, upload artifacts v3
* Add sed commands back
* Add fmt back
* Add name
* Clean up
* Better name
* Update .github/workflows/build.yml
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* Make /settings not throw away App component
* Make App not reload for Onboarding
* Close sidebar when navigating to /settings
* Use centralized constants for route pathnames
* Clean up a few stray raw path literals
* Feature: settings auto-save as they are updated
* Refactor: get rid of temporary settings states
* Feature: add escape hotkey to settings
* Style: layout tweaks
* Feature: setting unit system updates base unit too
Right now, if the executor throws a KCLError (e.g. for "variable name is not defined" errors), they aren't being caught by the .catch or the try/catch block in asyncWrap. This PR fixes it.
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
* working without clean up
* clean up dependencies
* use test not dev
* add tests for kclErrToDiagnostic
* remove jest config
* remove unneeded @ts-ignore
* Basic transparent pane styling
* HTML and static asset cleanup
* Convert to collapsibles
* Polish up DebugPanel
* Add hotkey support, remove allotment
* Remove allotment css dependency
* Merge in from main
* Add a different resizable package
* Fix tsc errors introduced by merge
* Stream has to have at least z-index of 0
* App header has to be above stream z-index
* Applied z-index to the wrong element
* Scrollable logs, disable UI while dragging
* Fix test errors from importing CSS Modules in Jest
* Persist open panes configuration
* Style tweaks and fix camera step in onboarding
* Kurt review, make click-drag handler declarative
* Add passive dark mode to everything but codemirror
* Add dark theme support for Codemirror
* Make theme a user setting
* Fix button text size
* guard against undefined window
* Formatting and test fix
I don't think the wildcards and the {}s were being expanded as expected
in the 'scripts' section of package.json.
Also, I think the .prettierignore file is sufficient to ensure we only format
TS/JS/JSX code.
Right now I'm getting ESLint errors because wasm-lib generates a JS project with semicolons.
This didn't use to matter, because `yarn prettier` applied to the Rust projects too. But
in my recent PR https://github.com/KittyCAD/untitled-lang/pull/192 I broke that.
This should fix it by ensuring the generated JS code gets formatted in a way that matches
our ESLint requirements.
Jest now supports a reporter which emits GitHub Actions annotations. So if a test fails, it should annotate your PR when you view it on GitHub. See their example at https://jestjs.io/docs/configuration#github-actions-reporter
Also, use typescript for the config file.
Currently, syntax/semantic errors in the user's source code result in vanilla JS exceptions being thrown, so they show up in the console. Instead, this PR:
- Adds a new type KCLError
- KCL syntax/semantic errors when parsing/executing the source code now throw KCLErrors instead of vanilla JS exceptions.
- KCL errors are caught and logged to a new "Errors" panel, instead of the browser console.
* Basic CRA to Vite conversion
* Restore ESLint support
* Remove semicolons from vite config
* Add vite client types to tsconfig
* Migrate to Vitest for testing (not working on Mac)
* some test progress (#175)
* some test progress
* something maybe working
* remove local lib
* small clean up
* tweaks
* fix dependency
* clean up deps
* remove vitest import
* vitest config is needed even though we're not using vitest
* more tweaks to vite config
---------
Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
* port recast to rust with massaged serialisation
* remove logs
* fix the last of white space test failures
* remove ts recastor
* clean up imports
* use serde serialise features
* unneeded async
* final clean up recast.ts
* more clean up tweaks
* improve Rust BinaryPart types
* Comments, fix warnings
* Run clippy --fix
* Remove unused variable
* serialise none_code_nodes manual to force strings to numbers
---------
Co-authored-by: Adam Chalmers <adam.s.chalmers@gmail.com>
* Add theme colors from Figma
* Rough-in of AppHeader
* Add styled ActionButton
* Add react-router and placeholder Settings page
* Add ability to set persistent defaultDir
* Add react-hot-toast for save success message
* Add defaultProjectName setting
* Handle case of stale empty defaultDir in storage
* Wrap app in BrowserRouter
* Wrap test App in BrowserRouter
* Don't need BrowserRouter outside of testing
because we use RouterProvider
We can create a enginelessExecutor that can be used for many of the
executor tests that will be much more performant for tests that don't
need the engine to actually do any modeling work.
* Intital async of executor
The execture now sends websocket message instead of calling functions
directly from the engine, When it does so it holds onto the id.
The engine is still returning geo/polys directly but I'm working make it
so that the UI doesn't need to know about that, so that we can switch
over the streaming ui.
Things left to do:
- it is still making both direct function calls and websockets, and the former should be removed.
- It does highlighting of segments and sourceRanges not through websockets and that needs to be fixed.
- Tests have not been adjusted for these changes.
- Selecting the head of a segment is not working correctly again yet.
* Rough engine prep changes (#135)
* rough changes for engine prep
* mouse movements working again
* connect to engine for startsketch, line, close and extrude
live at [untitled-app.kittycad.io](https://untitled-app.kittycad.io/)
## KittyCAD Modeling App
Not sure what to call this, it's both a language/interpreter and a UI that uses the language as the source of truth model the user build with direct-manipulation with the UI.
live at [app.kittycad.io](https://app.kittycad.io/)
It might make sense to split this repo up at some point, but not the lang and the UI are all togther in a react app
A CAD application from the future, brought to you by the [KittyCAD team](https://kittycad.io).
Originally Presented on 10/01/2023
The KittyCAD 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:
- 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 KittyCAD Modeling App
- 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
- One of the bottlenecks of today's hardware design tools is that they all rely on the local machine's resources to do the hardest parts, which include geometry rendering and analysis. Our geometry engine parallelizes rendering and just sends video frames back to the app (seriously, inspect source, it's just a `<video>` element), and our API will offload analysis as we build it in
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!
## To run, there are a couple steps since we're compiling rust to WASM, you'll need to have rust stuff installed, then
KittyCAD 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.
The 3D view in KittyCAD 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.
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.
## Running a development build
First, [install Rust via `rustup`](https://www.rust-lang.org/tools/install). This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. Then, run:
```
yarn install
```
then
followed by:
```
yarn build:wasm
```
That will build the WASM binary and put in the `public` dir (though gitignored)
finally
finally, to run the web app only, run:
```
yarn start
```
and `yarn test` you would have need to have built the WASM previously. The tests need to download the binary from a server, so if you've already got `yarn start` running, that will work, otherwise running
```
yarn simpleserver
```
in one terminal
and
## 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".
## Running tests
First, start the dev server following "Running a development build" above.
Then in another terminal tab, run:
```
yarn test
```
in another.
If you want to edit the rust files, you can cd into `src/wasm-lib` and then use the usual rust commands, `cargo build`, `cargo test`, when you want to bring the changes back to the web-app, a fresh `yarn build:wasm` in the root will be needed.
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.
Worth noting that the integration of the WASM into this project is very hacky because I'm really pushing create-react-app further than what's practical, but focusing on features atm rather than the setup.
## Tauri
To spin up up tauri dev, `yarn install` and `yarn build:wasm` need to have been done before hand then
```
yarn tauri dev
```
Will spin up the web app before opening up the tauri dev desktop app. Note that it's probably a good idea to close the browser tab that gets opened since at the time of writting they can conflict.
The dev instance automatically opens up the browser devtools which can be disabled by [commenting it out](https://github.com/KittyCAD/modeling-app/blob/main/src-tauri/src/main.rs#L92.)
To build, run `yarn tauri build`, or `yarn tauri build --debug` to keep access to the devtools.
Note that these became separate apps on Macos, so make sure you open the right one after a build 😉
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. Bump the versions in the .json files by creating a `Cut release v{x}.{y}.{z}` PR, committing the changes from
```bash
VERSION=x.y.z yarn run bump-jsons
```
The PR may serve as a place to discuss the human-readable changelog and extra QA. A quick way of getting PR's merged since the last bump is to [use this PR filter](https://github.com/KittyCAD/modeling-app/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+), open up the browser console and past in the following
"remove-importmeta":"sed -i 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\"; sed -i '' 's/import.meta.url/window.location.origin/g' \"./src/wasm-lib/pkg/wasm_lib.js\" || echo \"sed for both mac and linux\"",
First off, thank you so much for your interest in being a part of the closed Alpha program! We are thrilled to have others use our product and see what you build with it (and truthfully, how you break it too).
### KittyCAD Modeling App (KCMA)
What we are introducing to you is our KittyCAD Modeling App (KCMA). KCMA is a CAD application that expresses a hybrid style of traditional CAD interface along with a code-CAD interface. KCMA is a great way for us to test our own APIs as well as inspire others to develop their own applications.
### Why Code?
Plenty of you have professional CAD experience, and may not understand why coding your model would be helpful. The "code-CAD" paradigm isn’t as popular as traditional CAD programs (SolidWorks, NX, CREO, OnShape, etc.), but it certainly has its benefits. Some benefits include:
- Automation and parametric design
- Customization and flexibility
- Algorithmic and generative design
- Reproducibility
- Easier integration with other tools
### Before You Use KCMA
Before you dive straight into the app, we wanted to lay some expectations out for you.
- KCMA is in early development. Kurt pitched the idea back in January, and the team has been working hard on it since then. KCMA has really basic CAD features for now, but we have plenty of features on our roadmap. Most of the features that you may be currently used to in your CAD workflow today will be available down the road.
- For a list of all scripting functions, please reference our [documentation](https://github.com/KittyCAD/modeling-app/blob/main/docs/kcl/std.md). For a basic rundown of our types, please reference [this document](https://github.com/KittyCAD/modeling-app/blob/main/docs/kcl/types.md).
- With that being said, we have created an external new features list in [GH Discussions](https://github.com/KittyCAD/modeling-app/discussions). For our current priority list, please click [here](https://github.com/KittyCAD/modeling-app/blob/main/public/roadmap.md). Please upvote any features in the GH Discussions page that you would like to see implemented first. We will prioritize the highest upvoted items or items that are foundational for other features on the list. You can also add your own, but we will review it to make sure it’s not a duplicate or it’s feasible for the current state of the app.
- Please report any and all bugs/issues you find. Even the smallest bugs are important! You can report them in a GH Issue [here](https://github.com/KittyCAD/modeling-app/issues/new). You are more than welcome to link your GH Issue in the **bugs** section of our Discord, but if you want to discuss the bug further, please keep that in the GH Issue thread. Please include the severity of the bug in your GH Issue ticket (High, Medium, or Low). If you are having trouble deciding what severity the bug is, use this guideline:
- **High:** The bug is blocking you from continuing.
- Example: Every time I click the extrude button with two faces selected, the app crashes.
- **Medium:** You can find a workaround to the problem, but it increases your time spent working or makes it unenjoyable.
- Example: When the app is full screen on Mac, the settings are not showing properly. It works if I have the app windowed.
- **Low:** The bug is annoying but doesn’t affect workflow or block you from continuing (usually you can say “It would be nice if ___, but it’s not needed”)
- Example: It would be nice if the camera would orient normal to the sketching surface when I select a face/plane and click “sketch”.
- We want you all to be aware that we may reach out to you in regard to issues, bugs, problems, and satisfaction. This will typically be for further clarification so we can really nail things down.
### Discord
We will be using Discord a lot more now that the Alpha has been released to people outside of the company. Please feel free to discuss and talk with us in the **alpha users** section of the server. We highly encourage you to engage with us on Discord!
### Thank You!
Once again, from all of us to you, thank you for being a part of the closed Alpha. We are happy to chat with you all, hear your feedback, and see some of your projects!
This document ties into our [GH Discussions Feature List](https://github.com/KittyCAD/modeling-app/discussions). Please upvote any features that you want to see next, or add ones that are not listed and we will review.
### Current Priority List
1. [Sketch on Face](https://github.com/KittyCAD/modeling-app/discussions/477)
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.