Conversation
Reviewer's GuideViewerPanel now supports focused keyboard navigation—five-second seeking and volume adjustments—and toggles playback on clicks that do not move the window, including direct click handling in borderless mode. Sequence diagram for VideoViewer keyboard and click controlssequenceDiagram
actor User
participant ViewerPanel
participant MediaElement
participant Window
User->>ViewerPanel: PreviewKeyDown
alt Left or Right arrow
ViewerPanel->>ViewerPanel: Seek(deltaTicks)
ViewerPanel->>MediaElement: MediaPosition = clamped target
else Up or Down arrow
ViewerPanel->>ViewerPanel: ChangeVolume(delta)
end
User->>ViewerPanel: MouseLeftButtonDown
ViewerPanel->>ViewerPanel: Focus()
alt Borderless window
ViewerPanel->>ViewerPanel: TogglePlayPause(this, EventArgs.Empty)
else Window drag does not move window
ViewerPanel->>Window: DragMove()
ViewerPanel->>ViewerPanel: TogglePlayPause(this, EventArgs.Empty)
else Window moves
ViewerPanel->>Window: DragMove()
end
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs" line_range="227-230" />
<code_context>
+ wnd.DragMove();
+
+ // If the window was not moved, treat this interaction as a click to toggle play/pause
+ if (Math.Abs(wnd.Left - startLeft) < 2 && Math.Abs(wnd.Top - startTop) < 2)
+ {
+ TogglePlayPause(this, EventArgs.Empty);
+ }
+ }
+ }
</code_context>
<issue_to_address>
**nitpick (bug_risk):** A drag that moves the window away from its starting point and then back within two pixels is treated as a click, so the video is paused or resumed even though the user performed a drag.
**Triggers:** When the user drags the preview window back to approximately its original position.
**Suggested fix:** Track whether the pointer moved beyond the drag threshold during the interaction, rather than comparing only the final window position with the starting position.
</issue_to_address>Sourcery assessment
Approved.
| if (Math.Abs(wnd.Left - startLeft) < 2 && Math.Abs(wnd.Top - startTop) < 2) | ||
| { | ||
| TogglePlayPause(this, EventArgs.Empty); | ||
| } |
There was a problem hiding this comment.
nitpick (bug_risk): A drag that moves the window away from its starting point and then back within two pixels is treated as a click, so the video is paused or resumed even though the user performed a drag.
Triggers: When the user drags the preview window back to approximately its original position.
Suggested fix: Track whether the pointer moved beyond the drag threshold during the interaction, rather than comparing only the final window position with the starting position.
PR Checklist
Brief Description of Changes
Focusable = true, requested focus onLoaded, and attachedPreviewKeyDownhandler inViewerPanel.xaml.cs.Left/Rightarrow keys: rewind / fast-forward playback by 5 seconds.Up/Downarrow keys: increase / decrease volume by 5%.Panel_MouseLeftButtonDownto differentiate between a click and a drag operation.DragMove()), ensuring window repositioning remains fully functional.Related Issue (if any)
Fixes #47
Fixes #1979
Fixes #1753
Additional Notes
Tested video playback, seeking with arrow keys, volume adjustment with Up/Down arrows, clicking to play/pause, and dragging the preview window.