Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Mar 27, 2025

☑️ Resolves

  • Migrate to Typescript
  • Simplify
  • Remove useless dependency on md5

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

@susnux susnux added 3. to review Waiting for reviews vue 3 refactor ♻️ Pull request that is neither a fix nor a feature labels Mar 27, 2025
@susnux susnux added this to the 9.0.0-alpha.8 milestone Mar 27, 2025
@susnux susnux requested review from Pytal, ShGKme and skjnldsv March 27, 2025 23:14
@susnux susnux force-pushed the refactor/username-to-color branch from c870903 to 3ff8c02 Compare March 27, 2025 23:39
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the refactor/username-to-color branch from 3ff8c02 to 7dac7b5 Compare March 27, 2025 23:42
@susnux susnux merged commit 8188323 into next Mar 28, 2025
20 of 24 checks passed
@susnux susnux deleted the refactor/username-to-color branch March 28, 2025 09:37
@ShGKme ShGKme changed the title refactor: drop md5 dependency for usernameToColor and migrate to TS [next] refactor: drop md5 dependency for usernameToColor and migrate to TS Mar 28, 2025
@max-nextcloud
Copy link
Contributor

max-nextcloud commented Aug 20, 2025

I think the color returned by this function used to match the one computed by the server as a background color for the avatar: https://github.com/nextcloud/server/blob/776a689e09aea18dd455b885bdb575849b525d3e/lib/private/Avatar/Avatar.php#L256

I think it would be nice to maintain that property - so you can compute the color of he default avatar on the client side. I'd like to use this in text for the author indicator so it matches the user avatar if the user did not change it.

So what's the best way forward here? Reimplementing the simple hash in php in the server function?

update: just noticed we don't need it in text as colors are computed on the server anyway.

@susnux
Copy link
Contributor Author

susnux commented Aug 20, 2025

Yes basically this is "never" used as there is always the initials avatar returned by server. Its only about is-no-user of the avatar component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews refactor ♻️ Pull request that is neither a fix nor a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants