fix(slides): title slide background size and image scale change when toggling between score and lyrics

Problem Description

When toggling a hymn between Score (images) and Lyrics (lyrics) view modes, the Title Slide undergoes unexpected background sizing and image scaling changes:

  1. Image Fit / Scaling Inconsistency:

    • In SlideCompositionWidget (slide_composition_widget.dart), imageFit is computed as:
      imageFit: slide.viewMode == 'images'
          ? sheetMusicStyle.objectFit
          : ((slide.slideStyle ?? slideStyle).bgImageFit.isNotEmpty
                ? (slide.slideStyle ?? slideStyle).bgImageFit
                : 'fill'),
      
    • In slide_compiler.dart, the title slide inherits viewMode = effectiveHymnMode. When toggling from Score to Lyrics, viewMode changes from images to lyrics, causing imageFit to abruptly flip from sheetMusicStyle.objectFit (typically contain) to slideStyle.bgImageFit (defaulting to fill). This stretches or distorts the title slide asset.
  2. Render vs Export Divergence:

    • In SharedSlideCompositionWidget, if imageBytes is present on the title slide, it renders the raw image asset.
    • In SlideExportService (slide_export_service.dart), title slides explicitly bypass imageBytes (!slide.isTitle) and render slide text (_drawSlideText) over the slide background.
    • This creates an inconsistency between in-app rendering / live presentation and exported assets (PDF/PNG/PPTX).
  3. Properties Pane Configuration:

    • In properties_pane.dart, both the Sheet Music styling section (if (isScore && !isTitleSlide)) and the Background section (if (!isTitleSlide && ...)) hide controls when a title slide is selected.
    • Users cannot configure or control the background mode, size, and fit specifically for title slides.

Proposed Solution

  1. Stabilize Title Slide Image Sizing & Fit:
    • Decouple title slide image scaling from hymn view mode flips, ensuring consistent aspect ratio retention (contain / fitWidth or explicit title slide image fit).
  2. Align Live Viewer & Export Pipeline:
    • Standardize whether title slides display rendered score title assets or styled title text across SharedSlideCompositionWidget, SlideExportService, and PPTX export.
  3. Properties Pane Support:
    • Allow configuring background and image presentation settings for title slides.

Resolution Summary

Resolved in commit 3a44baea:

  1. Title Slide View Mode Alignment (slide_compiler.dart):

    • imageBytes is now only populated on Title Slides when effectiveHymnMode == 'images' (Score mode). In Lyrics mode, the title slide renders title text with consistent typography and background.
  2. Consistent Image Scaling (slide_composition_widget.dart, presenter_console_view.dart, remote_server_service.dart):

    • When a Title Slide displays a score image, imageFit strictly uses sheetMusicStyle.objectFit (aspect-ratio preserved) rather than jumping to bgImageFit (fill), eliminating scale distortions when toggling between Score and Lyrics.
  3. Export Pipeline Alignment (slide_export_service.dart):

    • In Score mode, SlideExportService now properly exports the recolored title score image with sheet music sizing, matching live viewer output.
  4. Properties Pane Background Section (properties_pane.dart):

    • Enabled background customization on Title Slides in Lyrics mode.
  5. Automated Testing:

    • Added test coverage in slide_compiler_test.dart validating Title Slide imageBytes state when toggling view modes.
    • All 166 unit/widget tests passing cleanly.

Final Update & Verification

Commit: 3abdd59f
Release: v1.4.0+35

  • Unified Title Slide Artwork Display:
    • Both Score and Lyrics modes now consistently display the title slide image artwork (imageBytes) for purchased hymns.
    • Image scaling strictly respects sheetMusicStyle.objectFit (aspect-ratio preserved) in both modes without distorting or stretching.
  • Export & Viewer Parity:
    • SlideExportService, PptxExportService, SharedSlideCompositionWidget, and the presenter consoles/remote viewer all render the title slide image uniformly.
  • Testing:
    • Test suite in slide_compiler_test.dart updated and verified passing.