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>