From 667b2c2430d3e7458f96ad4963be52f5d5841b38 Mon Sep 17 00:00:00 2001 From: pocketcasts <42823211+pocketcasts@users.noreply.github.com> Date: Wed, 1 Jul 2026 00:05:03 -0300 Subject: [PATCH 1/2] PCIOS-805: iOS: Transcript controls shift position as the transcript loads, causing mis-taps (Share hit lands on Play) --- podcasts/TranscriptViewController.swift | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/podcasts/TranscriptViewController.swift b/podcasts/TranscriptViewController.swift index 5679c048a5..80065a6607 100644 --- a/podcasts/TranscriptViewController.swift +++ b/podcasts/TranscriptViewController.swift @@ -277,13 +277,11 @@ class TranscriptViewController: PlayerItemViewController, AnalyticsSourceProvide stackView.addArrangedSubview(closeButton) stackView.addArrangedSubview(UIView()) - if FeatureFlag.shareTranscripts.enabled { - stackView.addArrangedSubview(shareButton) - } + shareButton.isHidden = !FeatureFlag.shareTranscripts.enabled + stackView.addArrangedSubview(shareButton) - if showFromEpisode { - stackView.addArrangedSubview(playButton) - } + playButton.isHidden = !showFromEpisode + stackView.addArrangedSubview(playButton) stackView.addArrangedSubview(searchButton) @@ -602,18 +600,26 @@ class TranscriptViewController: PlayerItemViewController, AnalyticsSourceProvide private func setupLoadingState() { transcriptView.isHidden = true - searchButton.isHidden = true + setControlButtonsVisible(false) errorView.isHidden = true activityIndicatorView.startAnimating() } private func setupShowTranscriptState() { transcriptView.isHidden = false - searchButton.isHidden = false + setControlButtonsVisible(true) errorView.isHidden = true activityIndicatorView.stopAnimating() } + private func setControlButtonsVisible(_ visible: Bool) { + let buttons: [UIButton] = [searchButton, shareButton, playButton] + for button in buttons where !button.isHidden { + button.alpha = visible ? 1 : 0 + button.isUserInteractionEnabled = visible + } + } + private var currentEpisodeUUID: String? private func loadTranscript() { From 0be9abab22a5eef88f6081e6b4f202316892f0fc Mon Sep 17 00:00:00 2001 From: joashrajin Date: Tue, 7 Jul 2026 10:46:22 +0200 Subject: [PATCH 2/2] Restore transcript play control on load errors --- podcasts/TranscriptViewController.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/podcasts/TranscriptViewController.swift b/podcasts/TranscriptViewController.swift index 80065a6607..13c4d0223c 100644 --- a/podcasts/TranscriptViewController.swift +++ b/podcasts/TranscriptViewController.swift @@ -614,10 +614,13 @@ class TranscriptViewController: PlayerItemViewController, AnalyticsSourceProvide private func setControlButtonsVisible(_ visible: Bool) { let buttons: [UIButton] = [searchButton, shareButton, playButton] - for button in buttons where !button.isHidden { - button.alpha = visible ? 1 : 0 - button.isUserInteractionEnabled = visible - } + buttons.forEach { setControlButton($0, visible: visible) } + } + + private func setControlButton(_ button: UIButton, visible: Bool) { + guard !button.isHidden else { return } + button.alpha = visible ? 1 : 0 + button.isUserInteractionEnabled = visible } private var currentEpisodeUUID: String? @@ -845,6 +848,7 @@ class TranscriptViewController: PlayerItemViewController, AnalyticsSourceProvide private func show(error: Error) { activityIndicatorView.stopAnimating() + setControlButton(playButton, visible: true) var message = L10n.transcriptErrorFailedToLoad if let transcriptError = error as? TranscriptError { message = transcriptError.localizedDescription