Skip to content

feat(video): open content in new window on Cmd/Ctrl+click#932

Open
guthubrx wants to merge 1 commit into
futo-org:masterfrom
guthubrx:pr/cmd-click-new-window
Open

feat(video): open content in new window on Cmd/Ctrl+click#932
guthubrx wants to merge 1 commit into
futo-org:masterfrom
guthubrx:pr/cmd-click-new-window

Conversation

@guthubrx
Copy link
Copy Markdown

@guthubrx guthubrx commented Apr 17, 2026

Summary

  • Adds Cmd+click (macOS) / Ctrl+click (Windows/Linux) on a thumbnail to open the target video or channel in a new Grayjay window — matching the shortcut every browser uses
  • Intercepts click events globally via a capture-phase listener, and monkey-patches history.pushState so router navigations are caught too
  • Cross-window navigation intent is bridged via localStorage with a 5-second validity window to avoid stale entries
  • Plain click keeps its current behavior — no regression on existing flows

Changes

  • WindowBackend.ts (new): static class exposing markCmdClick / consumeCmdClick / openInNewWindow / consumeNavIntent
  • VideoProvider.tsx: openVideo and openVideoByUrl check the Cmd/Ctrl flag and delegate to WindowBackend.openInNewWindow when set
  • index.tsx: global capture-phase click listener, pushState interception, and consumption of nav intent on new-window mount

Frontend only, no backend change, no new dependency.

Cmd+click (macOS) or Ctrl+click (Windows/Linux) on a video thumbnail
opens the video in a new window instead of navigating in the current
one. Intercepts click events globally and monkey-patches
history.pushState to catch router navigations. Cross-window navigation
intent is bridged via localStorage with a 5-second validity window.
@guthubrx guthubrx force-pushed the pr/cmd-click-new-window branch from 51a5d25 to 2542d01 Compare April 17, 2026 06:56
@Zvonimir-FUTO Zvonimir-FUTO added Enhancement New feature or request Desktop UI/UX labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants