Skip to content

Fix right-click context menu on macOS#51

Merged
olimic1000 merged 3 commits intomainfrom
fix/macos-rightclick-contextmenu
Feb 19, 2026
Merged

Fix right-click context menu on macOS#51
olimic1000 merged 3 commits intomainfrom
fix/macos-rightclick-contextmenu

Conversation

@olimic1000
Copy link
Copy Markdown
Owner

Summary

  • Add a capture-phase contextmenu listener on document that calls e.preventDefault() during init()
  • WaveSurfer v7 renders inside a shadow DOM; by the time the contextmenu event bubbles to our container listener, WKWebView has already decided to show its native context menu
  • The capture-phase listener fires before any shadow-DOM handler, preventing the native WebKit menu and letting the custom Alpine.js menus (Add split / Delete Track) appear correctly on right-click

Test plan

  • Right-click on waveform background → "Add split" custom menu appears
  • Right-click on a track region → "Add split" / "Delete Track" custom menu appears
  • Ctrl+click works the same way on macOS
  • No native WebKit context menu interferes

🤖 Generated with Claude Code

olimic1000 and others added 3 commits February 19, 2026 22:16
WaveSurfer v7 renders inside a shadow DOM. When the contextmenu event
fires there and bubbles out, calling preventDefault() at the container
level happens after WKWebView has already decided to show its native
menu. Adding a capture-phase listener on document ensures preventDefault
is called before WKWebView makes that decision, reliably suppressing the
native menu so the custom Alpine.js menus appear instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ctrl+click fires a real 'click' event after mousedown (unlike pure right-click),
which was triggering Alpine.js @click.away and instantly closing the custom menu.
Guard the @click.away handler to skip closing when ctrlKey is pressed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
audio_processor.py was hardcoding "ffmpeg" in all subprocess calls,
ignoring the VINYLFLOW_FFMPEG_PATH env var that the launcher sets to
the absolute path of the bundled binary. If the PATH update doesn't
propagate reliably to child processes on Windows, ffmpeg silently fails
and get_audio_duration returns None, causing "Could not determine audio
duration" on every file.

Also switch subprocess.run to encoding="utf-8", errors="replace" to
avoid UnicodeDecodeError on Windows when ffmpeg outputs non-cp1252
characters in file paths or progress lines.

Additionally exclude ffmpeg.exe from UPX compression in the spec —
UPX-packed executables are often blocked by Windows Defender.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@olimic1000 olimic1000 merged commit d23867b into main Feb 19, 2026
1 check failed
@olimic1000 olimic1000 deleted the fix/macos-rightclick-contextmenu branch February 19, 2026 20:33
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.

1 participant