Skip to content

Trigger clip:selected event on resize completion#6

Closed
ferozhussain wants to merge 1 commit intoshotstack:mainfrom
ferozhussain:patch-1
Closed

Trigger clip:selected event on resize completion#6
ferozhussain wants to merge 1 commit intoshotstack:mainfrom
ferozhussain:patch-1

Conversation

@ferozhussain
Copy link
Copy Markdown

The clip selection behavior to trigger the clip:selected event not only when a clip is clicked, but also when a clip resize or rotation operation is completed. This ensures that applications can respond to all types of clip interactions through a single event handler.

Changes

Updated the onPointerUp method in the Player class to trigger the setSelectedClip method when:

A clip is clicked (existing behavior)
A clip scaling operation is completed
A clip rotation operation is completed

@dazzatronus
Copy link
Copy Markdown
Contributor

This makes sense. I'll test and get this merged.

@dazzatronus
Copy link
Copy Markdown
Contributor

dazzatronus commented Apr 29, 2025

We should separate selection from state updates by:

  1. Keeping clip:select for ONLY initial selection events (triggered on pointer down)
  2. Adding a new clip:update event for state changes after manipulation (triggered on pointer up)

Proposed clip:update payload structure:

{
  previous: {
    clip: { ...previousConfig },
    trackIndex: previousTrackIndex,
    clipIndex: previousClipIndex
  },
  current: {
    clip: { ...currentConfig },
    trackIndex: currentTrackIndex,
    clipIndex: currentClipIndex
  }
}

This separation follows standard event system patterns, improves code clarity, and future-proofs our implementation.

@ferozhussain
Copy link
Copy Markdown
Author

Agreed

@dazzatronus
Copy link
Copy Markdown
Contributor

Closing this PR as the changes have been implemented in PR #9.

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.

2 participants