#5184 Ability to toggle default planes visibility (#6333)

* add first version of DefaultPlanes to FeatureTreePane

* fix lint issues

* don't show default planes UI in sketch mode

* lint

* toggling default planes: implementation in xstate

* revert malformed modelingMachine.ts

* lint

* save and restore default plane visibility when returning to modeling mode

* fmt

* tsc

* introduce new cleanup state with actor when exiting sketch mode

* temp remove restore default plane visibility - causes error on starting up a project

* set selection filter after executeAst - this is a wip hacky fix

* remove unused early return: this also caused plane selection to only work with double click

* lint

* no need to set selection filter to curves only, we want faces to be selectable in modeling mode, even though this means default planes are also selectable

* tightening types for visibility map

* lint

* cleanups

* fix border issue when visibility toggle is not active and props.visible === true

* ui updates on FeatureTreePane/default planes

* no pointer cursor for unselectable default planes

* show default planes initially even for non-empty projects

* dont show default planes initially when project is not empty

* fix test: Only show axis planes when there are no errors

* fixes for sketch tests

* better initialize for planes

* lint

* fix uneccessary 'reset camera position' in sketch entry

* revert hiding/showing content depending on artifact graph for tests

* only show default planes when there are no errors

* disable Restore default plane visibility, was causing temporary flashing of default planes when exiting sketch mode

* Always show default plane visibility toggles, regardless of being on/off

* revert modelingMachine to original idle states to avoid 'zoom_to_fit' test regression - probably racing condition

* fmt
This commit is contained in:
Andrew Varga
2025-04-25 18:21:19 +02:00
committed by GitHub
parent 885d2afaa3
commit fe22a67cf6
4 changed files with 202 additions and 53 deletions

View File

@ -19,7 +19,6 @@ import { err, reportRejection, trap } from '@src/lib/trap'
import type { IndexLoaderData } from '@src/lib/types'
import { uuidv4 } from '@src/lib/utils'
import { engineStreamActor, useSettings } from '@src/lib/singletons'
import { useCommandBarState } from '@src/lib/singletons'
import {
EngineStreamState,
EngineStreamTransition,
@ -58,8 +57,6 @@ export const EngineStream = (props: {
const { state: modelingMachineState, send: modelingMachineActorSend } =
useModelingContext()
const commandBarState = useCommandBarState()
const streamIdleMode = settings.app.streamIdleMode.current
const startOrReconfigureEngine = () => {
@ -332,15 +329,7 @@ export const EngineStream = (props: {
if (!engineStreamState.context.videoRef.current) return
// If we're in sketch mode, don't send a engine-side select event
if (modelingMachineState.matches('Sketch')) return
// Only respect default plane selection if we're on a selection command argument
if (
modelingMachineState.matches({ idle: 'showPlanes' }) &&
!(
commandBarState.matches('Gathering arguments') &&
commandBarState.context.currentArgument?.inputType === 'selection'
)
)
return
// If we're mousing up from a camera drag, don't send a select event
if (sceneInfra.camControls.wasDragging === true) return
@ -361,7 +350,6 @@ export const EngineStream = (props: {
!isNetworkOkay ||
!engineStreamState.context.videoRef.current ||
modelingMachineState.matches('Sketch') ||
modelingMachineState.matches({ idle: 'showPlanes' }) ||
sceneInfra.camControls.wasDragging === true ||
!btnName(e.nativeEvent).left
) {