feat(ios): add configurable slide transition options in presenter mode and settings

When using Present mode for slides can their be an option to choose what type of transition to use. I’d like to be able to choose it anytime I do the Presenter mode for slides whether it be in a list or a single song. If that’s not possible could you make a default transition in settings that could be applied?

Automated Issue Triage

Metadata Updates:

  • Assigned label: enhancement (58)
  • Formatted title: feat(ios): add configurable slide transition options in presenter mode and settings

Codebase Analysis & Implementation Touchpoints:

  1. Slide Transition Engine & State Machine ([HfwPresenterAndPitchViews.swift](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L703-L826)):
    • In [packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L703-L749), [HfwSlideWipeStateMachine](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L703-L749) and [HfwWipingSlideStageView](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L753-L826) currently hardcode a 400ms left-to-right wipe via [HfwHorizontalWipeClipShape](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L484-L498).
    • Introduce an enum (e.g., HfwSlideTransitionStyle: wipe, crossfade, push, cut) and generalize [HfwSlideWipeStateMachine](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L703-L749) to support crossfade (opacity blend between active and underneath layers), push (horizontal offset animation), and cut/instant transitions (isWipeEnabled = false).
  2. Fullscreen Slide Presenter & Runtime Controls ([HfwFullscreenSlidePresenter](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L1779-L2200)):
    • In [packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L2155-L2164), pass the active transition style into [HfwWipingSlideStageView](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L753-L826).
    • In the presenter HUD / toolbar (lines 1850–2050) and [HfwPresenterControlView](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwPresenterAndPitchViews.swift#L1600-L1770), add a transition selector menu button allowing users to switch transition styles on the fly for single songs or worship service lists.
  3. External Display Mirroring & Stage Output ([HfwExternalDisplayManager.swift](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwExternalDisplayManager.swift#L740-L920)):
    • In [HfwExternalStageView](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwExternalDisplayManager.swift#L850-L920) and [HfwPresenterControlPreviewSheet](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwExternalDisplayManager.swift#L740-L770), propagate the selected transition style so AirPlay / HDMI projector outputs match the chosen presentation style.
  4. App Settings & Preferences ([HfwStore.swift](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwStore.swift#L525-L535) & [HfwListsAndSettingsViews.swift](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwListsAndSettingsViews.swift#L3240-L3650)):
    • In [packages/hfw_flutter/ios/Runner/HfwStore.swift](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwStore.swift#L525-L535), add a persisted user preference hfw_slide_transition_style (defaulting to "wipe").
    • In [HfwAccountSettingsSheet](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/ios/Runner/HfwListsAndSettingsViews.swift#L3240-L3650), add a “Presentation & Slides” settings section with a Picker for the default slide transition style.
  5. Native Bridge Verification Tests ([slide_wipe_transition_test.dart](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/test/native_bridge/slide_wipe_transition_test.dart#L18-L38)):
    • Extend unit tests in [packages/hfw_flutter/test/native_bridge/slide_wipe_transition_test.dart](file:///Users/rodydavis/dev/gitea-repos/rodydavis/hymns-for-worship/packages/hfw_flutter/test/native_bridge/slide_wipe_transition_test.dart) to verify transition style state transitions and confirm that backwards/forwards stepping preserves off-by-one protections across all transition modes.

Implementation Plan & Research Summary

Current State & Gap Found:

  • HfwExternalDisplayManager.swift (lines 14–61) already defines HfwStageTransitionStyle (dissolve, push, none) persisted to UserDefaults (hfw_stage_transition_style) and renders a segmented Picker("Transition Style") in the external stage sheet (line 594).
  • However, HfwExternalStageView (line 735) only passes isWipeEnabled = (displayManager.transitionStyle != .none) to HfwWipingSlideStageView, so .dissolve and .push still render as left-to-right wipes on external displays.
  • Meanwhile, HfwFullscreenSlidePresenter (HfwPresenterAndPitchViews.swift:2157) hardcodes HfwWipingSlideStageView with isWipeEnabled: true and has no runtime transition selector or Settings default.

Unification Plan:

  1. Unify HfwStageTransitionStyle (HfwExternalDisplayManager.swift):
    • Add case wipe = "wipe" alongside dissolve, push, and none (defaulting to .wipe for backward compatibility, keeping UserDefaults key hfw_stage_transition_style).
  2. Generalize HfwWipingSlideStageView & HfwSlideWipeStateMachine (HfwPresenterAndPitchViews.swift:703-826):
    • Replace isWipeEnabled: Bool with transitionStyle: HfwStageTransitionStyle and stepDirection: Int = 1 (forward/backward).
    • Render each mode cleanly on the two-layer stage (under at zIndex(0), current at zIndex(1)):
      • .wipe: existing HfwHorizontalWipeClipShape(progress:) (400ms easeInOut).
      • .dissolve: opacity crossfade (current fades 0 -> 1 over opaque under, 350ms easeInOut).
      • .push: horizontal slide offset using stepDirection (current enters from +/-width -> 0, under exits 0 -> -/+width, 350ms easeInOut).
      • .none: instant snap (progress = 1.0, no animation).
  3. Wire Runtime Picker & External Display:
    • In HfwFullscreenSlidePresenter (HfwPresenterAndPitchViews.swift:2157) and HfwExternalStageView (HfwExternalDisplayManager.swift:750), read displayManager.transitionStyle (and optional per-session override in presenter HUD) so single-song presentation, list presentation, and AirPlay/HDMI stage output all honor the chosen style.
    • Add a compact transition Menu button to the HfwFullscreenSlidePresenter HUD toolbar and HfwPresenterControlView.
  4. Add Default Setting in HfwAccountSettingsSheet (HfwListsAndSettingsViews.swift):
    • Add a Presentation & Slides section with a Picker bound to HfwExternalDisplayManager.shared.transitionStyle.
  5. Tests:
    • Update packages/hfw_flutter/ios/RunnerTests/RunnerTests.swift (around line 3309) and packages/hfw_flutter/test/native_bridge/slide_wipe_transition_test.dart to verify all 4 transition styles and rapid forward/backward stepping without off-by-one artifacts.

Landed in commit 3223a5b on main: unified HfwStageTransitionStyle (wipe, dissolve, push, none) persisted under hfw_stage_transition_style, wired all 4 styles into HfwWipingSlideStageView, HfwExternalStageView, and HfwFullscreenSlidePresenter, added HfwTransitionStyleMenuButton to presenter/stage HUDs, and added the segmented Slide Transition picker in HfwAccountSettingsSheet. Verified with slide_wipe_transition_test.dart (4/4 passed) and xcodebuild.