From ada94e95c7b7af678a512f0f542f8a24dd60df04 Mon Sep 17 00:00:00 2001 From: Pierre Jacquier Date: Fri, 10 Jan 2025 09:43:37 -0500 Subject: [PATCH 1/3] Allow under-development commands in Nightly builds Fixes #4994 --- src/lib/commandBarConfigs/modelingCommandConfig.ts | 2 ++ src/lib/createMachineCommand.ts | 3 ++- src/lib/toolbar.ts | 5 +++-- src/routes/Settings.tsx | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/commandBarConfigs/modelingCommandConfig.ts b/src/lib/commandBarConfigs/modelingCommandConfig.ts index d7d79beb3d..a429d4d3b0 100644 --- a/src/lib/commandBarConfigs/modelingCommandConfig.ts +++ b/src/lib/commandBarConfigs/modelingCommandConfig.ts @@ -343,6 +343,8 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig< selectionTypes: ['segment', 'sweepEdge', 'edgeCutEdge'], multiple: false, validation: revolveAxisValidator, + warningMessage: + 'Revolve only works with edges now, not with arbitrary axis. This is under development.', }, angle: { inputType: 'kcl', diff --git a/src/lib/createMachineCommand.ts b/src/lib/createMachineCommand.ts index abd0c5917b..8145585963 100644 --- a/src/lib/createMachineCommand.ts +++ b/src/lib/createMachineCommand.ts @@ -15,6 +15,7 @@ import { StateMachineCommandSetSchema, } from './commandTypes' import { DEV } from 'env' +import { IS_NIGHTLY_OR_DEBUG } from 'routes/Settings' interface CreateMachineCommandProps< T extends AnyStateMachine, @@ -84,7 +85,7 @@ export function createMachineCommand< } else if ('status' in commandConfig) { const { status } = commandConfig if (status === 'inactive') return null - if (status === 'development' && !DEV) return null + if (status === 'development' && !(DEV || IS_NIGHTLY_OR_DEBUG)) return null } const icon = ('icon' in commandConfig && commandConfig.icon) || undefined diff --git a/src/lib/toolbar.ts b/src/lib/toolbar.ts index ddc68f0590..ac68ff6783 100644 --- a/src/lib/toolbar.ts +++ b/src/lib/toolbar.ts @@ -8,6 +8,7 @@ import { modelingMachine, pipeHasCircle, } from 'machines/modelingMachine' +import { IS_NIGHTLY_OR_DEBUG } from 'routes/Settings' import { EventFrom, StateFrom } from 'xstate' export type ToolbarModeName = 'modeling' | 'sketching' @@ -103,7 +104,7 @@ export const toolbarConfig: Record = { data: { name: 'Revolve', groupId: 'modeling' }, }), icon: 'revolve', - status: DEV ? 'available' : 'kcl-only', + status: DEV || IS_NIGHTLY_OR_DEBUG ? 'available' : 'kcl-only', title: 'Revolve', hotkey: 'R', description: @@ -161,7 +162,7 @@ export const toolbarConfig: Record = { data: { name: 'Fillet', groupId: 'modeling' }, }), icon: 'fillet3d', - status: DEV ? 'available' : 'kcl-only', + status: DEV || IS_NIGHTLY_OR_DEBUG ? 'available' : 'kcl-only', title: 'Fillet', hotkey: 'F', description: 'Round the edges of a 3D solid.', diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx index cb1808cd97..a89e2ac72b 100644 --- a/src/routes/Settings.tsx +++ b/src/routes/Settings.tsx @@ -32,6 +32,8 @@ export const PACKAGE_NAME = isDesktop() export const IS_NIGHTLY = PACKAGE_NAME.indexOf('-nightly') > -1 +export const IS_NIGHTLY_OR_DEBUG = IS_NIGHTLY || APP_VERSION === '0.0.0' + export function getReleaseUrl(version: string = APP_VERSION) { return `https://github.com/KittyCAD/modeling-app/releases/tag/${ IS_NIGHTLY ? 'nightly-' : '' From 6b64eaedc00cdd30d316131dbdb9be6f8e978a30 Mon Sep 17 00:00:00 2001 From: Pierre Jacquier Date: Fri, 10 Jan 2025 09:58:31 -0500 Subject: [PATCH 2/3] Fix warning --- src/lib/commandBarConfigs/modelingCommandConfig.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/commandBarConfigs/modelingCommandConfig.ts b/src/lib/commandBarConfigs/modelingCommandConfig.ts index 424d55aa84..7dd341420b 100644 --- a/src/lib/commandBarConfigs/modelingCommandConfig.ts +++ b/src/lib/commandBarConfigs/modelingCommandConfig.ts @@ -337,6 +337,8 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig< multiple: false, // TODO: multiple selection required: true, skip: true, + warningMessage: + 'The revolve workflow is new and under tested. Please break it and report issues.', }, axisOrEdge: { inputType: 'options', @@ -367,8 +369,6 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig< selectionTypes: ['segment', 'sweepEdge', 'edgeCutEdge'], multiple: false, validation: revolveAxisValidator, - warningMessage: - 'Revolve only works with edges now, not with arbitrary axis. This is under development.', }, angle: { inputType: 'kcl', From c8ff6fa1f0d8798adabfb53e91472b56ff319f05 Mon Sep 17 00:00:00 2001 From: Pierre Jacquier Date: Fri, 10 Jan 2025 10:52:50 -0500 Subject: [PATCH 3/3] Add back status: development to Revolve --- src/lib/commandBarConfigs/modelingCommandConfig.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/commandBarConfigs/modelingCommandConfig.ts b/src/lib/commandBarConfigs/modelingCommandConfig.ts index 7dd341420b..e336d6c8cd 100644 --- a/src/lib/commandBarConfigs/modelingCommandConfig.ts +++ b/src/lib/commandBarConfigs/modelingCommandConfig.ts @@ -329,6 +329,7 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig< Revolve: { description: 'Create a 3D body by rotating a sketch region about an axis.', icon: 'revolve', + status: 'development', needsReview: true, args: { selection: {