ArtifactMap should be processed at the end of an execution (PART 2) (#3121)

* seperate out artifactmap functions into seperate file, change types quiet a bit with e2e still passing

* more type changes

* another increment

* cull artifact map

* remove excessive parentIds

* rename props

* final clean up

* unused vars
This commit is contained in:
Kurt Hutten
2024-07-25 19:03:56 +10:00
committed by GitHub
parent c184a7d4d8
commit 95781143eb
12 changed files with 363 additions and 290 deletions

View File

@ -108,21 +108,21 @@ export async function getEventForSelectWithPoint(
}
const sourceRange = _artifact?.range
if (_artifact) {
if (_artifact.commandType === 'solid3d_get_extrusion_face_info') {
if (_artifact?.additionalData)
return {
type: 'Set selection',
data: {
selectionType: 'singleCodeCursor',
selection: {
range: sourceRange,
type:
_artifact?.additionalData.info === 'end'
? 'end-cap'
: 'start-cap',
},
if (_artifact.type === 'extrudeCap')
return {
type: 'Set selection',
data: {
selectionType: 'singleCodeCursor',
selection: {
range: sourceRange,
type:
_artifact?.additionalData.info === 'end'
? 'end-cap'
: 'start-cap',
},
}
},
}
if (_artifact.type === 'extrudeWall')
return {
type: 'Set selection',
data: {
@ -130,7 +130,6 @@ export async function getEventForSelectWithPoint(
selection: { range: sourceRange, type: 'extrude-wall' },
},
}
}
return {
type: 'Set selection',
data: {
@ -519,16 +518,13 @@ function codeToIdSelections(
let bestCandidate
entriesWithOverlap.forEach((entry) => {
if (!entry) return
if (
type === 'default' &&
entry.artifact.commandType === 'extend_path'
) {
if (type === 'default' && entry.artifact.type === 'segment') {
bestCandidate = entry
return
}
if (
type === 'start-cap' &&
entry.artifact.commandType === 'solid3d_get_extrusion_face_info' &&
entry.artifact.type === 'extrudeCap' &&
entry?.artifact?.additionalData?.info === 'start'
) {
bestCandidate = entry
@ -536,16 +532,13 @@ function codeToIdSelections(
}
if (
type === 'end-cap' &&
entry.artifact.commandType === 'solid3d_get_extrusion_face_info' &&
entry.artifact.type === 'extrudeCap' &&
entry?.artifact?.additionalData?.info === 'end'
) {
bestCandidate = entry
return
}
if (
type === 'extrude-wall' &&
entry.artifact.commandType === 'solid3d_get_extrusion_face_info'
) {
if (type === 'extrude-wall' && entry.artifact.type === 'extrudeWall') {
bestCandidate = entry
return
}