Onboarding updates (#1967)
* Make onboarding line references dynamic and error if they aren't found Fixes https://github.com/KittyCAD/modeling-app/issues/1918 * More clear and correct Sketch onboarding step Fixes https://github.com/KittyCAD/modeling-app/issues/1790 Fixes https://github.com/KittyCAD/modeling-app/issues/1789 * Make sample code line references dynamic and error on app start if they break so we can know before release Fixes https://github.com/KittyCAD/modeling-app/issues/1918 * Better error message for searchText failure * JB onboarding feedback * Make list more explicit, instruct to hold down key first
This commit is contained in:
@ -34,5 +34,28 @@ const bracket = startSketchOn('XY')
|
||||
|> fillet({
|
||||
radius: filletR + thickness,
|
||||
tags: [getNextAdjacentEdge('outerEdge', %)]
|
||||
}, %)
|
||||
`
|
||||
}, %)`
|
||||
|
||||
function findLineInExampleCode({
|
||||
searchText,
|
||||
example = bracket,
|
||||
}: {
|
||||
searchText: string
|
||||
example?: string
|
||||
}) {
|
||||
const lines = example.split('\n')
|
||||
const lineNumber = lines.findIndex((l) => l.includes(searchText)) + 1
|
||||
if (lineNumber === 0) {
|
||||
throw new Error(
|
||||
`Could not find the line with search text "${searchText}" in the example code. Was it removed?`
|
||||
)
|
||||
}
|
||||
return lineNumber
|
||||
}
|
||||
|
||||
export const bracketWidthConstantLine = findLineInExampleCode({
|
||||
searchText: 'const width',
|
||||
})
|
||||
export const bracketThicknessCalculationLine = findLineInExampleCode({
|
||||
searchText: 'const thickness',
|
||||
})
|
||||
|
Reference in New Issue
Block a user