From 07fce26551f632366741bbabcfa377aa93d00827 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Tue, 24 Feb 2026 10:10:56 -0600 Subject: [PATCH] Support Commet bios, incrase bio limit --- CHANGELOG.md | 2 ++ src/app/components/user-profile/UserRoomProfile.tsx | 4 ++-- src/app/features/room/RoomTimeline.tsx | 2 +- src/app/features/settings/account/BioEditor.tsx | 2 +- src/app/features/settings/account/Profile.tsx | 12 ++++++++++-- src/app/hooks/useUserProfile.ts | 4 ++-- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc8bffe5..816fda8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Version 1.0.1 - (potentially) fixed rare crash when changing rooms +- Support Commet bios. +- Raise bio limit to 1024 characters. ## Version 1.0.0 diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index e92763a8..8cff7c94 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -51,13 +51,13 @@ function UserExtendedSection({ profile, htmlReactParserOptions, linkifyOpts }: U }).format(new Date()) : null; const bioContent = useMemo(() => { - const rawBio = profile.extended?.["moe.sable.app.bio"] || profile.bio; + const rawBio = profile.extended?.["moe.sable.app.bio"] || profile.extended?.["chat.commet.profile_bio"] || profile.bio; if (!rawBio) return null; const safetyTrim = rawBio.length > 2048 ? rawBio.slice(0, 2048) : rawBio; const visibleText = safetyTrim.replace(/<[^>]*>?/gm, ''); - const VISIBLE_LIMIT = 512; + const VISIBLE_LIMIT = 1024; if (visibleText.length <= VISIBLE_LIMIT) return safetyTrim; diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 00d37679..06e4a829 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -950,7 +950,7 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli displayName: info.displayname, pronouns: (info as any)['io.fsky.nyx.pronouns'], timezone: (info as any)['us.cloke.msc4175.tz'] || (info as any)['m.tz'], - bio: (info as any)['moe.sable.app.bio'], + bio: (info as any)['moe.sable.app.bio'] || (info as any)['chat.commet.profile_bio'], extended: info, }; diff --git a/src/app/features/settings/account/BioEditor.tsx b/src/app/features/settings/account/BioEditor.tsx index 0c8a5263..04c6c45b 100644 --- a/src/app/features/settings/account/BioEditor.tsx +++ b/src/app/features/settings/account/BioEditor.tsx @@ -24,7 +24,7 @@ type BioEditorProps = { onSave: (htmlContent: string) => void; }; -const BIO_LIMIT = 512; +const BIO_LIMIT = 1024; export function BioEditor({ value, isSaving, imagePackRooms, onSave }: BioEditorProps) { const editor = useEditor(); diff --git a/src/app/features/settings/account/Profile.tsx b/src/app/features/settings/account/Profile.tsx index caf2ae6a..3a61c6cc 100644 --- a/src/app/features/settings/account/Profile.tsx +++ b/src/app/features/settings/account/Profile.tsx @@ -345,8 +345,16 @@ function ProfileExtended({ profile, userId }: ProfileProps) { handleSaveField("moe.sable.app.bio", htmlBio)} + value={profile.extended?.["moe.sable.app.bio"] || profile.extended?.['chat.commet.profile_bio'] || profile.bio} + onSave={(htmlBio) => { + handleSaveField("moe.sable.app.bio", htmlBio) + + const cleanedHtml = htmlBio.replace(/<\/blockquote>/g, ""); + handleSaveField("chat.commet.profile_bio", { + "format": "org.matrix.custom.html", + "formatted_body": cleanedHtml + }); + }} /> diff --git a/src/app/hooks/useUserProfile.ts b/src/app/hooks/useUserProfile.ts index 97f9f1a0..65918a02 100644 --- a/src/app/hooks/useUserProfile.ts +++ b/src/app/hooks/useUserProfile.ts @@ -23,7 +23,7 @@ export const useUserProfile = (userId: string, initialProfile?: Partial {