From 922866aa59073d1d1b75077f065648d61b0d1887 Mon Sep 17 00:00:00 2001 From: Shea Duma Date: Tue, 3 Mar 2026 21:13:56 +0200 Subject: [PATCH 1/3] made it a new fork because the other one was broken and im dum --- src/app/components/presence/Presence.tsx | 5 +- src/app/components/user-profile/UserHero.tsx | 94 ++++++++++--------- src/app/components/user-profile/styles.css.ts | 18 +++- src/app/features/room/MembersDrawer.tsx | 31 ++++-- 4 files changed, 89 insertions(+), 59 deletions(-) diff --git a/src/app/components/presence/Presence.tsx b/src/app/components/presence/Presence.tsx index 7b4e55872..e6ac463bb 100644 --- a/src/app/components/presence/Presence.tsx +++ b/src/app/components/presence/Presence.tsx @@ -22,10 +22,9 @@ const PresenceToColor: Record = { type PresenceBadgeProps = { presence: Presence; - status?: string; size?: '200' | '300' | '400' | '500'; }; -export function PresenceBadge({ presence, status, size }: PresenceBadgeProps) { +export function PresenceBadge({ presence, size }: PresenceBadgeProps) { const label = usePresenceLabel(); const badgeLabelId = useId(); @@ -39,8 +38,6 @@ export function PresenceBadge({ presence, status, size }: PresenceBadgeProps) { {label[presence]} - {status && •} - {status && {status}} } diff --git a/src/app/components/user-profile/UserHero.tsx b/src/app/components/user-profile/UserHero.tsx index 2f6eb84d5..e0adc8042 100644 --- a/src/app/components/user-profile/UserHero.tsx +++ b/src/app/components/user-profile/UserHero.tsx @@ -9,6 +9,7 @@ import { OverlayBackdrop, OverlayCenter, Text, + Tooltip, } from 'folds'; import classNames from 'classnames'; import FocusTrap from 'focus-trap-react'; @@ -58,51 +59,58 @@ export function UserHero({ userId, avatarUrl, bannerUrl, presence }: UserHeroPro /> )} -
- - } - > - setViewAvatar(avatarUrl) : undefined} - className={css.UserHeroAvatar} - size="500" + +
+ } > - } - /> - - - {viewAvatar && ( - }> - - setViewAvatar(undefined), - clickOutsideDeactivates: true, - escapeDeactivates: stopPropagation, - }} - > - evt.stopPropagation()}> - setViewAvatar(undefined)} - /> - - - - + setViewAvatar(avatarUrl) : undefined} + className={css.UserHeroAvatar} + size="500" + > + } + /> + + + {viewAvatar && ( + }> + + setViewAvatar(undefined), + clickOutsideDeactivates: true, + escapeDeactivates: stopPropagation, + }} + > + evt.stopPropagation()}> + setViewAvatar(undefined)} + /> + + + + + )} +
+ {presence?.status?.length && ( +
+ + {presence.status} + +
)} -
+ ); } diff --git a/src/app/components/user-profile/styles.css.ts b/src/app/components/user-profile/styles.css.ts index 33fcd0965..a08046bd5 100644 --- a/src/app/components/user-profile/styles.css.ts +++ b/src/app/components/user-profile/styles.css.ts @@ -31,17 +31,29 @@ export const UserHeroCoverFallback = style({ transform: 'scale(2)', }); -export const UserHeroAvatarContainer = style({ +export const UserHeroAvatarStatusContainer = style({ position: 'relative', height: toRem(29), + width: '100%', +}); +export const UserHeroAvatarContainer = style({ + position: 'relative', + paddingLeft: config.space.S400, }); export const UserAvatarContainer = style({ - position: 'absolute', - left: config.space.S400, + position: 'relative', top: 0, transform: 'translateY(-50%)', backgroundColor: color.Surface.Container, }); +export const UserHeroStatusContainer = style({ + position: 'relative', + transform: 'translateY(-50%)', + textAlign: 'justify', + display: 'grid', + width: '100%', + paddingLeft: '2%', +}); export const UserHeroAvatar = style({ outline: `${config.borderWidth.B600} solid ${color.Surface.Container}`, selectors: { diff --git a/src/app/features/room/MembersDrawer.tsx b/src/app/features/room/MembersDrawer.tsx index 40c14f267..5fda61757 100644 --- a/src/app/features/room/MembersDrawer.tsx +++ b/src/app/features/room/MembersDrawer.tsx @@ -30,6 +30,8 @@ import { MatrixClient, Room, RoomMember } from '$types/matrix-sdk'; import { useVirtualizer } from '@tanstack/react-virtual'; import classNames from 'classnames'; +import { AvatarPresence, PresenceBadge } from '$components/presence'; +import { useUserPresence } from '$hooks/useUserPresence'; import { useMatrixClient } from '$hooks/useMatrixClient'; import { UseStateProvider } from '$components/UseStateProvider'; import { SearchItemStrGetter, UseAsyncSearchOptions, useAsyncSearch } from '$hooks/useAsyncSearch'; @@ -128,6 +130,7 @@ function MemberItem({ ? mx.mxcUrlToHttp(avatarMxcUrl, 100, 100, 'crop', undefined, false, useAuthentication) : undefined; + const presence = useUserPresence(member.userId); const { color, font } = useSableCosmetics(member.userId, room); return ( @@ -139,14 +142,18 @@ function MemberItem({ radii="400" onClick={onClick} before={ - - } - /> - + } + > + + } + /> + + } after={ typing && ( @@ -156,10 +163,16 @@ function MemberItem({ ) } > - + {name} + {presence?.status && ( + /* The Color value should be edited to the theme specific disabled text color */ + + {presence.status} + + )} ); From f2142c6a0d47c4fa61c077edc44deb577cf61a2e Mon Sep 17 00:00:00 2001 From: Shea Duma Date: Wed, 4 Mar 2026 02:07:53 +0200 Subject: [PATCH 2/3] created a collapsed and expanded size for the status to accomodate status sizes and the message button --- src/app/components/user-profile/UserHero.tsx | 21 +++++++++++++++++-- src/app/components/user-profile/styles.css.ts | 9 ++++++++ src/app/features/room/MembersDrawer.tsx | 3 +-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/app/components/user-profile/UserHero.tsx b/src/app/components/user-profile/UserHero.tsx index e0adc8042..42ee85062 100644 --- a/src/app/components/user-profile/UserHero.tsx +++ b/src/app/components/user-profile/UserHero.tsx @@ -10,6 +10,7 @@ import { OverlayCenter, Text, Tooltip, + toRem, } from 'folds'; import classNames from 'classnames'; import FocusTrap from 'focus-trap-react'; @@ -35,6 +36,7 @@ type UserHeroProps = { }; export function UserHero({ userId, avatarUrl, bannerUrl, presence }: UserHeroProps) { const [viewAvatar, setViewAvatar] = useState(); + const [isFullStatus, setIsFullStatus] = useState(false); const cachedBannerUrl = useBlobCache(bannerUrl); const cachedAvatarUrl = useBlobCache(avatarUrl); @@ -105,8 +107,23 @@ export function UserHero({ userId, avatarUrl, bannerUrl, presence }: UserHeroPro {presence?.status?.length && (
- - {presence.status} + setIsFullStatus(!isFullStatus)} + className={css.UserHeroStatusTooltip} + style={{ + maxHeight: isFullStatus ? toRem(105) : toRem(48), + }} + > + + {presence.status} +
)} diff --git a/src/app/components/user-profile/styles.css.ts b/src/app/components/user-profile/styles.css.ts index a08046bd5..10b0c9e51 100644 --- a/src/app/components/user-profile/styles.css.ts +++ b/src/app/components/user-profile/styles.css.ts @@ -54,6 +54,15 @@ export const UserHeroStatusContainer = style({ width: '100%', paddingLeft: '2%', }); +export const UserHeroStatusTooltip = style({ + maxWidth: '98%', + justifySelf: 'left', + cursor: 'pointer', + ':hover': { + filter: 'brightness(0.8)', + transform: 'translateY(-1px)', + }, +}); export const UserHeroAvatar = style({ outline: `${config.borderWidth.B600} solid ${color.Surface.Container}`, selectors: { diff --git a/src/app/features/room/MembersDrawer.tsx b/src/app/features/room/MembersDrawer.tsx index 5fda61757..a7004ff7f 100644 --- a/src/app/features/room/MembersDrawer.tsx +++ b/src/app/features/room/MembersDrawer.tsx @@ -168,8 +168,7 @@ function MemberItem({ {name} {presence?.status && ( - /* The Color value should be edited to the theme specific disabled text color */ - + {presence.status} )} From c09d8ca702705f3be40d9b2efcdff517de7365bf Mon Sep 17 00:00:00 2001 From: Shea Duma Date: Wed, 4 Mar 2026 04:28:44 +0200 Subject: [PATCH 3/3] added chevron to status if needed --- src/app/components/user-profile/UserHero.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/components/user-profile/UserHero.tsx b/src/app/components/user-profile/UserHero.tsx index 42ee85062..1b9130803 100644 --- a/src/app/components/user-profile/UserHero.tsx +++ b/src/app/components/user-profile/UserHero.tsx @@ -124,6 +124,13 @@ export function UserHero({ userId, avatarUrl, bannerUrl, presence }: UserHeroPro > {presence.status} + {presence.status.length > 70 && ( + + )} )}