Skip to content

Commit

Permalink
Allow under-development commands in Nightly builds (#4995)
Browse files Browse the repository at this point in the history
* Allow under-development commands in Nightly builds
Fixes #4994

* Fix warning

* Add back status: development to Revolve
  • Loading branch information
pierremtb authored Jan 10, 2025
1 parent 4fa7d2d commit 9334d64
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lib/commandBarConfigs/modelingCommandConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -337,6 +338,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',
Expand Down
3 changes: 2 additions & 1 deletion src/lib/createMachineCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/lib/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -103,7 +104,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
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:
Expand Down Expand Up @@ -161,7 +162,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
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.',
Expand Down
2 changes: 2 additions & 0 deletions src/routes/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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-' : ''
Expand Down

0 comments on commit 9334d64

Please sign in to comment.