fmt
This commit is contained in:
10
src/App.tsx
10
src/App.tsx
@ -12,6 +12,7 @@ import {
|
||||
import { AppHeader } from '@src/components/AppHeader'
|
||||
import { CameraProjectionToggle } from '@src/components/CameraProjectionToggle'
|
||||
import { useEngineCommands } from '@src/components/EngineCommands'
|
||||
import { EngineStream } from '@src/components/EngineStream'
|
||||
import Gizmo from '@src/components/Gizmo'
|
||||
import { LowerRightControls } from '@src/components/LowerRightControls'
|
||||
import { useLspContext } from '@src/components/LspProvider'
|
||||
@ -35,9 +36,13 @@ import {
|
||||
} from '@src/lib/singletons'
|
||||
import { maybeWriteToDisk } from '@src/lib/telemetry'
|
||||
import { type IndexLoaderData } from '@src/lib/types'
|
||||
import { engineStreamActor, useSettings, useToken } from '@src/machines/appMachine'
|
||||
import { EngineStreamTransition } from '@src/machines/engineStreamMachine'
|
||||
import {
|
||||
engineStreamActor,
|
||||
useSettings,
|
||||
useToken,
|
||||
} from '@src/machines/appMachine'
|
||||
import { commandBarActor } from '@src/machines/commandBarMachine'
|
||||
import { EngineStreamTransition } from '@src/machines/engineStreamMachine'
|
||||
import { onboardingPaths } from '@src/routes/Onboarding/paths'
|
||||
|
||||
// CYCLIC REF
|
||||
@ -46,7 +51,6 @@ sceneInfra.camControls.engineStreamActor = engineStreamActor
|
||||
maybeWriteToDisk()
|
||||
.then(() => {})
|
||||
.catch(() => {})
|
||||
import { EngineStream } from '@src/components/EngineStream'
|
||||
|
||||
export function App() {
|
||||
const { project, file } = useLoaderData() as IndexLoaderData
|
||||
|
||||
@ -11,8 +11,8 @@ import { useNetworkContext } from '@src/hooks/useNetworkContext'
|
||||
import { NetworkHealthState } from '@src/hooks/useNetworkStatus'
|
||||
import { useKclContext } from '@src/lang/KclProvider'
|
||||
import { isCursorInFunctionDefinition } from '@src/lang/queryAst'
|
||||
import { isCursorInSketchCommandRange } from '@src/lang/util'
|
||||
import { EngineConnectionStateType } from '@src/lang/std/engineConnection'
|
||||
import { isCursorInSketchCommandRange } from '@src/lang/util'
|
||||
import { isDesktop } from '@src/lib/isDesktop'
|
||||
import { openExternalBrowserIfDesktop } from '@src/lib/openWindow'
|
||||
import { editorManager, kclManager } from '@src/lib/singletons'
|
||||
@ -26,7 +26,6 @@ import { toolbarConfig } from '@src/lib/toolbar'
|
||||
import { isArray } from '@src/lib/utils'
|
||||
import { commandBarActor } from '@src/machines/commandBarMachine'
|
||||
|
||||
|
||||
export function Toolbar({
|
||||
className = '',
|
||||
...props
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
import type {
|
||||
CameraDragInteractionType_type,
|
||||
CameraViewState_type,
|
||||
} from '@kittycad/lib/dist/types/src/models'
|
||||
import type { EngineStreamActor } from '@src/machines/engineStreamMachine'
|
||||
import type { CameraViewState_type, CameraDragInteractionType_type } from '@kittycad/lib/dist/types/src/models'
|
||||
import * as TWEEN from '@tweenjs/tween.js'
|
||||
import {
|
||||
Euler,
|
||||
|
||||
@ -7,13 +7,13 @@ import CommandBarReview from '@src/components/CommandBar/CommandBarReview'
|
||||
import CommandComboBox from '@src/components/CommandComboBox'
|
||||
import { CustomIcon } from '@src/components/CustomIcon'
|
||||
import Tooltip from '@src/components/Tooltip'
|
||||
import { useNetworkContext } from '@src/hooks/useNetworkContext'
|
||||
import { EngineConnectionStateType } from '@src/lang/std/engineConnection'
|
||||
import useHotkeyWrapper from '@src/lib/hotkeyWrapper'
|
||||
import {
|
||||
commandBarActor,
|
||||
useCommandBarState,
|
||||
} from '@src/machines/commandBarMachine'
|
||||
import { EngineConnectionStateType } from '@src/lang/std/engineConnection'
|
||||
import { useNetworkContext } from '@src/hooks/useNetworkContext'
|
||||
|
||||
export const COMMAND_PALETTE_HOTKEY = 'mod+k'
|
||||
|
||||
|
||||
@ -1,29 +1,33 @@
|
||||
import { useAppState } from '@src/AppState'
|
||||
import { ClientSideScene } from '@src/clientSideScene/ClientSideSceneComp'
|
||||
import { ViewControlContextMenu } from '@src/components/ViewControlMenu'
|
||||
import { useModelingContext } from '@src/hooks/useModelingContext'
|
||||
import { useNetworkContext } from '@src/hooks/useNetworkContext'
|
||||
import { NetworkHealthState } from '@src/hooks/useNetworkStatus'
|
||||
import { ClientSideScene } from '@src/clientSideScene/ClientSideSceneComp'
|
||||
import { btnName } from '@src/lib/cameraControls'
|
||||
import { sendSelectEventToEngine } from '@src/lib/selections'
|
||||
import { kclManager, engineCommandManager, sceneInfra } from '@src/lib/singletons'
|
||||
import { EngineCommandManagerEvents } from '@src/lang/std/engineConnection'
|
||||
import { PATHS } from '@src/lib/paths'
|
||||
import type { IndexLoaderData } from '@src/lib/types'
|
||||
import { err, reportRejection, trap } from '@src/lib/trap'
|
||||
import { getArtifactOfTypes } from '@src/lang/std/artifactGraph'
|
||||
import { ViewControlContextMenu } from '@src/components/ViewControlMenu'
|
||||
import { useSettings, engineStreamActor } from '@src/machines/appMachine'
|
||||
import { EngineCommandManagerEvents } from '@src/lang/std/engineConnection'
|
||||
import { btnName } from '@src/lib/cameraControls'
|
||||
import { PATHS } from '@src/lib/paths'
|
||||
import { sendSelectEventToEngine } from '@src/lib/selections'
|
||||
import {
|
||||
engineCommandManager,
|
||||
kclManager,
|
||||
sceneInfra,
|
||||
} from '@src/lib/singletons'
|
||||
import { REASONABLE_TIME_TO_REFRESH_STREAM_SIZE } from '@src/lib/timings'
|
||||
import { err, reportRejection, trap } from '@src/lib/trap'
|
||||
import type { IndexLoaderData } from '@src/lib/types'
|
||||
import { engineStreamActor, useSettings } from '@src/machines/appMachine'
|
||||
import { useCommandBarState } from '@src/machines/commandBarMachine'
|
||||
import {
|
||||
EngineStreamState,
|
||||
EngineStreamTransition,
|
||||
} from '@src/machines/engineStreamMachine'
|
||||
import { REASONABLE_TIME_TO_REFRESH_STREAM_SIZE } from '@src/lib/timings'
|
||||
|
||||
import { useSelector } from '@xstate/react'
|
||||
import { useRouteLoaderData } from 'react-router-dom'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import type { MouseEventHandler } from 'react'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { useRouteLoaderData } from 'react-router-dom'
|
||||
|
||||
export const EngineStream = (props: {
|
||||
pool: string | null
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { EngineStreamState } from '@src/machines/engineStreamMachine'
|
||||
import { engineStreamActor } from '@src/machines/appMachine'
|
||||
import { EngineStreamState } from '@src/machines/engineStreamMachine'
|
||||
import { useSelector } from '@xstate/react'
|
||||
|
||||
import { faPause, faPlay, faSpinner } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { faPlay, faPause, faSpinner } from '@fortawesome/free-solid-svg-icons'
|
||||
|
||||
export const ModelStateIndicator = () => {
|
||||
const engineStreamState = useSelector(engineStreamActor, (state) => state)
|
||||
|
||||
@ -68,9 +68,7 @@ export default class EditorManager {
|
||||
public _editorView: EditorView | null = null
|
||||
public kclManager?: KclManager
|
||||
|
||||
constructor(
|
||||
engineCommandManager: EngineCommandManager,
|
||||
) {
|
||||
constructor(engineCommandManager: EngineCommandManager) {
|
||||
this.engineCommandManager = engineCommandManager
|
||||
}
|
||||
|
||||
|
||||
@ -70,10 +70,10 @@ export function useNetworkStatus() {
|
||||
!internetConnected
|
||||
? NetworkHealthState.Disconnected
|
||||
: hasIssues || hasIssues === undefined
|
||||
? NetworkHealthState.Issue
|
||||
: (ping ?? 0) > 16.6 * 3 // we consider ping longer than 3 frames as weak
|
||||
? NetworkHealthState.Weak
|
||||
: NetworkHealthState.Ok
|
||||
? NetworkHealthState.Issue
|
||||
: (ping ?? 0) > 16.6 * 3 // we consider ping longer than 3 frames as weak
|
||||
? NetworkHealthState.Weak
|
||||
: NetworkHealthState.Ok
|
||||
)
|
||||
}, [hasIssues, internetConnected, ping])
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import type { SceneInfra } from '@src/clientSideScene/sceneInfra'
|
||||
import type EditorManager from '@src/editor/manager'
|
||||
import type CodeManager from '@src/lang/codeManager'
|
||||
import type RustContext from '@src/lib/rustContext'
|
||||
import type { Diagnostic } from '@codemirror/lint'
|
||||
import type {
|
||||
EntityType_type,
|
||||
ModelingCmdReq_type,
|
||||
} from '@kittycad/lib/dist/types/src/models'
|
||||
import type { SceneInfra } from '@src/clientSideScene/sceneInfra'
|
||||
import type EditorManager from '@src/editor/manager'
|
||||
import type CodeManager from '@src/lang/codeManager'
|
||||
import type RustContext from '@src/lib/rustContext'
|
||||
|
||||
import type { KclValue } from '@rust/kcl-lib/bindings/KclValue'
|
||||
import type { Node } from '@rust/kcl-lib/bindings/Node'
|
||||
@ -235,7 +235,10 @@ export class KclManager {
|
||||
this._wasmInitFailedCallback(wasmInitFailed)
|
||||
}
|
||||
|
||||
constructor(engineCommandManager: EngineCommandManager, singletons: Singletons) {
|
||||
constructor(
|
||||
engineCommandManager: EngineCommandManager,
|
||||
singletons: Singletons
|
||||
) {
|
||||
this.engineCommandManager = engineCommandManager
|
||||
this.singletons = singletons
|
||||
|
||||
@ -481,7 +484,9 @@ export class KclManager {
|
||||
await this.updateArtifactGraph(execState.artifactGraph)
|
||||
this._executeCallback()
|
||||
if (!isInterrupted) {
|
||||
this.singletons.sceneInfra.modelingSend({ type: 'code edit during sketch' })
|
||||
this.singletons.sceneInfra.modelingSend({
|
||||
type: 'code edit during sketch',
|
||||
})
|
||||
}
|
||||
this.engineCommandManager.addCommandLog({
|
||||
type: CommandLogType.ExecutionDone,
|
||||
|
||||
@ -299,12 +299,16 @@ class EngineConnection extends EventTarget {
|
||||
private engineCommandManager: EngineCommandManager
|
||||
|
||||
private pingPongSpan: { ping?: number; pong?: number }
|
||||
private pingIntervalId: ReturnType<typeof setInterval> = setInterval(() => {},
|
||||
60_000)
|
||||
private pingIntervalId: ReturnType<typeof setInterval> = setInterval(
|
||||
() => {},
|
||||
60_000
|
||||
)
|
||||
isUsingConnectionLite: boolean = false
|
||||
|
||||
timeoutToForceConnectId: ReturnType<typeof setTimeout> = setTimeout(() => {},
|
||||
3000)
|
||||
timeoutToForceConnectId: ReturnType<typeof setTimeout> = setTimeout(
|
||||
() => {},
|
||||
3000
|
||||
)
|
||||
|
||||
constructor({
|
||||
engineCommandManager,
|
||||
|
||||
@ -43,8 +43,8 @@ import {
|
||||
isOverlap,
|
||||
uuidv4,
|
||||
} from '@src/lib/utils'
|
||||
import type { ModelingMachineEvent } from '@src/machines/modelingMachine'
|
||||
import { engineStreamActor } from '@src/machines/appMachine'
|
||||
import type { ModelingMachineEvent } from '@src/machines/modelingMachine'
|
||||
|
||||
export const X_AXIS_UUID = 'ad792545-7fd3-482a-a602-a93924e3055b'
|
||||
export const Y_AXIS_UUID = '680fd157-266f-4b8a-984f-cdf46b8bdf01'
|
||||
|
||||
@ -307,8 +307,8 @@ export function createSettings() {
|
||||
{preview / MS_IN_MINUTE === 60
|
||||
? '1 hour'
|
||||
: preview / MS_IN_MINUTE === 1
|
||||
? '1 minute'
|
||||
: preview + ' minutes'}
|
||||
? '1 minute'
|
||||
: preview + ' minutes'}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { ProjectConfiguration } from '@rust/kcl-lib/bindings/ProjectConfiguration'
|
||||
import type { Configuration } from '@rust/kcl-lib/bindings/Configuration'
|
||||
import type { ProjectConfiguration } from '@rust/kcl-lib/bindings/ProjectConfiguration'
|
||||
|
||||
import { createSettings } from '@src/lib/settings/initialSettings'
|
||||
import {
|
||||
|
||||
@ -3,9 +3,12 @@ import { createActor, setup, spawnChild } from 'xstate'
|
||||
|
||||
import { createSettings } from '@src/lib/settings/initialSettings'
|
||||
import { authMachine } from '@src/machines/authMachine'
|
||||
import {
|
||||
engineStreamContextCreate,
|
||||
engineStreamMachine,
|
||||
} from '@src/machines/engineStreamMachine'
|
||||
import { ACTOR_IDS } from '@src/machines/machineConstants'
|
||||
import { settingsMachine } from '@src/machines/settingsMachine'
|
||||
import { engineStreamContextCreate, engineStreamMachine } from '@src/machines/engineStreamMachine'
|
||||
|
||||
const { AUTH, SETTINGS, ENGINE_STREAM } = ACTOR_IDS
|
||||
const appMachineActors = {
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
import { jsAppSettings } from '@src/lib/settings/settingsUtils'
|
||||
import type { MutableRefObject } from 'react'
|
||||
import { setup, assign, fromPromise, ActorRefFrom } from 'xstate'
|
||||
import {
|
||||
rustContext,
|
||||
kclManager,
|
||||
sceneInfra,
|
||||
engineCommandManager,
|
||||
kclManager,
|
||||
rustContext,
|
||||
sceneInfra,
|
||||
} from '@src/lib/singletons'
|
||||
import type { MutableRefObject } from 'react'
|
||||
import type { ActorRefFrom } from 'xstate'
|
||||
import { assign, fromPromise, setup } from 'xstate'
|
||||
|
||||
export enum EngineStreamState {
|
||||
Off = 'off',
|
||||
|
||||
Reference in New Issue
Block a user