Skip to content

feat(studio): support preview panning with mouse and trackpad#888

Open
func25 wants to merge 3 commits into
heygen-com:mainfrom
func25:preview-pan-overscroll
Open

feat(studio): support preview panning with mouse and trackpad#888
func25 wants to merge 3 commits into
heygen-com:mainfrom
func25:preview-pan-overscroll

Conversation

@func25
Copy link
Copy Markdown
Contributor

@func25 func25 commented May 16, 2026

What

Add middle-mouse and trackpad panning to the Studio preview.

Why

These are the convenient and standard ways to move around the preview in many visualization platforms.

How

  • Keep preview pan in the existing preview camera layer.
  • Handle middle mouse drag through the existing pointer pan path.
  • Handle two-finger pan through the preview wheel path.
  • Keep pan clamped to the preview content surface, with a small overscroll margin so it does not hard-stop at the edge.

Test plan

How was this tested?

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)

@miguel-heygen
Copy link
Copy Markdown
Collaborator

can you share a video testing it pls?

@func25
Copy link
Copy Markdown
Contributor Author

func25 commented May 16, 2026

Sure, here is the white scene test video, use midlde-mouse to move around:

Screen.Recording.2026-05-16.at.13.42.30.mov

@func25 func25 force-pushed the preview-pan-overscroll branch from c77408e to 5ddd137 Compare May 16, 2026 12:07
@O1Anas
Copy link
Copy Markdown

O1Anas commented May 16, 2026

Great feature @func25 ! Would you be open to adding trackpad two-finger panning support as well?

This would provide parity with tools like Remotion, where users can pan by dragging with two fingers on their trackpad. It's a common gesture on modern laptops and would make the preview navigation feel more complete.

@func25 func25 changed the title feat(studio): support middle-mouse panning in preview feat(studio): support preview panning with mouse and trackpad May 16, 2026
@func25
Copy link
Copy Markdown
Contributor Author

func25 commented May 16, 2026

Added, thanks for the idea (I saw your recommendation in the zoom in/out GitHub issue also)

@O1Anas
Copy link
Copy Markdown

O1Anas commented May 16, 2026

Thank you so much for the fast response & commit @func25 ! It would be great if we can also include some of these small features/bug fixes in this PR too (or else I'll file a new issue instead, what do you think?):

  1. Mouse wheel/trackpad zoom focuses into the center – Currently, mouse wheel/trackpad zoom always zooms into the center of the composition. It should zoom into the mouse pointer's location for intuitive navigation.

  2. Reset zoom button – Currently, double-clicking on the canvas resets zoom (undocumented/hidden). I Suggest adding a visible, consistent 'Reset Zoom' button.

  3. Canvas border expands inward when zooming – The gray border of the canvas grows thicker and eats into the preview canvas. This was previously reported (see PR fix(studio): canvas border expands when zooming — switch from CSS zoom to transform scale #810) and is not fixed (PR was closed & not merged); the issue still happens in the current release and appears connected to CSS zoom vs. transform: scale.

Zoom screenshots:

When zoomed out:
Image

When zoomed in:
Image

@func25
Copy link
Copy Markdown
Contributor Author

func25 commented May 16, 2026

Let's file a new issue. This PR should only handle panning :)

@func25 func25 force-pushed the preview-pan-overscroll branch from 19e50b8 to 513481d Compare May 16, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants