feat: enhance user profile customization with avatar border color and gradient options

- Added support for setting avatar border color and gradient in user profile settings.
- Introduced new hooks for managing user profile styles and fetching metadata from avatars.
- Implemented an AngleSelector component for selecting gradient direction.
- Updated RoomNavItem to display parent space information for direct messages.
- Improved caching mechanism for user banners and profile styles.
- Refactored image metadata handling to include new profile style attributes.
This commit is contained in:
2026-03-12 20:50:00 +11:00
parent fc30d81f8f
commit 834de012b4
13 changed files with 911 additions and 90 deletions

View File

@@ -18,9 +18,28 @@ import { embedColorInWebP, extractColorFromWebP, removeColorFromWebP } from './w
import { embedColorInJPEG, extractColorFromJPEG, removeColorFromJPEG } from './jpegMetadata';
import { embedColorInGIF, extractColorFromGIF, removeColorFromGIF } from './gifMetadata';
/**
* Gradient configuration for profile styling
* All colors support RGBA format (e.g., #FF550080 for 50% opacity)
*/
export type ProfileGradient = {
/** CSS gradient direction (e.g., "to bottom", "45deg", "to bottom right") */
direction: string;
/** Start color in hex format with optional alpha (#RRGGBB or #RRGGBBAA) */
startColor: string;
/** End color in hex format with optional alpha (#RRGGBB or #RRGGBBAA) */
stopColor: string;
};
export type ImageMetadata = {
/** Profile name color */
color?: string;
/** Banner MXC URL */
banner?: string;
/** Avatar border color with optional transparency (#RRGGBB or #RRGGBBAA) */
avatarBorderColor?: string;
/** Profile card gradient */
gradient?: ProfileGradient;
};
/** PNG signature bytes */