2023-10-16 13:28:41 -04:00
|
|
|
import { useMachine } from '@xstate/react'
|
2025-04-01 15:31:19 -07:00
|
|
|
import React, { createContext, useEffect, useMemo } from 'react'
|
|
|
|
import { toast } from 'react-hot-toast'
|
2025-04-01 23:54:26 -07:00
|
|
|
import { useLocation, useNavigate, useRouteLoaderData } from 'react-router-dom'
|
|
|
|
import type {
|
2025-04-01 15:31:19 -07:00
|
|
|
Actor,
|
|
|
|
AnyStateMachine,
|
|
|
|
ContextFrom,
|
|
|
|
Prop,
|
|
|
|
StateFrom,
|
|
|
|
} from 'xstate'
|
2025-04-01 23:54:26 -07:00
|
|
|
import { fromPromise } from 'xstate'
|
|
|
|
|
2025-04-04 08:39:02 -05:00
|
|
|
import { useAbsoluteFilePath } from '@src/hooks/useAbsoluteFilePath'
|
|
|
|
import { useMenuListener } from '@src/hooks/useMenu'
|
2025-04-01 23:54:26 -07:00
|
|
|
import { newKclFile } from '@src/lang/project'
|
|
|
|
import { createNamedViewsCommand } from '@src/lib/commandBarConfigs/namedViewsConfig'
|
|
|
|
import { createRouteCommands } from '@src/lib/commandBarConfigs/routeCommandConfig'
|
2024-08-28 06:38:14 -04:00
|
|
|
import {
|
2025-03-31 10:56:03 -04:00
|
|
|
DEFAULT_DEFAULT_LENGTH_UNIT,
|
2024-08-28 06:38:14 -04:00
|
|
|
DEFAULT_FILE_NAME,
|
|
|
|
DEFAULT_PROJECT_KCL_FILE,
|
|
|
|
FILE_EXT,
|
2025-04-01 23:54:26 -07:00
|
|
|
} from '@src/lib/constants'
|
|
|
|
import { getProjectInfo } from '@src/lib/desktop'
|
|
|
|
import { getNextDirName, getNextFileName } from '@src/lib/desktopFS'
|
|
|
|
import { isDesktop } from '@src/lib/isDesktop'
|
|
|
|
import { kclCommands } from '@src/lib/kclCommands'
|
|
|
|
import { BROWSER_PATH, PATHS } from '@src/lib/paths'
|
|
|
|
import { markOnce } from '@src/lib/performance'
|
|
|
|
import { codeManager, kclManager } from '@src/lib/singletons'
|
2025-05-14 09:06:29 -04:00
|
|
|
import { err } from '@src/lib/trap'
|
2025-04-01 23:54:26 -07:00
|
|
|
import { type IndexLoaderData } from '@src/lib/types'
|
2025-04-24 13:32:49 -05:00
|
|
|
import { useSettings, useToken } from '@src/lib/singletons'
|
|
|
|
import { commandBarActor } from '@src/lib/singletons'
|
2025-04-01 23:54:26 -07:00
|
|
|
import { fileMachine } from '@src/machines/fileMachine'
|
2025-04-04 08:39:02 -05:00
|
|
|
import { modelingMenuCallbackMostActions } from '@src/menu/register'
|
2023-10-16 13:28:41 -04:00
|
|
|
|
|
|
|
type MachineContext<T extends AnyStateMachine> = {
|
|
|
|
state: StateFrom<T>
|
|
|
|
context: ContextFrom<T>
|
2024-09-09 19:59:36 +03:00
|
|
|
send: Prop<Actor<T>, 'send'>
|
2023-10-16 13:28:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const FileContext = createContext(
|
|
|
|
{} as MachineContext<typeof fileMachine>
|
|
|
|
)
|
|
|
|
|
|
|
|
export const FileMachineProvider = ({
|
|
|
|
children,
|
|
|
|
}: {
|
|
|
|
children: React.ReactNode
|
|
|
|
}) => {
|
|
|
|
const navigate = useNavigate()
|
2025-02-21 13:47:36 -05:00
|
|
|
const location = useLocation()
|
2025-01-31 14:47:08 -05:00
|
|
|
const token = useToken()
|
2025-02-21 13:47:36 -05:00
|
|
|
const settings = useSettings()
|
Add ability to create and open URLs to create files (#4166)
* Rename `homeMachine` and accessories to `projectsMachine`
* Separate out `/home` route from `projectsMachine`
* Add logic to navigate out from deleted or renamed project
* Show a warning in the command palette for deleting a project
* Make it navigate when you create a project
* Update "New project" button to use command bar flow
Closes #2585
* More explicit warning message text
* Make projects watching code not run in web
* Tests first version: nested loops
* Tests second version: flattened
* Remove console logs
* Fix tsc
* @jtran feedback, use the type guard util
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Fix tests that relied on one-click, no-navigation project creation
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 7545b61b49dd35cbd229aa5c35273d52e5db8739.
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 3d2e48732c588b9964502b6590da139c1a0d91b0.
* Add a mask to the state indicator to client-side scale test
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Fix lint
* Fix tsc
* Add menu item to share link to file
* Forward query params while redirecting to /home or /file
* Add (broken) event logic and command triggering logic
* Fix a couple stray tests that still relied on the old way of creating projects
* De-flake another text that could be thrown off by toast-based selectors
* FMT
* Dumb test error because I was rushing
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Ahhh more flaky toasts, they're everywhere!
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Side quest: Only register commands once, power their disabled status while selecting commands via optional actor
* Get query-triggered command working in browser too
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Tests always run on localhost, don't expect the prod origin
* rerun CI
* wip
* wip
* Everything's pretty much done but url.zoo.dev has been broken and we need to think about how to test reliably
* Merge branch 'main' into franknoirot/4088/create-file-url
* Add useCreateFileLinkQuery on Home page
* Get primary user flow working on desktop
* Rework to open browser app first, then send along to the desktop app if asked
* Styling updates to OpenInDesktopAppHandler
* Clean up unecessary file
* Merge branch 'main' into franknoirot/4088/create-file-url
* Separate creating `createFileUrl` and shortlink so it is unit testable
* Add E2E test for importing file from URL
* Add a couple component tests for OpenInDesktopAppHandler
* Fix the "existing project" user flow
* Add E2E test for "add to existing project" user flow
* Undo mistaken or unecessary changes
* Lints, fmt, tsc
* Fix unit test
* Fix broken rename and delete project commands
Something about the `optionsFromContext` config no longer works with file I/O-related commands. I suspect this has to do with our read/write loop patching
* Fix unit test, use kebab-case for url query param
* Use dev urls everywhere when configured that way
I think we were just using some constants that ended up returning bad
values for dev, it seemed to return a working shortlink when I went
through the flow.
* Clean up unneeded PROD_TOKEN
* Fix browser command flow, because we had made the projectMachine desktop-only on main
* Make the test executor a bit more patient (#5004)
* Fix so that all artifact commands are returned regardless of caching (#5005)
* Fix so that all artifact commands are returned regardless of caching
* Add some more docs and fix up old ones
* Add new lint to disallow use of confusing isNaN (#4999)
* Point-and-click Sweep (first PR) (#4989)
* Refactor 'Delete selection' as actor
Will fix #4662
* WIP logging
* WIP: working Solid3dGetExtrusionFaceInfo for loft
* Working wall deletion of loft
* Add offset plane deletion
* Add feature tree deletion of shell
* Clean up
* Revert "Clean up"
This reverts commit 214763cc2bdf6227d8d8abda0f600f4ec5399327.
* Clean up rust changes, taking the sketch with the most paths
* Working cap selection and deletion
* Clean up
* Add test for loft and offset plane deletion via selection
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores)
* Set reenter: false as it was originally
* Passing test
* Add shell deletion via feature tree test
* Revert the migration to promise actor
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* Use cmd.id as solid_id after latest engine merge
* Add feature tree deletion of offset plane and fix lint
* Add feature tree deletion of loft
* Clean up
* Better comment
* Lint fix
* Remove sketch sorting
* WIP: sweep point-and-click
* Working sweep
* Add test
* Make sweep a development command
* Fix tsc error
* Clean up for review
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Upgrade typescript-eslint from 5.62.0 to 8.19.1 and remove eslint-config-react-app (#5006)
* Fix lost lints and add new ones (#5011)
* Add eslint-plugin-jsx-a11y dependency
* Add jsx-a11y lint
* Add eslint-plugin-react-hooks dependency
* Add react hooks lints
* Ignore new react hooks lint in tests
* Add eslint-plugin-testing-library dependency
* Add testing-library lint
* Fix yarn lint to use all files recursively
* Developer workflow: added auto generated workspace file from vitest extension in vscode (#4997)
* chore: added auto generated workspace file from vitest extension in vscode
* fix: auto fmt fixes
* Change Dependabot PRs to always be made on Mondays (#5025)
* Add packages to Dependabot updates (#5024)
* Bump @lezer/generator from 1.7.1 to 1.7.2 (#5018)
Bumps [@lezer/generator](https://github.com/lezer-parser/generator) from 1.7.1 to 1.7.2.
- [Changelog](https://github.com/lezer-parser/generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lezer-parser/generator/compare/1.7.1...1.7.2)
---
updated-dependencies:
- dependency-name: "@lezer/generator"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump handlebars from 6.2.0 to 6.3.0 in /src/wasm-lib (#5012)
Bumps [handlebars](https://github.com/sunng87/handlebars-rust) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/sunng87/handlebars-rust/releases)
- [Changelog](https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sunng87/handlebars-rust/compare/v6.2.0...v6.3.0)
---
updated-dependencies:
- dependency-name: handlebars
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump syn from 2.0.95 to 2.0.96 in /src/wasm-lib (#5015)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.95 to 2.0.96.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.95...2.0.96)
---
updated-dependencies:
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix artifact types to be more accurate (#5022)
* Fix Cargo.lock to not have changes (#5034)
* Upgrade all wasm-bindgen dependencies together (#5037)
* Disable auto-updater on non-versioned builds (#5042)
* turns on helix from edge (#5036)
* updates for new lib
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* autocomplete
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump version
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump all the things
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* new samples
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* docs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* ci: Add yarn test of packages/codemirror-lang-kcl (#5035)
* ci: Add yarn test of packages/codemirror-lang-kcl
* Fix CI error running tests
* Fix postcss config error
* Bump xstate from 5.17.4 to 5.19.2 (#5027)
* Hook up chamfer UI with AST-mod (#4694)
* button
* config
* hook up with ast
* cmd bar test
* button states fix and test
* little naming fix
* xState action to actor
* remove button state test updates
* fixture-based approach
* nightly
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update src/lib/toolbar.ts
Co-authored-by: Frank Noirot <frank@zoo.dev>
---------
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
* Remove Redundant Fillet Button State Test (#5009)
delete obsolete test
* Bump @types/node from 20.14.9 to 22.10.6 in /packages/codemirror-lsp-client (#5041)
* custom axis and origin example for helix (#5057)
* custom axis and origin for helix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* empty
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Bump typescript from 5.7.2 to 5.7.3 (#5021)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3)
---
updated-dependencies:
- dependency-name: typescript
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Refactor: break out `copyFileShareLink` into standalone function
* Add "Share file" to command palette
* Update dumb use of site URL instead of prod app URL
* fmt
* @lf94 nit
* @pierremtb spinner feedback
* Hide share link command and disable menu item for now
* Just comment out the command config for now
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: 49lf <ircsurfer33@gmail.com>
Co-authored-by: Adam Sunderland <iterion@gmail.com>
Co-authored-by: Adam Sunderland <adam@kittycad.io>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: max <margorskyi@gmail.com>
2025-01-23 19:18:27 -05:00
|
|
|
const projectData = useRouteLoaderData(PATHS.FILE) as IndexLoaderData
|
|
|
|
const { project, file } = projectData
|
2024-09-23 14:35:38 -04:00
|
|
|
|
2025-04-04 08:39:02 -05:00
|
|
|
const filePath = useAbsoluteFilePath()
|
|
|
|
|
2025-02-28 15:37:25 -06:00
|
|
|
useEffect(() => {
|
2025-03-26 11:12:35 -05:00
|
|
|
const {
|
|
|
|
createNamedViewCommand,
|
|
|
|
deleteNamedViewCommand,
|
|
|
|
loadNamedViewCommand,
|
|
|
|
} = createNamedViewsCommand()
|
2025-02-28 15:37:25 -06:00
|
|
|
|
2025-03-26 11:12:35 -05:00
|
|
|
const commands = [
|
|
|
|
createNamedViewCommand,
|
|
|
|
deleteNamedViewCommand,
|
|
|
|
loadNamedViewCommand,
|
|
|
|
]
|
|
|
|
commandBarActor.send({
|
|
|
|
type: 'Add commands',
|
|
|
|
data: {
|
|
|
|
commands,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
return () => {
|
|
|
|
// Remove commands if you go to the home page
|
2025-02-28 15:37:25 -06:00
|
|
|
commandBarActor.send({
|
2025-03-26 11:12:35 -05:00
|
|
|
type: 'Remove commands',
|
2025-02-28 15:37:25 -06:00
|
|
|
data: {
|
|
|
|
commands,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}, [])
|
|
|
|
|
2024-09-23 14:35:38 -04:00
|
|
|
useEffect(() => {
|
2024-11-07 17:23:03 -05:00
|
|
|
markOnce('code/didLoadFile')
|
2024-09-23 14:35:38 -04:00
|
|
|
}, [])
|
2023-10-16 13:28:41 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
const [state, send] = useMachine(
|
|
|
|
fileMachine.provide({
|
|
|
|
actions: {
|
|
|
|
renameToastSuccess: ({ event }) => {
|
|
|
|
if (event.type !== 'xstate.done.actor.rename-file') return
|
|
|
|
toast.success(event.output.message)
|
|
|
|
},
|
|
|
|
createToastSuccess: ({ event }) => {
|
|
|
|
if (event.type !== 'xstate.done.actor.create-and-open-file') return
|
|
|
|
toast.success(event.output.message)
|
|
|
|
},
|
|
|
|
toastSuccess: ({ event }) => {
|
|
|
|
if (
|
|
|
|
event.type !== 'xstate.done.actor.rename-file' &&
|
|
|
|
event.type !== 'xstate.done.actor.delete-file'
|
2023-10-16 13:28:41 -04:00
|
|
|
)
|
2024-09-09 19:59:36 +03:00
|
|
|
return
|
|
|
|
toast.success(event.output.message)
|
|
|
|
},
|
|
|
|
toastError: ({ event }) => {
|
|
|
|
if (event.type !== 'xstate.done.actor.rename-file') return
|
|
|
|
toast.error(event.output.message)
|
|
|
|
},
|
|
|
|
navigateToFile: ({ context, event }) => {
|
|
|
|
if (event.type !== 'xstate.done.actor.create-and-open-file') return
|
|
|
|
if (event.output && 'name' in event.output) {
|
2025-02-25 13:18:59 -06:00
|
|
|
// TODO: Technically this is not the same as the FileTree Onclick even if they are in the same page
|
|
|
|
// What is "Open file?"
|
2025-01-23 10:25:21 -05:00
|
|
|
commandBarActor.send({ type: 'Close' })
|
2024-09-09 19:59:36 +03:00
|
|
|
navigate(
|
|
|
|
`..${PATHS.FILE}/${encodeURIComponent(
|
2025-04-01 13:21:31 -04:00
|
|
|
// TODO: Should this be context.selectedDirectory.path?
|
|
|
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
2024-09-09 19:59:36 +03:00
|
|
|
context.selectedDirectory +
|
|
|
|
window.electron.path.sep +
|
2025-04-01 13:21:31 -04:00
|
|
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
2024-09-09 19:59:36 +03:00
|
|
|
event.output.name
|
|
|
|
)}`
|
|
|
|
)
|
|
|
|
} else if (
|
|
|
|
event.output &&
|
|
|
|
'path' in event.output &&
|
|
|
|
event.output.path.endsWith(FILE_EXT)
|
|
|
|
) {
|
|
|
|
// Don't navigate to newly created directories
|
|
|
|
navigate(`..${PATHS.FILE}/${encodeURIComponent(event.output.path)}`)
|
|
|
|
}
|
|
|
|
},
|
2025-04-24 19:02:18 -04:00
|
|
|
openFileInNewWindow: ({ event }) => {
|
|
|
|
if (event.type !== 'Open file in new window') {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
commandBarActor.send({ type: 'Close' })
|
|
|
|
window.electron.openInNewWindow(event.data.name)
|
|
|
|
},
|
2023-10-16 13:28:41 -04:00
|
|
|
},
|
2024-09-09 19:59:36 +03:00
|
|
|
actors: {
|
|
|
|
readFiles: fromPromise(async ({ input }) => {
|
|
|
|
const newFiles =
|
|
|
|
(isDesktop() ? (await getProjectInfo(input.path)).children : []) ??
|
|
|
|
[]
|
|
|
|
return {
|
|
|
|
...input,
|
|
|
|
children: newFiles,
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
createAndOpenFile: fromPromise(async ({ input }) => {
|
|
|
|
let createdName = input.name.trim() || DEFAULT_FILE_NAME
|
|
|
|
let createdPath: string
|
2023-10-16 13:28:41 -04:00
|
|
|
|
2025-02-04 18:13:59 -05:00
|
|
|
if (
|
|
|
|
(input.targetPathToClone &&
|
|
|
|
(await window.electron.statIsDirectory(
|
|
|
|
input.targetPathToClone
|
|
|
|
))) ||
|
|
|
|
input.makeDir
|
|
|
|
) {
|
2024-09-09 19:59:36 +03:00
|
|
|
let { name, path } = getNextDirName({
|
2025-02-04 18:13:59 -05:00
|
|
|
entryName: input.targetPathToClone
|
|
|
|
? window.electron.path.basename(input.targetPathToClone)
|
|
|
|
: createdName,
|
|
|
|
baseDir: input.targetPathToClone
|
|
|
|
? window.electron.path.dirname(input.targetPathToClone)
|
|
|
|
: input.selectedDirectory.path,
|
2024-09-09 19:59:36 +03:00
|
|
|
})
|
|
|
|
createdName = name
|
|
|
|
createdPath = path
|
|
|
|
await window.electron.mkdir(createdPath)
|
|
|
|
} else {
|
2025-04-14 14:53:01 -04:00
|
|
|
const isTargetPathToCloneASubPath =
|
|
|
|
input.targetPathToClone &&
|
|
|
|
input.selectedDirectory.path.indexOf(input.targetPathToClone) > -1
|
|
|
|
if (isTargetPathToCloneASubPath) {
|
|
|
|
const { name, path } = getNextFileName({
|
|
|
|
entryName: input.targetPathToClone
|
|
|
|
? window.electron.path.basename(input.targetPathToClone)
|
|
|
|
: createdName,
|
|
|
|
baseDir: input.targetPathToClone
|
|
|
|
? window.electron.path.dirname(input.targetPathToClone)
|
|
|
|
: input.selectedDirectory.path,
|
|
|
|
})
|
|
|
|
createdName = name
|
|
|
|
createdPath = path
|
|
|
|
} else {
|
|
|
|
const { name, path } = getNextFileName({
|
|
|
|
entryName: input.targetPathToClone
|
|
|
|
? window.electron.path.basename(input.targetPathToClone)
|
|
|
|
: createdName,
|
|
|
|
baseDir: input.selectedDirectory.path,
|
|
|
|
})
|
|
|
|
createdName = name
|
|
|
|
createdPath = path
|
|
|
|
}
|
2025-02-04 18:13:59 -05:00
|
|
|
if (input.targetPathToClone) {
|
|
|
|
await window.electron.copyFile(
|
|
|
|
input.targetPathToClone,
|
|
|
|
createdPath
|
|
|
|
)
|
|
|
|
} else {
|
2025-03-31 10:56:03 -04:00
|
|
|
const codeToWrite = newKclFile(
|
|
|
|
input.content,
|
|
|
|
settings.modeling.defaultUnit.current
|
|
|
|
)
|
|
|
|
if (err(codeToWrite)) return Promise.reject(codeToWrite)
|
|
|
|
await window.electron.writeFile(createdPath, codeToWrite)
|
2025-02-04 18:13:59 -05:00
|
|
|
}
|
2024-09-09 19:59:36 +03:00
|
|
|
}
|
2024-08-14 14:26:44 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
return {
|
|
|
|
message: `Successfully created "${createdName}"`,
|
|
|
|
path: createdPath,
|
2024-09-23 14:35:38 -04:00
|
|
|
shouldSetToRename: input.shouldSetToRename,
|
2024-09-09 19:59:36 +03:00
|
|
|
}
|
|
|
|
}),
|
|
|
|
createFile: fromPromise(async ({ input }) => {
|
|
|
|
let createdName = input.name.trim() || DEFAULT_FILE_NAME
|
|
|
|
let createdPath: string
|
2024-08-14 14:26:44 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
if (input.makeDir) {
|
|
|
|
let { name, path } = getNextDirName({
|
|
|
|
entryName: createdName,
|
|
|
|
baseDir: input.selectedDirectory.path,
|
|
|
|
})
|
|
|
|
createdName = name
|
|
|
|
createdPath = path
|
|
|
|
await window.electron.mkdir(createdPath)
|
|
|
|
} else {
|
|
|
|
const { name, path } = getNextFileName({
|
|
|
|
entryName: createdName,
|
|
|
|
baseDir: input.selectedDirectory.path,
|
|
|
|
})
|
|
|
|
createdName = name
|
|
|
|
createdPath = path
|
2025-03-31 10:56:03 -04:00
|
|
|
const codeToWrite = newKclFile(
|
|
|
|
input.content,
|
|
|
|
settings.modeling.defaultUnit.current
|
|
|
|
)
|
|
|
|
if (err(codeToWrite)) return Promise.reject(codeToWrite)
|
|
|
|
await window.electron.writeFile(createdPath, codeToWrite)
|
2024-09-09 19:59:36 +03:00
|
|
|
}
|
2024-05-24 18:12:39 -04:00
|
|
|
|
2024-08-28 06:38:14 -04:00
|
|
|
return {
|
2024-09-09 19:59:36 +03:00
|
|
|
path: createdPath,
|
2024-08-28 06:38:14 -04:00
|
|
|
}
|
2024-09-09 19:59:36 +03:00
|
|
|
}),
|
|
|
|
renameFile: fromPromise(async ({ input }) => {
|
|
|
|
const { oldName, newName, isDir } = input
|
|
|
|
const name = newName
|
|
|
|
? newName.endsWith(FILE_EXT) || isDir
|
|
|
|
? newName
|
|
|
|
: newName + FILE_EXT
|
|
|
|
: DEFAULT_FILE_NAME
|
|
|
|
const oldPath = window.electron.path.join(
|
2025-05-12 21:59:10 +02:00
|
|
|
input.parentDirectory.path,
|
2024-09-09 19:59:36 +03:00
|
|
|
oldName
|
|
|
|
)
|
|
|
|
const newPath = window.electron.path.join(
|
2025-05-12 21:59:10 +02:00
|
|
|
input.parentDirectory.path,
|
2024-09-09 19:59:36 +03:00
|
|
|
name
|
|
|
|
)
|
2024-08-28 06:38:14 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
// no-op
|
|
|
|
if (oldPath === newPath) {
|
|
|
|
return {
|
|
|
|
message: `Old is the same as new.`,
|
|
|
|
newPath,
|
|
|
|
oldPath,
|
|
|
|
}
|
2024-08-28 06:38:14 -04:00
|
|
|
}
|
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
// if there are any siblings with the same name, report error.
|
|
|
|
const entries = await window.electron.readdir(
|
|
|
|
window.electron.path.dirname(newPath)
|
|
|
|
)
|
|
|
|
for (let entry of entries) {
|
|
|
|
if (entry === newName) {
|
|
|
|
return Promise.reject(new Error('Filename already exists.'))
|
|
|
|
}
|
|
|
|
}
|
2024-08-16 07:15:42 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
window.electron.rename(oldPath, newPath)
|
2023-10-16 13:28:41 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
if (!file) {
|
|
|
|
return Promise.reject(new Error('file is not defined'))
|
|
|
|
}
|
2024-05-24 18:12:39 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
if (oldPath === file.path && project?.path) {
|
|
|
|
// If we just renamed the current file, navigate to the new path
|
|
|
|
navigate(`..${PATHS.FILE}/${encodeURIComponent(newPath)}`)
|
|
|
|
} else if (file?.path.includes(oldPath)) {
|
|
|
|
// If we just renamed a directory that the current file is in, navigate to the new path
|
|
|
|
navigate(
|
|
|
|
`..${PATHS.FILE}/${encodeURIComponent(
|
|
|
|
file.path.replace(oldPath, newPath)
|
|
|
|
)}`
|
|
|
|
)
|
|
|
|
}
|
2023-10-16 13:28:41 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
return {
|
|
|
|
message: `Successfully renamed "${oldName}" to "${name}"`,
|
|
|
|
newPath,
|
|
|
|
oldPath,
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
deleteFile: fromPromise(async ({ input }) => {
|
|
|
|
const isDir = !!input.children
|
2024-05-24 18:12:39 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
if (isDir) {
|
|
|
|
await window.electron
|
|
|
|
.rm(input.path, {
|
|
|
|
recursive: true,
|
|
|
|
})
|
|
|
|
.catch((e) => console.error('Error deleting directory', e))
|
|
|
|
} else {
|
|
|
|
await window.electron
|
|
|
|
.rm(input.path)
|
|
|
|
.catch((e) => console.error('Error deleting file', e))
|
|
|
|
}
|
2024-08-28 06:38:14 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
// If there are no more files at all in the project, create a main.kcl
|
|
|
|
// for when we navigate to the root.
|
|
|
|
if (!project?.path) {
|
|
|
|
return Promise.reject(new Error('Project path not set.'))
|
|
|
|
}
|
2024-08-28 06:38:14 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
const entries = await window.electron.readdir(project.path)
|
|
|
|
const hasKclEntries =
|
|
|
|
entries.filter((e: string) => e.endsWith('.kcl')).length !== 0
|
|
|
|
if (!hasKclEntries) {
|
2025-03-31 10:56:03 -04:00
|
|
|
const codeToWrite = newKclFile(
|
|
|
|
undefined,
|
|
|
|
settings.modeling.defaultUnit.current
|
2024-09-09 19:59:36 +03:00
|
|
|
)
|
2025-03-31 10:56:03 -04:00
|
|
|
if (err(codeToWrite)) return Promise.reject(codeToWrite)
|
|
|
|
const path = window.electron.path.join(
|
|
|
|
project.path,
|
|
|
|
DEFAULT_PROJECT_KCL_FILE
|
|
|
|
)
|
|
|
|
await window.electron.writeFile(path, codeToWrite)
|
2024-09-09 19:59:36 +03:00
|
|
|
// Refresh the route selected above because it's possible we're on
|
|
|
|
// the same path on the navigate, which doesn't cause anything to
|
|
|
|
// refresh, leaving a stale execution state.
|
|
|
|
navigate(0)
|
|
|
|
return {
|
|
|
|
message: 'No more files in project, created main.kcl',
|
|
|
|
}
|
|
|
|
}
|
2024-05-24 18:12:39 -04:00
|
|
|
|
2024-09-09 19:59:36 +03:00
|
|
|
// If we just deleted the current file or one of its parent directories,
|
|
|
|
// navigate to the project root
|
|
|
|
if (
|
|
|
|
(input.path === file?.path || file?.path.includes(input.path)) &&
|
|
|
|
project?.path
|
|
|
|
) {
|
|
|
|
navigate(`../${PATHS.FILE}/${encodeURIComponent(project.path)}`)
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
message: `Successfully deleted ${isDir ? 'folder' : 'file'} "${
|
|
|
|
input.name
|
|
|
|
}"`,
|
|
|
|
}
|
|
|
|
}),
|
2023-10-16 13:28:41 -04:00
|
|
|
},
|
2024-09-09 19:59:36 +03:00
|
|
|
}),
|
|
|
|
{
|
|
|
|
input: {
|
|
|
|
project,
|
|
|
|
selectedDirectory: project,
|
2023-10-16 13:28:41 -04:00
|
|
|
},
|
2024-09-09 19:59:36 +03:00
|
|
|
}
|
|
|
|
)
|
2023-10-16 13:28:41 -04:00
|
|
|
|
[Feature]: Enable Text-to-CAD at the application level (#6501)
* chore: saving off skeleton
* fix: saving skeleton
* chore: skeleton for loading projects from project directory path
* chore: cleaning up useless state transition to be an on event direct to action state
* fix: new structure for web vs desktop vs react machine provider code
* chore: saving off skeleton
* fix: skeleton logic for react? going to move it from a string to obj.string
* fix: trying to prevent error element unmount on global react components. This is bricking JS state
* fix: we are so back
* chore: implemented navigating to specfic KCL file
* chore: implementing renaming project
* chore: deleting project
* fix: auto fixes
* fix: old debug/testing file oops
* chore: generic create new file
* chore: skeleton for web create file provide
* chore: basic machine vitest... need to figure out how to get window.electron implemented in vitest?
* chore: save off progress before deleting other project implementation, a few missing features still
* chore: trying a different init skeleton? most likely will migrate
* chore: first attempt of purging projects context provider
* chore: enabling toast for some machine state
* chore: enabling more toast success and error
* chore: writing read write state to the system io based on the project path
* fix: tsc fixes
* fix: use file system watcher, navigate to project after creation via the requestProjectName
* chore: open project command, hooks vs snapshot context helpers
* chore: implemented open and create project for e2e testing. They are hard coded in poor spot for now.
* fix: codespell fixes
* chore: implementing more project commands
* chore: PR improvements for root.tsx
* chore: leaving comment about new Router.tsx layout
* fix: removing debugging code
* fix: rewriting component for readability
* fix: improving web initialization
* chore: implementing import file from url which is not actually that?
* fix: clearing search params on import file from url
* fix: fixed two e2e tests, forgot needsReview when making new command
* fix: fixing some import from url business logic to pass e2e tests
* chore: script for diffing circular deps +/-
* fix: formatting
* fix: massive fix for circular depsga!
* fix: trying to fix some errors and auto fmt
* fix: updating deps
* fix: removing debugging code
* fix: big clean up
* fix: more deletion
* fix: tsc cleanup
* fix: TSC TSC TSC TSC!
* fix: typo fix
* fix: clear query params on web only, desktop not required
* fix: removing unused code
* fmt
* Bring back `trap` removed in merge
* Use explicit types instead of `any`s on arg configs
* Add project commands directly to command palette
* fix: deleting debugging code, from PR review
* fix: this got added back(?)
* fix: using referred type
* fix: more PR clean up
* fix: big block comment for xstate architecture decision
* fix: more pr comment fixes
* fix: saving off logic, need a big cleanup because I hacked it together to get a POC
* fix: extra business?
* fix: merge conflict just added them back why dude
* fix: more PR comments
* fix: big ciruclar deps fix, commandBarActor in appActor
* chore: writing e2e test, still need to fix 3 bugs
* chore: adding more scenarios
* fix: formatting
* fix: fixing tsc errors
* chore: deleting the old text to cad and using the new application level one, almost there
* fix: prompt to edit works
* fix: large push to get 1 text to cad command... the usage is a little buggy with delete and navigate within /file
* fix: settings for highlight edges now works
* chore: adding another e2e test
* fix: cleaning up e2e tests and writing more of them
* fix: tsc type
* chore: more e2e improvements, unique project name in text to cad
* chore: e2e tests should be good to go
* fix: gotcha comment
* fix: enabled web t2c, codespell fixes
* fix: fixing merge conflcits??
* fix: t2c is back
* Remove spaces in command bar test
* fmt
---------
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
Co-authored-by: lee-at-zoo-corp <lee@zoo.dev>
2025-04-25 18:04:47 -05:00
|
|
|
// Due to the route provider, i've moved this to the FileMachineProvider instead of CommandBarProvider
|
|
|
|
// This will register the commands to route to Telemetry, Home, and Settings.
|
|
|
|
useEffect(() => {
|
|
|
|
const filePath =
|
|
|
|
PATHS.FILE + '/' + encodeURIComponent(file?.path || BROWSER_PATH)
|
|
|
|
const { RouteTelemetryCommand, RouteHomeCommand, RouteSettingsCommand } =
|
|
|
|
createRouteCommands(navigate, location, filePath)
|
|
|
|
commandBarActor.send({
|
|
|
|
type: 'Remove commands',
|
|
|
|
data: {
|
|
|
|
commands: [
|
|
|
|
RouteTelemetryCommand,
|
|
|
|
RouteHomeCommand,
|
|
|
|
RouteSettingsCommand,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
})
|
|
|
|
if (location.pathname === PATHS.HOME) {
|
|
|
|
commandBarActor.send({
|
|
|
|
type: 'Add commands',
|
|
|
|
data: { commands: [RouteTelemetryCommand, RouteSettingsCommand] },
|
|
|
|
})
|
|
|
|
} else if (location.pathname.includes(PATHS.FILE)) {
|
|
|
|
commandBarActor.send({
|
|
|
|
type: 'Add commands',
|
|
|
|
data: {
|
|
|
|
commands: [
|
|
|
|
RouteTelemetryCommand,
|
|
|
|
RouteSettingsCommand,
|
|
|
|
RouteHomeCommand,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// GOTCHA: If we call navigate() while in the /file route the fileMachineProvider
|
|
|
|
// has a context.project of the original one that was loaded. It does not update
|
|
|
|
// Watch when the navigation changes, if it changes set a new Project within the fileMachine
|
|
|
|
// to load the latest state of the project you are in.
|
|
|
|
if (project) {
|
|
|
|
// TODO: Clean this up with global application state when fileMachine gets merged into SystemIOMachine
|
|
|
|
send({ type: 'Refresh with new project', data: { project } })
|
|
|
|
}
|
|
|
|
}, [location])
|
|
|
|
|
2025-04-04 08:39:02 -05:00
|
|
|
const cb = modelingMenuCallbackMostActions(
|
|
|
|
settings,
|
|
|
|
navigate,
|
|
|
|
filePath,
|
|
|
|
project,
|
|
|
|
token
|
|
|
|
)
|
|
|
|
useMenuListener(cb)
|
|
|
|
|
2024-09-23 14:35:38 -04:00
|
|
|
const kclCommandMemo = useMemo(
|
|
|
|
() =>
|
Add ability to create and open URLs to create files (#4166)
* Rename `homeMachine` and accessories to `projectsMachine`
* Separate out `/home` route from `projectsMachine`
* Add logic to navigate out from deleted or renamed project
* Show a warning in the command palette for deleting a project
* Make it navigate when you create a project
* Update "New project" button to use command bar flow
Closes #2585
* More explicit warning message text
* Make projects watching code not run in web
* Tests first version: nested loops
* Tests second version: flattened
* Remove console logs
* Fix tsc
* @jtran feedback, use the type guard util
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Fix tests that relied on one-click, no-navigation project creation
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 7545b61b49dd35cbd229aa5c35273d52e5db8739.
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 3d2e48732c588b9964502b6590da139c1a0d91b0.
* Add a mask to the state indicator to client-side scale test
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Fix lint
* Fix tsc
* Add menu item to share link to file
* Forward query params while redirecting to /home or /file
* Add (broken) event logic and command triggering logic
* Fix a couple stray tests that still relied on the old way of creating projects
* De-flake another text that could be thrown off by toast-based selectors
* FMT
* Dumb test error because I was rushing
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Ahhh more flaky toasts, they're everywhere!
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Side quest: Only register commands once, power their disabled status while selecting commands via optional actor
* Get query-triggered command working in browser too
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Tests always run on localhost, don't expect the prod origin
* rerun CI
* wip
* wip
* Everything's pretty much done but url.zoo.dev has been broken and we need to think about how to test reliably
* Merge branch 'main' into franknoirot/4088/create-file-url
* Add useCreateFileLinkQuery on Home page
* Get primary user flow working on desktop
* Rework to open browser app first, then send along to the desktop app if asked
* Styling updates to OpenInDesktopAppHandler
* Clean up unecessary file
* Merge branch 'main' into franknoirot/4088/create-file-url
* Separate creating `createFileUrl` and shortlink so it is unit testable
* Add E2E test for importing file from URL
* Add a couple component tests for OpenInDesktopAppHandler
* Fix the "existing project" user flow
* Add E2E test for "add to existing project" user flow
* Undo mistaken or unecessary changes
* Lints, fmt, tsc
* Fix unit test
* Fix broken rename and delete project commands
Something about the `optionsFromContext` config no longer works with file I/O-related commands. I suspect this has to do with our read/write loop patching
* Fix unit test, use kebab-case for url query param
* Use dev urls everywhere when configured that way
I think we were just using some constants that ended up returning bad
values for dev, it seemed to return a working shortlink when I went
through the flow.
* Clean up unneeded PROD_TOKEN
* Fix browser command flow, because we had made the projectMachine desktop-only on main
* Make the test executor a bit more patient (#5004)
* Fix so that all artifact commands are returned regardless of caching (#5005)
* Fix so that all artifact commands are returned regardless of caching
* Add some more docs and fix up old ones
* Add new lint to disallow use of confusing isNaN (#4999)
* Point-and-click Sweep (first PR) (#4989)
* Refactor 'Delete selection' as actor
Will fix #4662
* WIP logging
* WIP: working Solid3dGetExtrusionFaceInfo for loft
* Working wall deletion of loft
* Add offset plane deletion
* Add feature tree deletion of shell
* Clean up
* Revert "Clean up"
This reverts commit 214763cc2bdf6227d8d8abda0f600f4ec5399327.
* Clean up rust changes, taking the sketch with the most paths
* Working cap selection and deletion
* Clean up
* Add test for loft and offset plane deletion via selection
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores)
* Set reenter: false as it was originally
* Passing test
* Add shell deletion via feature tree test
* Revert the migration to promise actor
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* Use cmd.id as solid_id after latest engine merge
* Add feature tree deletion of offset plane and fix lint
* Add feature tree deletion of loft
* Clean up
* Better comment
* Lint fix
* Remove sketch sorting
* WIP: sweep point-and-click
* Working sweep
* Add test
* Make sweep a development command
* Fix tsc error
* Clean up for review
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Upgrade typescript-eslint from 5.62.0 to 8.19.1 and remove eslint-config-react-app (#5006)
* Fix lost lints and add new ones (#5011)
* Add eslint-plugin-jsx-a11y dependency
* Add jsx-a11y lint
* Add eslint-plugin-react-hooks dependency
* Add react hooks lints
* Ignore new react hooks lint in tests
* Add eslint-plugin-testing-library dependency
* Add testing-library lint
* Fix yarn lint to use all files recursively
* Developer workflow: added auto generated workspace file from vitest extension in vscode (#4997)
* chore: added auto generated workspace file from vitest extension in vscode
* fix: auto fmt fixes
* Change Dependabot PRs to always be made on Mondays (#5025)
* Add packages to Dependabot updates (#5024)
* Bump @lezer/generator from 1.7.1 to 1.7.2 (#5018)
Bumps [@lezer/generator](https://github.com/lezer-parser/generator) from 1.7.1 to 1.7.2.
- [Changelog](https://github.com/lezer-parser/generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lezer-parser/generator/compare/1.7.1...1.7.2)
---
updated-dependencies:
- dependency-name: "@lezer/generator"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump handlebars from 6.2.0 to 6.3.0 in /src/wasm-lib (#5012)
Bumps [handlebars](https://github.com/sunng87/handlebars-rust) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/sunng87/handlebars-rust/releases)
- [Changelog](https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sunng87/handlebars-rust/compare/v6.2.0...v6.3.0)
---
updated-dependencies:
- dependency-name: handlebars
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump syn from 2.0.95 to 2.0.96 in /src/wasm-lib (#5015)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.95 to 2.0.96.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.95...2.0.96)
---
updated-dependencies:
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix artifact types to be more accurate (#5022)
* Fix Cargo.lock to not have changes (#5034)
* Upgrade all wasm-bindgen dependencies together (#5037)
* Disable auto-updater on non-versioned builds (#5042)
* turns on helix from edge (#5036)
* updates for new lib
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* autocomplete
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump version
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump all the things
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* new samples
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* docs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* ci: Add yarn test of packages/codemirror-lang-kcl (#5035)
* ci: Add yarn test of packages/codemirror-lang-kcl
* Fix CI error running tests
* Fix postcss config error
* Bump xstate from 5.17.4 to 5.19.2 (#5027)
* Hook up chamfer UI with AST-mod (#4694)
* button
* config
* hook up with ast
* cmd bar test
* button states fix and test
* little naming fix
* xState action to actor
* remove button state test updates
* fixture-based approach
* nightly
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update src/lib/toolbar.ts
Co-authored-by: Frank Noirot <frank@zoo.dev>
---------
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
* Remove Redundant Fillet Button State Test (#5009)
delete obsolete test
* Bump @types/node from 20.14.9 to 22.10.6 in /packages/codemirror-lsp-client (#5041)
* custom axis and origin example for helix (#5057)
* custom axis and origin for helix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* empty
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Bump typescript from 5.7.2 to 5.7.3 (#5021)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3)
---
updated-dependencies:
- dependency-name: typescript
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Refactor: break out `copyFileShareLink` into standalone function
* Add "Share file" to command palette
* Update dumb use of site URL instead of prod app URL
* fmt
* @lf94 nit
* @pierremtb spinner feedback
* Hide share link command and disable menu item for now
* Just comment out the command config for now
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: 49lf <ircsurfer33@gmail.com>
Co-authored-by: Adam Sunderland <iterion@gmail.com>
Co-authored-by: Adam Sunderland <adam@kittycad.io>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: max <margorskyi@gmail.com>
2025-01-23 19:18:27 -05:00
|
|
|
kclCommands({
|
2025-01-31 14:47:08 -05:00
|
|
|
authToken: token ?? '',
|
Add ability to create and open URLs to create files (#4166)
* Rename `homeMachine` and accessories to `projectsMachine`
* Separate out `/home` route from `projectsMachine`
* Add logic to navigate out from deleted or renamed project
* Show a warning in the command palette for deleting a project
* Make it navigate when you create a project
* Update "New project" button to use command bar flow
Closes #2585
* More explicit warning message text
* Make projects watching code not run in web
* Tests first version: nested loops
* Tests second version: flattened
* Remove console logs
* Fix tsc
* @jtran feedback, use the type guard util
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Fix tests that relied on one-click, no-navigation project creation
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 7545b61b49dd35cbd229aa5c35273d52e5db8739.
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 3d2e48732c588b9964502b6590da139c1a0d91b0.
* Add a mask to the state indicator to client-side scale test
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Fix lint
* Fix tsc
* Add menu item to share link to file
* Forward query params while redirecting to /home or /file
* Add (broken) event logic and command triggering logic
* Fix a couple stray tests that still relied on the old way of creating projects
* De-flake another text that could be thrown off by toast-based selectors
* FMT
* Dumb test error because I was rushing
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Ahhh more flaky toasts, they're everywhere!
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Side quest: Only register commands once, power their disabled status while selecting commands via optional actor
* Get query-triggered command working in browser too
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Tests always run on localhost, don't expect the prod origin
* rerun CI
* wip
* wip
* Everything's pretty much done but url.zoo.dev has been broken and we need to think about how to test reliably
* Merge branch 'main' into franknoirot/4088/create-file-url
* Add useCreateFileLinkQuery on Home page
* Get primary user flow working on desktop
* Rework to open browser app first, then send along to the desktop app if asked
* Styling updates to OpenInDesktopAppHandler
* Clean up unecessary file
* Merge branch 'main' into franknoirot/4088/create-file-url
* Separate creating `createFileUrl` and shortlink so it is unit testable
* Add E2E test for importing file from URL
* Add a couple component tests for OpenInDesktopAppHandler
* Fix the "existing project" user flow
* Add E2E test for "add to existing project" user flow
* Undo mistaken or unecessary changes
* Lints, fmt, tsc
* Fix unit test
* Fix broken rename and delete project commands
Something about the `optionsFromContext` config no longer works with file I/O-related commands. I suspect this has to do with our read/write loop patching
* Fix unit test, use kebab-case for url query param
* Use dev urls everywhere when configured that way
I think we were just using some constants that ended up returning bad
values for dev, it seemed to return a working shortlink when I went
through the flow.
* Clean up unneeded PROD_TOKEN
* Fix browser command flow, because we had made the projectMachine desktop-only on main
* Make the test executor a bit more patient (#5004)
* Fix so that all artifact commands are returned regardless of caching (#5005)
* Fix so that all artifact commands are returned regardless of caching
* Add some more docs and fix up old ones
* Add new lint to disallow use of confusing isNaN (#4999)
* Point-and-click Sweep (first PR) (#4989)
* Refactor 'Delete selection' as actor
Will fix #4662
* WIP logging
* WIP: working Solid3dGetExtrusionFaceInfo for loft
* Working wall deletion of loft
* Add offset plane deletion
* Add feature tree deletion of shell
* Clean up
* Revert "Clean up"
This reverts commit 214763cc2bdf6227d8d8abda0f600f4ec5399327.
* Clean up rust changes, taking the sketch with the most paths
* Working cap selection and deletion
* Clean up
* Add test for loft and offset plane deletion via selection
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores)
* Set reenter: false as it was originally
* Passing test
* Add shell deletion via feature tree test
* Revert the migration to promise actor
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* Use cmd.id as solid_id after latest engine merge
* Add feature tree deletion of offset plane and fix lint
* Add feature tree deletion of loft
* Clean up
* Better comment
* Lint fix
* Remove sketch sorting
* WIP: sweep point-and-click
* Working sweep
* Add test
* Make sweep a development command
* Fix tsc error
* Clean up for review
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Upgrade typescript-eslint from 5.62.0 to 8.19.1 and remove eslint-config-react-app (#5006)
* Fix lost lints and add new ones (#5011)
* Add eslint-plugin-jsx-a11y dependency
* Add jsx-a11y lint
* Add eslint-plugin-react-hooks dependency
* Add react hooks lints
* Ignore new react hooks lint in tests
* Add eslint-plugin-testing-library dependency
* Add testing-library lint
* Fix yarn lint to use all files recursively
* Developer workflow: added auto generated workspace file from vitest extension in vscode (#4997)
* chore: added auto generated workspace file from vitest extension in vscode
* fix: auto fmt fixes
* Change Dependabot PRs to always be made on Mondays (#5025)
* Add packages to Dependabot updates (#5024)
* Bump @lezer/generator from 1.7.1 to 1.7.2 (#5018)
Bumps [@lezer/generator](https://github.com/lezer-parser/generator) from 1.7.1 to 1.7.2.
- [Changelog](https://github.com/lezer-parser/generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lezer-parser/generator/compare/1.7.1...1.7.2)
---
updated-dependencies:
- dependency-name: "@lezer/generator"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump handlebars from 6.2.0 to 6.3.0 in /src/wasm-lib (#5012)
Bumps [handlebars](https://github.com/sunng87/handlebars-rust) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/sunng87/handlebars-rust/releases)
- [Changelog](https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sunng87/handlebars-rust/compare/v6.2.0...v6.3.0)
---
updated-dependencies:
- dependency-name: handlebars
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump syn from 2.0.95 to 2.0.96 in /src/wasm-lib (#5015)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.95 to 2.0.96.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.95...2.0.96)
---
updated-dependencies:
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix artifact types to be more accurate (#5022)
* Fix Cargo.lock to not have changes (#5034)
* Upgrade all wasm-bindgen dependencies together (#5037)
* Disable auto-updater on non-versioned builds (#5042)
* turns on helix from edge (#5036)
* updates for new lib
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* autocomplete
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump version
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump all the things
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* new samples
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* docs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* ci: Add yarn test of packages/codemirror-lang-kcl (#5035)
* ci: Add yarn test of packages/codemirror-lang-kcl
* Fix CI error running tests
* Fix postcss config error
* Bump xstate from 5.17.4 to 5.19.2 (#5027)
* Hook up chamfer UI with AST-mod (#4694)
* button
* config
* hook up with ast
* cmd bar test
* button states fix and test
* little naming fix
* xState action to actor
* remove button state test updates
* fixture-based approach
* nightly
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update src/lib/toolbar.ts
Co-authored-by: Frank Noirot <frank@zoo.dev>
---------
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
* Remove Redundant Fillet Button State Test (#5009)
delete obsolete test
* Bump @types/node from 20.14.9 to 22.10.6 in /packages/codemirror-lsp-client (#5041)
* custom axis and origin example for helix (#5057)
* custom axis and origin for helix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* empty
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Bump typescript from 5.7.2 to 5.7.3 (#5021)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3)
---
updated-dependencies:
- dependency-name: typescript
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Refactor: break out `copyFileShareLink` into standalone function
* Add "Share file" to command palette
* Update dumb use of site URL instead of prod app URL
* fmt
* @lf94 nit
* @pierremtb spinner feedback
* Hide share link command and disable menu item for now
* Just comment out the command config for now
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: 49lf <ircsurfer33@gmail.com>
Co-authored-by: Adam Sunderland <iterion@gmail.com>
Co-authored-by: Adam Sunderland <adam@kittycad.io>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: max <margorskyi@gmail.com>
2025-01-23 19:18:27 -05:00
|
|
|
projectData,
|
|
|
|
settings: {
|
2025-03-31 10:56:03 -04:00
|
|
|
defaultUnit:
|
|
|
|
settings.modeling.defaultUnit.current ??
|
|
|
|
DEFAULT_DEFAULT_LENGTH_UNIT,
|
Add ability to create and open URLs to create files (#4166)
* Rename `homeMachine` and accessories to `projectsMachine`
* Separate out `/home` route from `projectsMachine`
* Add logic to navigate out from deleted or renamed project
* Show a warning in the command palette for deleting a project
* Make it navigate when you create a project
* Update "New project" button to use command bar flow
Closes #2585
* More explicit warning message text
* Make projects watching code not run in web
* Tests first version: nested loops
* Tests second version: flattened
* Remove console logs
* Fix tsc
* @jtran feedback, use the type guard util
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Fix tests that relied on one-click, no-navigation project creation
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 7545b61b49dd35cbd229aa5c35273d52e5db8739.
* Revert "A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)"
This reverts commit 3d2e48732c588b9964502b6590da139c1a0d91b0.
* Add a mask to the state indicator to client-side scale test
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Fix lint
* Fix tsc
* Add menu item to share link to file
* Forward query params while redirecting to /home or /file
* Add (broken) event logic and command triggering logic
* Fix a couple stray tests that still relied on the old way of creating projects
* De-flake another text that could be thrown off by toast-based selectors
* FMT
* Dumb test error because I was rushing
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Ahhh more flaky toasts, they're everywhere!
* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)
* Side quest: Only register commands once, power their disabled status while selecting commands via optional actor
* Get query-triggered command working in browser too
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)
* Tests always run on localhost, don't expect the prod origin
* rerun CI
* wip
* wip
* Everything's pretty much done but url.zoo.dev has been broken and we need to think about how to test reliably
* Merge branch 'main' into franknoirot/4088/create-file-url
* Add useCreateFileLinkQuery on Home page
* Get primary user flow working on desktop
* Rework to open browser app first, then send along to the desktop app if asked
* Styling updates to OpenInDesktopAppHandler
* Clean up unecessary file
* Merge branch 'main' into franknoirot/4088/create-file-url
* Separate creating `createFileUrl` and shortlink so it is unit testable
* Add E2E test for importing file from URL
* Add a couple component tests for OpenInDesktopAppHandler
* Fix the "existing project" user flow
* Add E2E test for "add to existing project" user flow
* Undo mistaken or unecessary changes
* Lints, fmt, tsc
* Fix unit test
* Fix broken rename and delete project commands
Something about the `optionsFromContext` config no longer works with file I/O-related commands. I suspect this has to do with our read/write loop patching
* Fix unit test, use kebab-case for url query param
* Use dev urls everywhere when configured that way
I think we were just using some constants that ended up returning bad
values for dev, it seemed to return a working shortlink when I went
through the flow.
* Clean up unneeded PROD_TOKEN
* Fix browser command flow, because we had made the projectMachine desktop-only on main
* Make the test executor a bit more patient (#5004)
* Fix so that all artifact commands are returned regardless of caching (#5005)
* Fix so that all artifact commands are returned regardless of caching
* Add some more docs and fix up old ones
* Add new lint to disallow use of confusing isNaN (#4999)
* Point-and-click Sweep (first PR) (#4989)
* Refactor 'Delete selection' as actor
Will fix #4662
* WIP logging
* WIP: working Solid3dGetExtrusionFaceInfo for loft
* Working wall deletion of loft
* Add offset plane deletion
* Add feature tree deletion of shell
* Clean up
* Revert "Clean up"
This reverts commit 214763cc2bdf6227d8d8abda0f600f4ec5399327.
* Clean up rust changes, taking the sketch with the most paths
* Working cap selection and deletion
* Clean up
* Add test for loft and offset plane deletion via selection
* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores)
* Set reenter: false as it was originally
* Passing test
* Add shell deletion via feature tree test
* Revert the migration to promise actor
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* Trigger CI
* Use cmd.id as solid_id after latest engine merge
* Add feature tree deletion of offset plane and fix lint
* Add feature tree deletion of loft
* Clean up
* Better comment
* Lint fix
* Remove sketch sorting
* WIP: sweep point-and-click
* Working sweep
* Add test
* Make sweep a development command
* Fix tsc error
* Clean up for review
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Upgrade typescript-eslint from 5.62.0 to 8.19.1 and remove eslint-config-react-app (#5006)
* Fix lost lints and add new ones (#5011)
* Add eslint-plugin-jsx-a11y dependency
* Add jsx-a11y lint
* Add eslint-plugin-react-hooks dependency
* Add react hooks lints
* Ignore new react hooks lint in tests
* Add eslint-plugin-testing-library dependency
* Add testing-library lint
* Fix yarn lint to use all files recursively
* Developer workflow: added auto generated workspace file from vitest extension in vscode (#4997)
* chore: added auto generated workspace file from vitest extension in vscode
* fix: auto fmt fixes
* Change Dependabot PRs to always be made on Mondays (#5025)
* Add packages to Dependabot updates (#5024)
* Bump @lezer/generator from 1.7.1 to 1.7.2 (#5018)
Bumps [@lezer/generator](https://github.com/lezer-parser/generator) from 1.7.1 to 1.7.2.
- [Changelog](https://github.com/lezer-parser/generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lezer-parser/generator/compare/1.7.1...1.7.2)
---
updated-dependencies:
- dependency-name: "@lezer/generator"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump handlebars from 6.2.0 to 6.3.0 in /src/wasm-lib (#5012)
Bumps [handlebars](https://github.com/sunng87/handlebars-rust) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/sunng87/handlebars-rust/releases)
- [Changelog](https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sunng87/handlebars-rust/compare/v6.2.0...v6.3.0)
---
updated-dependencies:
- dependency-name: handlebars
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump syn from 2.0.95 to 2.0.96 in /src/wasm-lib (#5015)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.95 to 2.0.96.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.95...2.0.96)
---
updated-dependencies:
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix artifact types to be more accurate (#5022)
* Fix Cargo.lock to not have changes (#5034)
* Upgrade all wasm-bindgen dependencies together (#5037)
* Disable auto-updater on non-versioned builds (#5042)
* turns on helix from edge (#5036)
* updates for new lib
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* autocomplete
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump version
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* bump all the things
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* new samples
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* docs
Signed-off-by: Jess Frazelle <github@jessfraz.com>
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* ci: Add yarn test of packages/codemirror-lang-kcl (#5035)
* ci: Add yarn test of packages/codemirror-lang-kcl
* Fix CI error running tests
* Fix postcss config error
* Bump xstate from 5.17.4 to 5.19.2 (#5027)
* Hook up chamfer UI with AST-mod (#4694)
* button
* config
* hook up with ast
* cmd bar test
* button states fix and test
* little naming fix
* xState action to actor
* remove button state test updates
* fixture-based approach
* nightly
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
* Update src/lib/toolbar.ts
Co-authored-by: Frank Noirot <frank@zoo.dev>
---------
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
* Remove Redundant Fillet Button State Test (#5009)
delete obsolete test
* Bump @types/node from 20.14.9 to 22.10.6 in /packages/codemirror-lsp-client (#5041)
* custom axis and origin example for helix (#5057)
* custom axis and origin for helix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)
* empty
---------
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Bump typescript from 5.7.2 to 5.7.3 (#5021)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3)
---
updated-dependencies:
- dependency-name: typescript
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Refactor: break out `copyFileShareLink` into standalone function
* Add "Share file" to command palette
* Update dumb use of site URL instead of prod app URL
* fmt
* @lf94 nit
* @pierremtb spinner feedback
* Hide share link command and disable menu item for now
* Just comment out the command config for now
---------
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: 49lf <ircsurfer33@gmail.com>
Co-authored-by: Adam Sunderland <iterion@gmail.com>
Co-authored-by: Adam Sunderland <adam@kittycad.io>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: max <margorskyi@gmail.com>
2025-01-23 19:18:27 -05:00
|
|
|
},
|
2025-04-07 16:28:11 -04:00
|
|
|
specialPropsForInsertCommand: {
|
|
|
|
providedOptions: (isDesktop() && project?.children
|
|
|
|
? project.children
|
|
|
|
: []
|
|
|
|
).flatMap((v) => {
|
|
|
|
// TODO: add support for full tree traversal when KCL support subdir imports
|
|
|
|
const relativeFilePath = v.path.replace(
|
|
|
|
project?.path + window.electron.sep,
|
|
|
|
''
|
|
|
|
)
|
|
|
|
const isDirectory = v.children
|
|
|
|
const isCurrentFile = v.path === file?.path
|
|
|
|
return isDirectory || isCurrentFile
|
|
|
|
? []
|
|
|
|
: {
|
|
|
|
name: relativeFilePath,
|
|
|
|
value: relativeFilePath,
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
},
|
[Feature]: Load external model becomes Add file to project, global application add file to project with home page update. (#6506)
* chore: saving off skeleton
* fix: saving skeleton
* chore: skeleton for loading projects from project directory path
* chore: cleaning up useless state transition to be an on event direct to action state
* fix: new structure for web vs desktop vs react machine provider code
* chore: saving off skeleton
* fix: skeleton logic for react? going to move it from a string to obj.string
* fix: trying to prevent error element unmount on global react components. This is bricking JS state
* fix: we are so back
* chore: implemented navigating to specfic KCL file
* chore: implementing renaming project
* chore: deleting project
* fix: auto fixes
* fix: old debug/testing file oops
* chore: generic create new file
* chore: skeleton for web create file provide
* chore: basic machine vitest... need to figure out how to get window.electron implemented in vitest?
* chore: save off progress before deleting other project implementation, a few missing features still
* chore: trying a different init skeleton? most likely will migrate
* chore: first attempt of purging projects context provider
* chore: enabling toast for some machine state
* chore: enabling more toast success and error
* chore: writing read write state to the system io based on the project path
* fix: tsc fixes
* fix: use file system watcher, navigate to project after creation via the requestProjectName
* chore: open project command, hooks vs snapshot context helpers
* chore: implemented open and create project for e2e testing. They are hard coded in poor spot for now.
* fix: codespell fixes
* chore: implementing more project commands
* chore: PR improvements for root.tsx
* chore: leaving comment about new Router.tsx layout
* fix: removing debugging code
* fix: rewriting component for readability
* fix: improving web initialization
* chore: implementing import file from url which is not actually that?
* fix: clearing search params on import file from url
* fix: fixed two e2e tests, forgot needsReview when making new command
* fix: fixing some import from url business logic to pass e2e tests
* chore: script for diffing circular deps +/-
* fix: formatting
* fix: massive fix for circular depsga!
* fix: trying to fix some errors and auto fmt
* fix: updating deps
* fix: removing debugging code
* fix: big clean up
* fix: more deletion
* fix: tsc cleanup
* fix: TSC TSC TSC TSC!
* fix: typo fix
* fix: clear query params on web only, desktop not required
* fix: removing unused code
* fmt
* Bring back `trap` removed in merge
* Use explicit types instead of `any`s on arg configs
* Add project commands directly to command palette
* fix: deleting debugging code, from PR review
* fix: this got added back(?)
* fix: using referred type
* fix: more PR clean up
* fix: big block comment for xstate architecture decision
* fix: more pr comment fixes
* fix: saving off logic, need a big cleanup because I hacked it together to get a POC
* fix: extra business?
* fix: merge conflict just added them back why dude
* fix: more PR comments
* fix: big ciruclar deps fix, commandBarActor in appActor
* chore: writing e2e test, still need to fix 3 bugs
* chore: adding more scenarios
* fix: formatting
* fix: fixing tsc errors
* chore: deleting the old text to cad and using the new application level one, almost there
* fix: prompt to edit works
* fix: large push to get 1 text to cad command... the usage is a little buggy with delete and navigate within /file
* fix: settings for highlight edges now works
* chore: adding another e2e test
* fix: cleaning up e2e tests and writing more of them
* fix: tsc type
* chore: more e2e improvements, unique project name in text to cad
* chore: e2e tests should be good to go
* fix: gotcha comment
* fix: enabled web t2c, codespell fixes
* fix: fixing merge conflcits??
* feat: implemented load external for kcl samples
* feat: load external model from disk
* fix: trying to delete old stuff
* fix: all command trigger locations now have defaults for current project
* fix: gotcha comment for the future
* chore: hiding import file from url command, two separate commands for 3d and kcl file adding
* chore: commands are now add file to project, 3rd iteration
* fix: t2c in file menu fixed
* chore: updating file menu for new global actions
* fix: auto fixes
* fix: the command bar arg flow for web add kcl file seems backwards?
* chore: updated home layout, added create from kcl sample button
* chore: remapping some menu actions
* fix: fixing open dialog copy
* fix: an e2e test
* fix: fixed e2e tests
* fix: fixed e2e tests
* fix: auto fixes
* fix: pr clean up
* fix: removing console log
* fix: PR updates
* fix: the reviewed stage boolean required the expected state to change. Also I progressed the command bar too soon
* fix: no idea how this passed locally yesterday? I removed the {dir} unused but I need the function's logic but not the return value...
* fix: should be good to go?
---------
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-04-29 13:04:45 -05:00
|
|
|
}),
|
|
|
|
[codeManager, kclManager, send, project, file]
|
2024-09-23 14:35:38 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
useEffect(() => {
|
2025-01-23 10:25:21 -05:00
|
|
|
commandBarActor.send({
|
|
|
|
type: 'Add commands',
|
|
|
|
data: { commands: kclCommandMemo },
|
|
|
|
})
|
2024-09-23 14:35:38 -04:00
|
|
|
|
|
|
|
return () => {
|
2025-01-23 10:25:21 -05:00
|
|
|
commandBarActor.send({
|
2024-09-23 14:35:38 -04:00
|
|
|
type: 'Remove commands',
|
|
|
|
data: { commands: kclCommandMemo },
|
|
|
|
})
|
|
|
|
}
|
2025-01-23 10:25:21 -05:00
|
|
|
}, [commandBarActor.send, kclCommandMemo])
|
2024-09-23 14:35:38 -04:00
|
|
|
|
2023-10-16 13:28:41 -04:00
|
|
|
return (
|
|
|
|
<FileContext.Provider
|
|
|
|
value={{
|
|
|
|
send,
|
|
|
|
state,
|
|
|
|
context: state.context, // just a convenience, can remove if we need to save on memory
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</FileContext.Provider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default FileMachineProvider
|