Skip to content

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Aug 31, 2025

Summary

  • Fixes ctrl+scroll zoom when cursor is over video/image previews
  • Fixes space+drag panning when cursor is over video/image previews
  • Preserves existing drag behavior for node manipulation

Technical Details

  • Extended useCanvasInteractions composable with handlePointer method
  • Added event listeners to video elements in useNodeVideo
  • Uses existing canvas space key detection (read_only property)
  • Follows established canvas store patterns
2025-08-30.21-00-05_processed_20250830_210057.mp4

Related:

┆Issue is synchronized with this Notion page by Unito

…oom and space+drag panning

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@christian-byrne christian-byrne requested review from a team as code owners August 31, 2025 04:12
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 31, 2025
@github-actions
Copy link

github-actions bot commented Aug 31, 2025

🎭 Playwright Test Results

All tests passed across all browsers!

⏰ Completed at: 09/03/2025, 04:35:39 AM UTC

📊 Test Reports by Browser


🎉 Your tests are passing across all browsers!

@github-actions
Copy link

🎨 Storybook Build Status

comfy-loading-gif Build is starting...

⏰ Started at: 08/31/2025, 04:12:59 AM UTC

🚀 Building Storybook

  • 📦 Installing dependencies...
  • 🔧 Building Storybook components...
  • 🎨 Running Chromatic visual tests...

⏱️ Please wait while the Storybook build is in progress...

@github-actions
Copy link

🎨 Storybook Build Status

Build failed!

⏰ Completed at: 08/31/2025, 04:12:59 AM UTC

🔗 Links


⚠️ Please check the workflow logs for error details.

DrJKL
DrJKL previously approved these changes Sep 1, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love all the casting, but it's definitely better 👍🏻

DrJKL
DrJKL previously approved these changes Sep 2, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still good, getting even better

… tests

- Replace 'as any' with vi.mocked({partial: true}) for store mocks
- Use 'satisfies Partial<Event>' for better event type checking
- Remove 'not.toThrow' test as it tests default behavior
- Improve test readability and type safety per review feedback
- Replace vague 'graceful handling' test with specific 'early return' test
- Verify that getCanvas() is actually called to check canvas existence
- Test early return behavior when canvas is null rather than just preventDefault side effect
- More robust test that validates the intended logic flow
DrJKL
DrJKL previously approved these changes Sep 3, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@DrJKL DrJKL assigned christian-byrne and unassigned DrJKL Sep 3, 2025
- Replace global mockGetCanvas and mockGet with in-situ vi.mocked() calls
- Extract store functions directly in test cases for better locality
- Follow DrJKL's suggestion for cleaner test structure
- Maintains same test coverage with improved readability
@christian-byrne christian-byrne merged commit e1f2946 into main Sep 3, 2025
11 checks passed
@christian-byrne christian-byrne deleted the fix/media-gesture-passthrough branch September 3, 2025 19:01
@benceruleanlu benceruleanlu mentioned this pull request Sep 4, 2025
snomiao pushed a commit that referenced this pull request Sep 12, 2025
* [fix] Enable mouse gestures over video previews - fixes ctrl+scroll zoom and space+drag panning

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* [improve] Enhance code clarity in media gesture handling with descriptive constants

* [clean] Remove dangling comment in handlePointer method

* [improve] Use satisfies and partial mocking for better type safety in tests

- Replace 'as any' with vi.mocked({partial: true}) for store mocks
- Use 'satisfies Partial<Event>' for better event type checking
- Remove 'not.toThrow' test as it tests default behavior
- Improve test readability and type safety per review feedback

* [improve] Test actual canvas existence check instead of side effects

- Replace vague 'graceful handling' test with specific 'early return' test
- Verify that getCanvas() is actually called to check canvas existence
- Test early return behavior when canvas is null rather than just preventDefault side effect
- More robust test that validates the intended logic flow

* [refactor] Use localized mocking instead of global mock functions

- Replace global mockGetCanvas and mockGet with in-situ vi.mocked() calls
- Extract store functions directly in test cases for better locality
- Follow DrJKL's suggestion for cleaner test structure
- Maintains same test coverage with improved readability

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:previews size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants