diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d069963cbb..b1947a7fe64d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - [Fixed "rename project" button being broken after not changing project name][11103] - [Numbers starting with dot (`.5`) are accepted in Numeric Widget][11108] +- [Add support for interacting with graph editor using touch devices.][11056] [10774]: https://github.com/enso-org/enso/pull/10774 [10814]: https://github.com/enso-org/enso/pull/10814 @@ -35,6 +36,7 @@ [11030]: https://github.com/enso-org/enso/pull/11030 [11103]: https://github.com/enso-org/enso/pull/11103 [11108]: https://github.com/enso-org/enso/pull/11108 +[11056]: https://github.com/enso-org/enso/pull/11056 #### Enso Standard Library diff --git a/app/dashboard/src/components/aria.tsx b/app/dashboard/src/components/aria.tsx index d253b1d3badc..d7217fe9e7c1 100644 --- a/app/dashboard/src/components/aria.tsx +++ b/app/dashboard/src/components/aria.tsx @@ -3,7 +3,6 @@ import type { Mutable } from 'enso-common/src/utilities/data/object' import * as aria from 'react-aria' export type * from '@react-types/shared' -// @ts-expect-error The conflicting exports are props types ONLY. export * from 'react-aria' // @ts-expect-error The conflicting exports are props types ONLY. export * from 'react-aria-components' diff --git a/app/gui2/package.json b/app/gui2/package.json index c148cd19cde5..395f007346f0 100644 --- a/app/gui2/package.json +++ b/app/gui2/package.json @@ -63,6 +63,7 @@ "@noble/hashes": "^1.4.0", "@tanstack/vue-query": ">= 5.54.0 < 5.56.0", "@vueuse/core": "^10.4.1", + "@vueuse/gesture": "^2.0.0", "ag-grid-community": "^30.2.1", "ag-grid-enterprise": "^30.2.1", "ag-grid-vue3": "^30.2.1", diff --git a/app/gui2/playwright.config.ts b/app/gui2/playwright.config.ts index ba778fe6eff0..31dd4fb931da 100644 --- a/app/gui2/playwright.config.ts +++ b/app/gui2/playwright.config.ts @@ -29,6 +29,7 @@ function checkAvailablePort(port: number) { const portFromEnv = parseInt(process.env.PLAYWRIGHT_PORT ?? '', 10) const PORT = Number.isFinite(portFromEnv) ? portFromEnv : await findFreePortInRange(4300, 4999) +console.log(`Selected playwright server port: ${PORT}`) // Make sure to set the env to actual port that is being used. This is necessary for workers to // pick up the same configuration. process.env.PLAYWRIGHT_PORT = `${PORT}` @@ -117,7 +118,7 @@ export default defineConfig({ `corepack pnpm build && corepack pnpm exec vite preview --port ${PORT} --strictPort` : `corepack pnpm exec vite dev --port ${PORT}`, // Build from scratch apparently can take a while on CI machines. - timeout: 120 * 1000, + timeout: 240 * 1000, port: PORT, // We use our special, mocked version of server, thus do not want to re-use user's one. reuseExistingServer: false, diff --git a/app/gui2/src/components/GraphEditor.vue b/app/gui2/src/components/GraphEditor.vue index d82888ff5428..435b24f60c8e 100644 --- a/app/gui2/src/components/GraphEditor.vue +++ b/app/gui2/src/components/GraphEditor.vue @@ -724,15 +724,7 @@ const documentationEditorFullscreen = ref(false) @drop.prevent="handleFileDrop($event)" >
-
+
selection.selected.size > 0 }, ) @@ -70,6 +71,7 @@ const graphNodeSelections = shallowRef() @delete="graphStore.deleteNodes([id])" @dragging="nodeIsDragged(id, $event)" @draggingCommited="dragging.finishDrag()" + @draggingCancelled="dragging.cancelDrag()" @outputPortClick="(event, port) => graphStore.createEdgeFromOutput(port, event)" @outputPortDoubleClick="(_event, port) => emit('nodeOutputPortDoubleClick', port)" @doubleClick="emit('nodeDoubleClick', id)" diff --git a/app/gui2/src/components/GraphEditor/dragging.ts b/app/gui2/src/components/GraphEditor/dragging.ts index 270847b9e868..2945a7c96ea4 100644 --- a/app/gui2/src/components/GraphEditor/dragging.ts +++ b/app/gui2/src/components/GraphEditor/dragging.ts @@ -158,6 +158,16 @@ export function useDragging() { this.stopPositionUpdate() this.updateNodesPosition() } + cancelDragging(): void { + console.log('cancelDragging') + this.stopPositionUpdate() + offset.value = Vec2.Zero + snapXTarget.value = 0 + snapYTarget.value = 0 + snapX.skip() + snapY.skip() + this.updateNodesPosition() + } createSnapGrid() { const nonDraggedRects = computed(() => { @@ -198,5 +208,9 @@ export function useDragging() { currentDrag?.finishDragging() currentDrag = undefined }, + cancelDrag() { + currentDrag?.cancelDragging() + currentDrag = undefined + }, } } diff --git a/app/gui2/src/components/GraphMouse.vue b/app/gui2/src/components/GraphMouse.vue index 3abe79375086..fb0975bf6aff 100644 --- a/app/gui2/src/components/GraphMouse.vue +++ b/app/gui2/src/components/GraphMouse.vue @@ -12,6 +12,7 @@ const scaledMousePos = computed( () => navigator?.sceneMousePos?.scale(navigator?.scale ?? 1) ?? Vec2.Zero, ) const scaledSelectionAnchor = computed(() => nodeSelection?.anchor?.scale(navigator?.scale ?? 1)) +const scaledSelectionFocus = computed(() => nodeSelection?.focus?.scale(navigator?.scale ?? 1)) const isNativeDragging = ref(0) useEvent( @@ -44,7 +45,7 @@ useEvent( diff --git a/app/gui2/src/components/ResizeHandles.vue b/app/gui2/src/components/ResizeHandles.vue index 100942d2c46c..f3d63de9c238 100644 --- a/app/gui2/src/components/ResizeHandles.vue +++ b/app/gui2/src/components/ResizeHandles.vue @@ -37,6 +37,10 @@ function resizeHandler(resizeX: 'left' | 'right' | false, resizeY: 'top' | 'bott case 'stop': emit('update:resizing', {}) break + case 'cancel': + if (initialBounds) bounds.value = initialBounds + emit('update:resizing', {}) + break } }) } diff --git a/app/gui2/src/components/ScrollBar.vue b/app/gui2/src/components/ScrollBar.vue index e57e074cee37..4066c29ca653 100644 --- a/app/gui2/src/components/ScrollBar.vue +++ b/app/gui2/src/components/ScrollBar.vue @@ -78,6 +78,11 @@ function dragEventsHandler(axis: 'x' | 'y') { emit('scroll', { type: 'stop' }) break } + case 'cancel': { + emit('scroll', { type: 'move', startOffset: Vec2.Zero }) + emit('scroll', { type: 'stop' }) + break + } } return true }) diff --git a/app/gui2/src/components/SelectionBrush.vue b/app/gui2/src/components/SelectionBrush.vue index 3c8219f72c91..554102026e2e 100644 --- a/app/gui2/src/components/SelectionBrush.vue +++ b/app/gui2/src/components/SelectionBrush.vue @@ -1,17 +1,17 @@