From 0e6a08852faa92f3293adac028a5db1de29cfc82 Mon Sep 17 00:00:00 2001 From: b1rdmania <102524336+b1rdmania@users.noreply.github.com> Date: Mon, 29 Dec 2025 15:05:04 +0000 Subject: [PATCH] Fix Share to X on mobile, update helper text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Open window immediately before async fetch to preserve user gesture - Update MIDI selection helper text per feedback 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- index.html | 2 +- src/main.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 20cd3be..f0b7606 100644 --- a/index.html +++ b/index.html @@ -1152,7 +1152,7 @@
diff --git a/src/main.ts b/src/main.ts index 288a1fb..859f4d1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -758,6 +758,10 @@ class MotifApp { const title = this.cleanSongTitle(result.title || 'a song'); + // Open window immediately (must be in user gesture context for mobile) + // We'll navigate it after getting the share URL + const popup = window.open('about:blank', '_blank'); + // Get share URL (try short link first) let shareUrl: string | null = null; try { @@ -789,7 +793,13 @@ class MotifApp { const tweetText = `I made ${title} Game Boy version.\n\n16-Bit Midi Wario Synth by @b1rdmania`; const twitterUrl = `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(shareUrl)}`; - window.open(twitterUrl, '_blank', 'width=550,height=420'); + // Navigate the already-opened window + if (popup) { + popup.location.href = twitterUrl; + } else { + // Fallback if popup was blocked + window.location.href = twitterUrl; + } } private setState(state: 'idle' | 'results' | 'selected' | 'generated'): void {