Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node not being draggable #8435

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/gui2/src/components/CodeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { usePointer } from '@/util/events'
import { chain } from '@/util/iterable'
import { useLocalStorage } from '@vueuse/core'
import { rangeEncloses, type ExprId } from 'shared/yjsModel'
import { computed, onMounted, ref, watchEffect } from 'vue'
import { computed, onMounted, ref, watch, watchEffect } from 'vue'
import { qnJoin, tryQualifiedName } from '../util/qualifiedName'
import { unwrap } from '../util/result'

Expand All @@ -27,6 +27,7 @@ const {
tooltips,
enso,
linter,
forceLinting,
lsDiagnosticsToCMDiagnostics,
hoverTooltip,
} = await import('@/util/codemirror')
Expand Down Expand Up @@ -157,6 +158,8 @@ watchEffect(() => {
)
})

watch([executionContextDiagnostics, expressionUpdatesDiagnostics], () => forceLinting(editorView))

onMounted(() => {
editorView.focus()
rootElement.value?.prepend(editorView.dom)
Expand Down
2 changes: 1 addition & 1 deletion app/gui2/src/components/GraphEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,13 @@ function handleNodeOutputPortDoubleClick(id: ExprId) {
@forward="console.log('breadcrumbs \'forward\' button clicked.')"
@execute="onPlayButtonPress()"
/>
<PlusButton @pointerdown="interaction.setCurrent(creatingNodeFromButton)" />
<Transition>
<Suspense ref="codeEditorArea">
<CodeEditor v-if="showCodeEditor" />
</Suspense>
</Transition>
<GraphMouse />
<PlusButton @pointerdown="interaction.setCurrent(creatingNodeFromButton)" />
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion app/gui2/src/components/GraphEditor/GraphNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function portGroupStyle(port: PortData) {
@update:id="emit('update:visualizationId', $event)"
@update:visible="emit('update:visualizationVisible', $event)"
/>
<div class="node" @keydown="nodeEditHandler">
<div class="node" @keydown="nodeEditHandler" v-on="dragPointer.events">
<SvgIcon class="icon grab-handle" :name="icon"></SvgIcon>
<div ref="contentNode" class="widget-tree">
<NodeWidgetTree :ast="node.rootSpan" />
Expand Down
2 changes: 1 addition & 1 deletion app/gui2/src/util/codemirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export {
foldNodeProp,
syntaxHighlighting,
} from '@codemirror/language'
export { lintGutter, linter, type Diagnostic } from '@codemirror/lint'
export { forceLinting, lintGutter, linter, type Diagnostic } from '@codemirror/lint'
export { highlightSelectionMatches } from '@codemirror/search'
export { EditorState } from '@codemirror/state'
export { EditorView, tooltips, type TooltipView } from '@codemirror/view'
Expand Down