Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 3, 2026

Adds Instagram/Spotify-style story card generation and sharing for songs, with optional lyrics selection (max 5 lines), dominant color extraction from cover art, and adaptive layouts.

Core Infrastructure

  • ISongStoryService: Color extraction, contrast calculation, story data preparation
  • SongStoryData: Model containing song metadata, selected lyrics, extracted colors
  • SongStoryService: SkiaSharp-based dominant color extraction with darkslateblue (#483D8B) fallback

Android Implementation

  • AndroidSongStoryCardRenderer: Generates 1080x1920 PNG cards with dynamic layout (800px cover without lyrics, 400px with lyrics)
  • LyricsSelectionDialogFragment: Material Design 3 dialog with RecyclerView, enforces 5-line max, live counter
  • AndroidSongStoryShareService: Intent.ACTION_SEND integration
  • FileProvider: Secure file sharing via cache directory
  • Integrated share button in NowPlayingFragment

Windows Implementation

  • WindowsSongStoryShareService: SkiaSharp rendering with DataTransferManager integration
  • LyricsSelectionDialog: WinUI 3 ContentDialog with ItemsRepeater, 5-line enforcement
  • Platform-specific fonts (Segoe UI vs sans-serif)

Technical Details

Color Extraction Algorithm:

  • Samples pixels from cover art (every nth for performance)
  • Filters transparent, very dark/light pixels
  • Quantizes and selects most common color
  • WCAG-compliant contrast calculation for text

Card Generation:

var storyService = services.GetService<ISongStoryService>();
var shareService = services.GetService<ISongStoryShareService>();

var storyData = await storyService.PrepareSongStoryAsync(song, selectedLyrics);
var cardPath = await shareService.GenerateStoryCardAsync(storyData);
await shareService.ShareStoryAsync(cardPath, "Played on Dimmer");

Layout Logic:

  • Without lyrics: Centered 800px cover + large title/artist
  • With lyrics: 400px cover + up to 5 lyrics lines with italic serif font
  • "Played on Dimmer" branding footer
  • All text auto-wrapped with proper line breaks

Services registered in DI containers: ServiceRegistration.cs (core), Bootstrapper.cs (Android), MauiProgram.cs (Windows).

Original prompt

This section details on the original issue you should resolve

<issue_title>Song story sharing/lyrics sharing </issue_title>
<issue_description>I'd like to let it so that users can share any song in a card like way akin to Spotify or Apple music.
The card can have the song's dominant color from the cover image & if none, use darkslateblue.

Likewise users should be able to select lyrics lines at most 5 lines (a variable number) so as to show them in the card .

So if the song shared has no lyrics, show a big card & big cover image. If lyrics are added, show smaller cover image but highlight lyrics.

"Played on Dimmer" will be the little tag 😄

It would be native implementation, no MAUI for this.

I only wonder how lyrics selection will be on droid.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits January 3, 2026 17:58
- Created ISongStoryService and ISongStoryShareService interfaces
- Created SongStoryData model for story information
- Implemented SongStoryService with color extraction from cover art
- Created AndroidSongStoryCardRenderer for generating story cards
- Created LyricsSelectionDialogFragment for selecting lyrics (max 5 lines)
- Implemented AndroidSongStoryShareService for sharing via Intent
- Added FileProvider configuration for sharing images
- Integrated share button in NowPlayingFragment
- Registered services in DI containers

Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
- Created WindowsSongStoryShareService with card rendering
- Implemented LyricsSelectionDialog for Windows using ContentDialog
- Registered Windows service in MauiProgram
- Uses SkiaSharp for card rendering on Windows
- Integrates with Windows DataTransferManager for sharing

Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Copilot AI changed the title [WIP] Add song story and lyrics sharing feature Implement native song story card sharing with lyrics selection Jan 3, 2026
Copilot AI requested a review from YBTopaz8 January 3, 2026 18:04
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.

Song story sharing/lyrics sharing

2 participants