don't allow edit on sketches with no variable declaration (#3292)

don't allow edit on sketches with no variable decleration
This commit is contained in:
Kurt Hutten
2024-08-06 16:17:30 +10:00
committed by GitHub
parent d27afb8c74
commit ffe0da6dcd
3 changed files with 4 additions and 0 deletions

View File

@ -791,6 +791,7 @@ export function isSingleCursorInPipe(
const pathToNode = getNodePathFromSourceRange(ast, selection.range) const pathToNode = getNodePathFromSourceRange(ast, selection.range)
const nodeTypes = pathToNode.map(([, type]) => type) const nodeTypes = pathToNode.map(([, type]) => type)
if (nodeTypes.includes('FunctionExpression')) return false if (nodeTypes.includes('FunctionExpression')) return false
if (!nodeTypes.includes('VariableDeclaration')) return false
if (nodeTypes.includes('PipeExpression')) return true if (nodeTypes.includes('PipeExpression')) return true
return false return false
} }

View File

@ -458,6 +458,9 @@ async function GraphTheGraph(
await page.waitForSelector('#plotly-graph') await page.waitForSelector('#plotly-graph')
const element = await page.$('#plotly-graph') const element = await page.$('#plotly-graph')
// wait an extra bit for things to settle
await new Promise((resolve) => setTimeout(resolve, 500))
// @ts-ignore // @ts-ignore
await element.screenshot({ await element.screenshot({
path: `./e2e/playwright/temp3.png`, path: `./e2e/playwright/temp3.png`,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 182 KiB