diff --git a/.env.development b/.env.development index 9bf3d60b3..b69c3d78e 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ -VITE_KC_API_WS_MODELING_URL=wss://api.dev.kittycad.io/ws/modeling/commands -VITE_KC_API_BASE_URL=https://api.dev.kittycad.io -VITE_KC_SITE_BASE_URL=https://dev.kittycad.io +VITE_KC_API_WS_MODELING_URL=wss://api.kittycad.io/ws/modeling/commands +VITE_KC_API_BASE_URL=https://api.kittycad.io +VITE_KC_SITE_BASE_URL=https://kittycad.io VITE_KC_SKIP_AUTH=false -VITE_KC_CONNECTION_TIMEOUT_MS=5000 +VITE_KC_CONNECTION_TIMEOUT_MS=15000 VITE_KC_SENTRY_DSN= diff --git a/.github/workflows/cargo-clippy.yml b/.github/workflows/cargo-clippy.yml index a0a78a3dd..943f97de3 100644 --- a/.github/workflows/cargo-clippy.yml +++ b/.github/workflows/cargo-clippy.yml @@ -40,6 +40,17 @@ jobs: - name: Rust Cache uses: Swatinem/rust-cache@v2.6.1 + - name: Install ffmpeg + run: | + sudo apt update + sudo apt install \ + ffmpeg \ + libavformat-dev \ + libavutil-dev \ + libclang-dev \ + libswscale-dev \ + --no-install-recommends + - name: Run clippy run: | cd "${{ matrix.dir }}" diff --git a/.github/workflows/cargo-test.yml b/.github/workflows/cargo-test.yml index 316723804..c727dba0d 100644 --- a/.github/workflows/cargo-test.yml +++ b/.github/workflows/cargo-test.yml @@ -41,6 +41,16 @@ jobs: - uses: taiki-e/install-action@nextest - name: Rust Cache uses: Swatinem/rust-cache@v2.6.1 + - name: Install ffmpeg + run: | + sudo apt update + sudo apt install \ + ffmpeg \ + libavformat-dev \ + libavutil-dev \ + libclang-dev \ + libswscale-dev \ + --no-install-recommends - name: cargo test shell: bash run: |- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 096072242..d5dabe55e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,6 +153,8 @@ jobs: needs: [build-test-web, build-apps] env: VERSION_NO_V: ${{ needs.build-test-web.outputs.version }} + PUB_DATE: ${{ github.event.release.created_at }} + NOTES: ${{ github.event.release.body }} steps: - uses: actions/download-artifact@v3 @@ -166,6 +168,8 @@ jobs: RELEASE_DIR=https://dl.kittycad.io/releases/modeling-app/v${VERSION_NO_V} jq --null-input \ --arg version "v${VERSION_NO_V}" \ + --arg pub_date "${PUB_DATE}" \ + --arg notes "${NOTES}" \ --arg darwin_sig "$DARWIN_SIG" \ --arg darwin_url "$RELEASE_DIR/macos/KittyCAD%20Modeling.app.tar.gz" \ --arg linux_sig "$LINUX_SIG" \ @@ -174,6 +178,8 @@ jobs: --arg windows_url "$RELEASE_DIR/nsis/KittyCAD%20Modeling_${VERSION_NO_V}_x64-setup.nsis.zip" \ '{ "version": $version, + "pub_date": $pub_date, + "notes": $notes, "platforms": { "darwin-x86_64": { "signature": $darwin_sig, @@ -195,6 +201,34 @@ jobs: }' > last_update.json cat last_update.json + - name: Generate the download static endpoint + run: | + RELEASE_DIR=https://dl.kittycad.io/releases/modeling-app/v${VERSION_NO_V} + jq --null-input \ + --arg version "v${VERSION_NO_V}" \ + --arg pub_date "${PUB_DATE}" \ + --arg notes "${NOTES}" \ + --arg darwin_url "$RELEASE_DIR/dmg/KittyCAD%20Modeling_${VERSION_NO_V}_universal.dmg" \ + --arg linux_url "$RELEASE_DIR/appimage/kittycad-modeling_${VERSION_NO_V}_amd64.AppImage" \ + --arg windows_url "$RELEASE_DIR/msi/KittyCAD%20Modeling_${VERSION_NO_V}_x64_en-US.msi.zip" \ + '{ + "version": $version, + "pub_date": $pub_date, + "notes": $notes, + "platforms": { + "dmg-universal": { + "url": $darwin_url + }, + "appimage-x86_64": { + "url": $linux_url + }, + "msi-x86_64": { + "url": $windows_url + } + } + }' > last_download.json + cat last_download.json + - name: Authenticate to Google Cloud uses: 'google-github-actions/auth@v1.1.1' with: @@ -219,6 +253,12 @@ jobs: path: last_update.json destination: dl.kittycad.io/releases/modeling-app + - name: Upload download endpoint to public bucket + uses: google-github-actions/upload-cloud-storage@v1.0.3 + with: + path: last_download.json + destination: dl.kittycad.io/releases/modeling-app + - name: Upload release files to Github uses: softprops/action-gh-release@v1 with: diff --git a/docs/kcl.json b/docs/kcl.json index 4c2d2d5ce..82f6e7179 100644 --- a/docs/kcl.json +++ b/docs/kcl.json @@ -11173,22 +11173,13 @@ }, "to": { "description": "The to point.", - "anyOf": [ - { - "description": "A point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - { - "description": "A string like `default`.", - "type": "string" - } - ] + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 } } }, @@ -11201,10 +11192,6 @@ }, "maxItems": 2, "minItems": 2 - }, - { - "description": "A string like `default`.", - "type": "string" } ] }, @@ -15341,22 +15328,13 @@ }, "to": { "description": "The to point.", - "anyOf": [ - { - "description": "A point.", - "type": "array", - "items": { - "type": "number", - "format": "double" - }, - "maxItems": 2, - "minItems": 2 - }, - { - "description": "A string like `default`.", - "type": "string" - } - ] + "type": "array", + "items": { + "type": "number", + "format": "double" + }, + "maxItems": 2, + "minItems": 2 } } }, @@ -15369,10 +15347,6 @@ }, "maxItems": 2, "minItems": 2 - }, - { - "description": "A string like `default`.", - "type": "string" } ] }, diff --git a/docs/kcl.md b/docs/kcl.md index 386c808fc..4e32cabd3 100644 --- a/docs/kcl.md +++ b/docs/kcl.md @@ -2044,11 +2044,9 @@ line(data: LineData, sketch_group: SketchGroup) -> SketchGroup // The tag. tag: string, // The to point. - to: [number] | -string, + to: [number], } | -[number] | -string +[number] ``` * `sketch_group`: `SketchGroup` - A sketch group is a collection of paths. ``` @@ -2784,11 +2782,9 @@ startSketchAt(data: LineData) -> SketchGroup // The tag. tag: string, // The to point. - to: [number] | -string, + to: [number], } | -[number] | -string +[number] ``` #### Returns diff --git a/package.json b/package.json index ce563c9cf..a5c1a85c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "untitled-app", - "version": "0.5.0", + "version": "0.6.1", "private": true, "dependencies": { "@codemirror/autocomplete": "^6.9.0", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 55d3a8ce3..ec86c0970 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -19,7 +19,7 @@ anyhow = "1" oauth2 = "4.4.1" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -tauri = { version = "1.3.0", features = [ "updater", "path-all", "dialog-all", "fs-all", "http-request", "shell-open", "shell-open-api"] } +tauri = { version = "1.3.0", features = ["dialog-all", "fs-all", "http-request", "path-all", "shell-open", "shell-open-api", "updater"] } tokio = { version = "1.29.1", features = ["time"] } toml = "0.6.0" tauri-plugin-fs-extra = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e09d5a792..35911e403 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "kittycad-modeling", - "version": "0.5.0" + "version": "0.6.1" }, "tauri": { "allowlist": { diff --git a/src/App.tsx b/src/App.tsx index 5fa1fb7d0..cedf6f6b3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -42,7 +42,9 @@ export function App() { setOpenPanes, didDragInStream, streamDimensions, + guiMode, } = useStore((s) => ({ + guiMode: s.guiMode, setCode: s.setCode, engineCommandManager: s.engineCommandManager, buttonDownInStream: s.buttonDownInStream, @@ -109,8 +111,41 @@ export function App() { }) const newCmdId = uuidv4() - - if (buttonDownInStream !== undefined) { + if (buttonDownInStream === undefined) { + if ( + guiMode.mode === 'sketch' && + guiMode.sketchMode === ('sketch_line' as any) + ) { + debounceSocketSend({ + type: 'modeling_cmd_req', + cmd_id: newCmdId, + cmd: { + type: 'mouse_move', + window: { x, y }, + }, + }) + } else { + debounceSocketSend({ + type: 'modeling_cmd_req', + cmd: { + type: 'highlight_set_entity', + selected_at_window: { x, y }, + }, + cmd_id: newCmdId, + }) + } + } else { + if (guiMode.mode === 'sketch' && guiMode.sketchMode === ('move' as any)) { + debounceSocketSend({ + type: 'modeling_cmd_req', + cmd_id: newCmdId, + cmd: { + type: 'handle_mouse_drag_move', + window: { x, y }, + }, + }) + return + } const interactionGuards = cameraMouseDragGuards[cameraControls] let interaction: CameraDragInteractionType_type @@ -123,6 +158,7 @@ export function App() { } else if (interactionGuards.zoom.dragCallback(eWithButton)) { interaction = 'zoom' } else { + console.log('none') return } @@ -135,15 +171,6 @@ export function App() { }, cmd_id: newCmdId, }) - } else { - debounceSocketSend({ - type: 'modeling_cmd_req', - cmd: { - type: 'highlight_set_entity', - selected_at_window: { x, y }, - }, - cmd_id: newCmdId, - }) } } @@ -171,11 +198,11 @@ export function App() { paneOpacity } defaultSize={{ - width: '400px', + width: '550px', height: 'auto', }} minWidth={200} - maxWidth={600} + maxWidth={800} minHeight={'auto'} maxHeight={'auto'} handleClasses={{ diff --git a/src/Toolbar.tsx b/src/Toolbar.tsx index 85b4c7512..5442c199a 100644 --- a/src/Toolbar.tsx +++ b/src/Toolbar.tsx @@ -1,4 +1,4 @@ -import { useStore, toolTips } from './useStore' +import { useStore, toolTips, Selections } from './useStore' import { extrudeSketch, sketchOnExtrudedFace } from './lang/modifyAst' import { getNodePathFromSourceRange } from './lang/queryAst' import { HorzVert } from './components/Toolbar/HorzVert' @@ -15,6 +15,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faSearch, faX } from '@fortawesome/free-solid-svg-icons' import { Popover, Transition } from '@headlessui/react' import styles from './Toolbar.module.css' +import { v4 as uuidv4 } from 'uuid' +import { useAppMode } from 'hooks/useAppMode' export const Toolbar = () => { const { @@ -24,6 +26,7 @@ export const Toolbar = () => { ast, updateAst, programMemory, + engineCommandManager, } = useStore((s) => ({ guiMode: s.guiMode, setGuiMode: s.setGuiMode, @@ -31,7 +34,9 @@ export const Toolbar = () => { ast: s.ast, updateAst: s.updateAst, programMemory: s.programMemory, + engineCommandManager: s.engineCommandManager, })) + useAppMode() useEffect(() => { console.log('guiMode', guiMode) @@ -39,7 +44,7 @@ export const Toolbar = () => { function ToolbarButtons() { return ( - <> + {guiMode.mode === 'default' && ( )} - {(guiMode.mode === 'canEditSketch' || false) && ( + {guiMode.mode === 'canEditSketch' && ( )} {toolTips .filter( // (sketchFnName) => !['angledLineThatIntersects'].includes(sketchFnName) - (sketchFnName) => ['line'].includes(sketchFnName) + (sketchFnName) => ['sketch_line', 'move'].includes(sketchFnName) ) .map((sketchFnName) => { if ( @@ -143,7 +166,18 @@ export const Toolbar = () => { return (