From 7b813cf18abf862e1b0a68c471cf5180b1705cea Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 7 Jul 2025 11:18:09 -0700 Subject: [PATCH 1/3] fix: Allow workspace comments to be moved in constrained mode. --- src/actions/mover.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/actions/mover.ts b/src/actions/mover.ts index fe86c969..dc67d317 100644 --- a/src/actions/mover.ts +++ b/src/actions/mover.ts @@ -318,6 +318,10 @@ export class Mover { const info = this.moves.get(workspace); if (!info) throw new Error('no move info for workspace'); + if (info.draggable instanceof comments.RenderedWorkspaceComment) { + return this.moveUnconstrained(workspace, direction); + } + info.dragger.onDrag( info.fakePointerEvent('pointermove', direction), info.totalDelta.clone().scale(workspace.scale), From 1a79c160c4ddbc6c8b80ceb77fd88bfcc363fba6 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 7 Jul 2025 15:33:43 -0700 Subject: [PATCH 2/3] chore: Add test for moving workspace comments in constrained mode. --- test/webdriverio/test/workspace_comment_test.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/webdriverio/test/workspace_comment_test.ts b/test/webdriverio/test/workspace_comment_test.ts index f0e14557..b6701e84 100644 --- a/test/webdriverio/test/workspace_comment_test.ts +++ b/test/webdriverio/test/workspace_comment_test.ts @@ -189,7 +189,7 @@ suite('Workspace comment navigation', function () { ); }); - test('Workspace comments can be moved', async function () { + test('Workspace comments can be moved in unconstrained mode', async function () { await focusOnWorkspaceComment(this.browser, this.commentId1); const initialPosition = await this.getCommentLocation(this.commentId1); @@ -203,4 +203,19 @@ suite('Workspace comment navigation', function () { const newPosition = await this.getCommentLocation(this.commentId1); chai.assert.deepEqual(newPosition, [220, 240]); }); + + test('Workspace comments can be moved in constrained mode', async function () { + await focusOnWorkspaceComment(this.browser, this.commentId1); + + const initialPosition = await this.getCommentLocation(this.commentId1); + chai.assert.deepEqual(initialPosition, [200, 200]); + + await sendKeyAndWait(this.browser, 'm'); + await sendKeyAndWait(this.browser, Key.ArrowUp, 2); + await sendKeyAndWait(this.browser, Key.ArrowLeft); + await sendKeyAndWait(this.browser, Key.Enter); + + const newPosition = await this.getCommentLocation(this.commentId1); + chai.assert.deepEqual(newPosition, [180, 160]); + }); }); From ddeb2a700971f20560ba9d974f6bb1ee6c4642c6 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 7 Jul 2025 15:38:21 -0700 Subject: [PATCH 3/3] refactor: Use arrow wrapper functions in test. --- test/webdriverio/test/workspace_comment_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/webdriverio/test/workspace_comment_test.ts b/test/webdriverio/test/workspace_comment_test.ts index b6701e84..827aac31 100644 --- a/test/webdriverio/test/workspace_comment_test.ts +++ b/test/webdriverio/test/workspace_comment_test.ts @@ -211,8 +211,8 @@ suite('Workspace comment navigation', function () { chai.assert.deepEqual(initialPosition, [200, 200]); await sendKeyAndWait(this.browser, 'm'); - await sendKeyAndWait(this.browser, Key.ArrowUp, 2); - await sendKeyAndWait(this.browser, Key.ArrowLeft); + await keyUp(this.browser, 2); + await keyLeft(this.browser); await sendKeyAndWait(this.browser, Key.Enter); const newPosition = await this.getCommentLocation(this.commentId1);