mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 01:21:33 +03:00
Top-level add-node button creates disconnected component. (#10416)
Closes #10389.
This commit is contained in:
parent
764259f36d
commit
2168cfdf6b
@ -39,16 +39,16 @@ test('Different ways of opening Component Browser', async ({ page }) => {
|
||||
// (+) button
|
||||
await locate.addNewNodeButton(page).click()
|
||||
await expectAndCancelBrowser(page, '')
|
||||
// (+) button with selection (ignored)
|
||||
await locate.graphNodeByBinding(page, 'final').click()
|
||||
await locate.addNewNodeButton(page).click()
|
||||
await expectAndCancelBrowser(page, '')
|
||||
// Enter key
|
||||
await locate.graphEditor(page).press('Enter')
|
||||
await expectAndCancelBrowser(page, '')
|
||||
|
||||
// With source node
|
||||
|
||||
// (+) button
|
||||
await locate.graphNodeByBinding(page, 'final').click()
|
||||
await locate.addNewNodeButton(page).click()
|
||||
await expectAndCancelBrowser(page, '', 'final')
|
||||
// Enter key
|
||||
await locate.graphNodeByBinding(page, 'final').click()
|
||||
await locate.graphEditor(page).press('Enter')
|
||||
@ -117,7 +117,7 @@ test('Graph Editor pans to Component Browser', async ({ page }) => {
|
||||
})
|
||||
|
||||
test('Accepting suggestion', async ({ page }) => {
|
||||
// Clicking enry
|
||||
// Clicking entry
|
||||
await actions.goToGraph(page)
|
||||
await locate.addNewNodeButton(page).click()
|
||||
let nodeCount = await locate.graphNode(page).count()
|
||||
|
@ -496,6 +496,11 @@ function addNodeAuto() {
|
||||
createWithComponentBrowser(fromSelection() ?? { placement: { type: 'viewport' } })
|
||||
}
|
||||
|
||||
function addNodeDisconnected() {
|
||||
nodeSelection.deselectAll()
|
||||
createWithComponentBrowser({ placement: { type: 'viewport' } })
|
||||
}
|
||||
|
||||
function fromSelection(): NewNodeOptions | undefined {
|
||||
if (graphStore.editedNodeInfo != null) return undefined
|
||||
const firstSelectedNode = set.first(nodeSelection.selected)
|
||||
@ -715,7 +720,7 @@ const groupColors = computed(() => {
|
||||
@collapseNodes="collapseNodes"
|
||||
@removeNodes="deleteSelected"
|
||||
/>
|
||||
<PlusButton title="Add Component" @click.stop="addNodeAuto()" />
|
||||
<PlusButton title="Add Component" @click.stop="addNodeDisconnected()" />
|
||||
<Transition>
|
||||
<Suspense ref="codeEditorArea">
|
||||
<CodeEditor v-if="showCodeEditor" @close="showCodeEditor = false" />
|
||||
|
Loading…
Reference in New Issue
Block a user