Skip to content

feat(profiles): derive hover colour from custom avatars - #264

Open
SamratB8 wants to merge 1 commit into
NuvioMedia:Devfrom
SamratB8:issue-217-custom-profile-hover
Open

SamratB8 wants to merge 1 commit into
NuvioMedia:Devfrom
SamratB8:issue-217-custom-profile-hover

Conversation

@SamratB8

Copy link
Copy Markdown

Summary

Adds dominant-colour extraction for custom profile pictures added through a URL on the desktop profile-selection screen.

Custom URL avatars now use a colour derived from the loaded image for the existing animated ProfileMeshBackground, making their hover behaviour consistent with built-in avatars.

Built-in avatars retain their existing curated colours.

Fixes #217

What changed

  • Reused the existing kmpalette painter-based dominant-colour extraction pattern.
  • Reused the painter from the already-loaded avatar image instead of loading the image a second time.
  • Cached extracted colours by normalized image URL for the lifetime of the profile-selection screen.
  • Preserved avatarColorHex as the fallback until extraction succeeds.
  • Preserved existing built-in avatar behaviour.
  • Added focused tests for the shared colour-resolution logic.
  • Added no new dependencies.

Behaviour

For built-in avatars:

  • The existing curated avatarColorHex continues to drive the animated background.
  • No visual or behavioural changes are intended.

For custom URL avatars:

  • The stored avatarColorHex is used while the image is loading.
  • Once the image loads successfully, its dominant colour is extracted and used by the existing hover background.
  • Invalid or unreachable URLs continue using the stored fallback colour.
  • Extracted colours are cached so repeated hovering does not repeatedly run palette extraction.

Files changed

  • ProfileModels.kt

    • Added the pure resolveProfileHoverColor helper.
  • ProfileSelectionScreen.kt

    • Added painter-based dominant-colour extraction and URL-keyed caching for custom avatars.
  • ProfileHoverColorTest.kt

    • Added focused tests for built-in, custom URL, fallback, invalid URL, and null-profile behaviour.

Testing

Passed before the latest upstream Dev update:

  • :composeApp:compileKotlinDesktop
  • :composeApp:testAndroidHostTest --tests "com.nuvio.app.features.profiles.ProfileHoverColorTest"
    • 5 tests passed
    • 0 failures
    • 0 errors
  • git diff --check

After rebasing onto the latest Dev, both desktop and Android compilation are currently blocked by unrelated upstream compilation failures, including:

  • unresolved activeSubtitleTab / SubtitleTab references
  • an incompatible desktop httpRequestRaw actual declaration
  • missing desktop ThemeSettingsStorage expected members
  • missing desktop TmdbSettingsStorage expected members

The same failures occur with this PR's changes stashed, confirming that they are unrelated to this change.

The existing desktopTest task is also independently blocked by the stale PluginRuntimeDesktopTest.kt source.

Manual verification status

The desktop application itself previously built and launched successfully after installing the required Windows native toolchain.

Complete visual verification is currently blocked by the contributor runtime configuration. Without:

  • NUVIO_SUPABASE_URL
  • NUVIO_SUPABASE_ANON_KEY
  • NUVIO_SUPABASE_FALLBACK_URL

the app falls back to https://localhost, so the avatar catalogue cannot load.

This PR is therefore opened as a draft pending either:

  • access to a contributor-safe runtime configuration,
  • verification by a maintainer in a configured environment,
  • or recovery of the upstream Dev build.

Scope

This PR is intentionally limited to issue #217.

It does not change:

  • profile persistence
  • authentication
  • PIN handling
  • navigation
  • playback
  • settings
  • built-in avatar data
  • unrelated UI behaviour

@KhooLy

KhooLy commented Aug 16, 2026

Copy link
Copy Markdown
Member

Please do testing via https://nuvio.tv/docs Supabase credentials can be found here. Please do testing and update.

@SamratB8

Copy link
Copy Markdown
Author

Thanks for the clarification and for pointing me to the contributor docs.

I won’t be able to complete the runtime testing immediately because my JetBrains student license has expired, and I’m currently waiting for it to be renewed. I expect to be able to resume testing in about a week.

Once I have access again, I’ll use the documented Supabase configuration, complete the visual/runtime verification, and update the PR with the results and screenshots/video.

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.

[Feature]: Improve Hover Background Effect for Custom Profile Pictures Added via URL

2 participants