From 7953ec80e50e2272e24d04cec3f643cc3c222771 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sun, 8 Mar 2026 14:22:11 +1100 Subject: [PATCH 01/43] Apply deafen state when call member changes (#2737) * fix deafen not working * apply deafen state when call member changes * remove unnecessary condition --- src/app/components/CallEmbedProvider.tsx | 2 ++ src/app/features/call/CallView.tsx | 4 ++-- src/app/hooks/useCall.ts | 9 +++++++++ src/app/hooks/useCallEmbed.ts | 11 ++++++++++- src/app/plugins/call/CallControl.ts | 10 ++++++---- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/app/components/CallEmbedProvider.tsx b/src/app/components/CallEmbedProvider.tsx index 9f4b3f2b..a78c210b 100644 --- a/src/app/components/CallEmbedProvider.tsx +++ b/src/app/components/CallEmbedProvider.tsx @@ -6,6 +6,7 @@ import { useCallHangupEvent, useCallJoined, useCallThemeSync, + useCallMemberSoundSync, } from '../hooks/useCallEmbed'; import { callChatAtom, callEmbedAtom } from '../state/callEmbed'; import { CallEmbed } from '../plugins/call'; @@ -15,6 +16,7 @@ import { ScreenSize, useScreenSizeContext } from '../hooks/useScreenSize'; function CallUtils({ embed }: { embed: CallEmbed }) { const setCallEmbed = useSetAtom(callEmbedAtom); + useCallMemberSoundSync(embed); useCallThemeSync(embed); useCallHangupEvent( embed, diff --git a/src/app/features/call/CallView.tsx b/src/app/features/call/CallView.tsx index b2a200fb..a8923d93 100644 --- a/src/app/features/call/CallView.tsx +++ b/src/app/features/call/CallView.tsx @@ -1,6 +1,6 @@ import React, { useRef } from 'react'; import { Badge, Box, color, Header, Scroll, Text, toRem } from 'folds'; -import { useCallEmbed, useCallJoined, useSyncCallEmbedPlacement } from '../../hooks/useCallEmbed'; +import { useCallEmbed, useCallJoined, useCallEmbedPlacementSync } from '../../hooks/useCallEmbed'; import { ContainerColor } from '../../styles/ContainerColor.css'; import { PrescreenControls } from './PrescreenControls'; import { usePowerLevelsContext } from '../../hooks/usePowerLevels'; @@ -44,7 +44,7 @@ export function CallView() { const room = useRoom(); const callViewRef = useRef(null); - useSyncCallEmbedPlacement(callViewRef); + useCallEmbedPlacementSync(callViewRef); const powerLevels = usePowerLevelsContext(); const creators = useRoomCreators(room); diff --git a/src/app/hooks/useCall.ts b/src/app/hooks/useCall.ts index a4374fcd..1364e459 100644 --- a/src/app/hooks/useCall.ts +++ b/src/app/hooks/useCall.ts @@ -53,3 +53,12 @@ export const useCallMembers = (room: Room, session: MatrixRTCSession): CallMembe return memberships; }; + +export const useCallMembersChange = (session: MatrixRTCSession, callback: () => void): void => { + useEffect(() => { + session.on(MatrixRTCSessionEvent.MembershipsChanged, callback); + return () => { + session.removeListener(MatrixRTCSessionEvent.MembershipsChanged, callback); + }; + }, [session, callback]); +}; diff --git a/src/app/hooks/useCallEmbed.ts b/src/app/hooks/useCallEmbed.ts index e04182dd..d91df6aa 100644 --- a/src/app/hooks/useCallEmbed.ts +++ b/src/app/hooks/useCallEmbed.ts @@ -13,6 +13,7 @@ import { ThemeKind, useTheme } from './useTheme'; import { callEmbedAtom } from '../state/callEmbed'; import { useResizeObserver } from './useResizeObserver'; import { CallControlState } from '../plugins/call/CallControlState'; +import { useCallMembersChange, useCallSession } from './useCall'; const CallEmbedContext = createContext(undefined); @@ -99,6 +100,14 @@ export const useCallHangupEvent = (embed: CallEmbed, callback: () => void) => { useClientWidgetApiEvent(embed.call, ElementWidgetActions.HangupCall, callback); }; +export const useCallMemberSoundSync = (embed: CallEmbed) => { + const callSession = useCallSession(embed.room); + useCallMembersChange( + callSession, + useCallback(() => embed.control.applySound(), [embed]) + ); +}; + export const useCallThemeSync = (embed: CallEmbed) => { const theme = useTheme(); @@ -109,7 +118,7 @@ export const useCallThemeSync = (embed: CallEmbed) => { }, [theme.kind, embed]); }; -export const useSyncCallEmbedPlacement = (containerViewRef: RefObject): void => { +export const useCallEmbedPlacementSync = (containerViewRef: RefObject): void => { const callEmbedRef = useCallEmbedRef(); const syncCallEmbedPlacement = useCallback(() => { diff --git a/src/app/plugins/call/CallControl.ts b/src/app/plugins/call/CallControl.ts index c2087fe0..44dcacd7 100644 --- a/src/app/plugins/call/CallControl.ts +++ b/src/app/plugins/call/CallControl.ts @@ -47,6 +47,10 @@ export class CallControl extends EventEmitter implements CallControlState { this.emitStateUpdate(); } + public applySound() { + this.setSound(this.sound); + } + private setMediaState(state: ElementMediaStatePayload) { return this.call.transport.send(ElementWidgetActions.DeviceMute, state); } @@ -55,10 +59,8 @@ export class CallControl extends EventEmitter implements CallControlState { const callDocument = this.iframe.contentDocument ?? this.iframe.contentWindow?.document; if (callDocument) { callDocument.querySelectorAll('audio').forEach((el) => { - if (el instanceof HTMLAudioElement) { - // eslint-disable-next-line no-param-reassign - el.muted = !sound; - } + // eslint-disable-next-line no-param-reassign + el.muted = !sound; }); } } From 918f72c2954df23fcd32a410a9ace4c106d0a25b Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Sun, 8 Mar 2026 00:14:13 -0500 Subject: [PATCH 02/43] fix: use port 8080 instead of 80 in Caddyfile Caddy is run with --cap-drop=ALL which removes CAP_NET_BIND_SERVICE, so binding to privileged ports (<1024) fails. Use port 8080 instead, consistent with the previous nginx-based config. --- Caddyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Caddyfile b/Caddyfile index 78700b4c..d807e8c2 100644 --- a/Caddyfile +++ b/Caddyfile @@ -4,7 +4,7 @@ } } -:80 { +:8080 { root * /app # Enable on-the-fly compression for things not pre-compressed From 0a0773fb137deb55606398f6b288a5741586f25b Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Sun, 8 Mar 2026 00:41:26 -0500 Subject: [PATCH 03/43] fix: strip cap_net_bind_service file capability from caddy binary caddy:2-alpine runs setcap cap_net_bind_service=+ep on the binary so it can bind port 80 as non-root. With --cap-drop=ALL, the bounding capability set is empty and the kernel refuses to execve any binary with file capabilities not present in the bounding set, producing: exec /usr/bin/caddy: operation not permitted Since we listen on :8080 (an unprivileged port) we don't need this capability at all, so strip it from the binary at image build time. --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index d039ccf7..a0b76dfd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,5 +21,11 @@ COPY --from=builder /src/dist / ## App FROM caddy:2-alpine +# Strip the file capability set by the base image (cap_net_bind_service=+ep). +# With --cap-drop=ALL the bounding set is empty, and the kernel refuses to exec +# any binary that has file capabilities not present in the bounding set — even +# if those capabilities aren't actually needed at runtime (we listen on :8080). +RUN setcap -r /usr/bin/caddy + COPY --from=site-dist / /app COPY Caddyfile /etc/caddy/Caddyfile From 60113fade3d7f104bc83c53092762f3ac53a1f68 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Sun, 8 Mar 2026 00:18:29 -0500 Subject: [PATCH 04/43] chore: add changeset for caddy port fix --- .changeset/caddy_port_8080.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/caddy_port_8080.md diff --git a/.changeset/caddy_port_8080.md b/.changeset/caddy_port_8080.md new file mode 100644 index 00000000..d28d082d --- /dev/null +++ b/.changeset/caddy_port_8080.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Fix Caddyfile to listen on port 8080 instead of 80. The container runs with `--cap-drop=ALL`, which removes `CAP_NET_BIND_SERVICE`, making privileged ports (<1024) unavailable. From ede0f6ddac30c6d56ae55d6666ea87b8b7dc2c10 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Sun, 8 Mar 2026 00:20:02 -0500 Subject: [PATCH 05/43] chore: update changeset wording --- .changeset/caddy_port_8080.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/caddy_port_8080.md b/.changeset/caddy_port_8080.md index d28d082d..1a26143c 100644 --- a/.changeset/caddy_port_8080.md +++ b/.changeset/caddy_port_8080.md @@ -2,4 +2,4 @@ sable: patch --- -Fix Caddyfile to listen on port 8080 instead of 80. The container runs with `--cap-drop=ALL`, which removes `CAP_NET_BIND_SERVICE`, making privileged ports (<1024) unavailable. +Fix Caddyfile to listen on port 8080 instead of 80. Deployment methods such as matrix-docker-ansible-deploy run the container with `--cap-drop=ALL`, which removes `CAP_NET_BIND_SERVICE` and makes privileged ports (<1024) unavailable. Beyond that specific constraint, binding directly to low-numbered ports inside a container is generally discouraged — production deployments are expected to sit behind a reverse proxy (e.g. Traefik, nginx) that handles port 80/443 externally. From 3212932364dd404e7bc46981b3b7fe525b1c5996 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Sun, 8 Mar 2026 00:42:17 -0500 Subject: [PATCH 06/43] chore: update changeset to cover setcap fix --- .changeset/caddy_port_8080.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.changeset/caddy_port_8080.md b/.changeset/caddy_port_8080.md index 1a26143c..bfb93d2f 100644 --- a/.changeset/caddy_port_8080.md +++ b/.changeset/caddy_port_8080.md @@ -2,4 +2,10 @@ sable: patch --- -Fix Caddyfile to listen on port 8080 instead of 80. Deployment methods such as matrix-docker-ansible-deploy run the container with `--cap-drop=ALL`, which removes `CAP_NET_BIND_SERVICE` and makes privileged ports (<1024) unavailable. Beyond that specific constraint, binding directly to low-numbered ports inside a container is generally discouraged — production deployments are expected to sit behind a reverse proxy (e.g. Traefik, nginx) that handles port 80/443 externally. +Fix container startup failure under hardened deployments (e.g. matrix-docker-ansible-deploy) that run with `--cap-drop=ALL` and `--read-only`. + +Two issues were present: + +1. `caddy:2-alpine` sets `cap_net_bind_service=+ep` as a file capability on `/usr/bin/caddy`. With an empty bounding capability set (`--cap-drop=ALL`), the kernel refuses to exec the binary entirely, producing `exec /usr/bin/caddy: operation not permitted`. Fixed by stripping the file capability in the Dockerfile (`setcap -r /usr/bin/caddy`). + +2. The Caddyfile was listening on `:80`, which is a privileged port. The container runs as a non-root user and with `CAP_NET_BIND_SERVICE` dropped, so port 80 is unavailable. Beyond that constraint, binding to low-numbered ports inside a container is generally discouraged — production deployments sit behind a reverse proxy that handles 80/443 externally. Fixed by changing the Caddyfile to listen on `:8080`. From 5c1d99422cf595a7e43b6b442b54f347c64f368d Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Sat, 7 Mar 2026 23:16:45 -0700 Subject: [PATCH 07/43] Fix picture in picture setting not effecting element-call --- ..._picture_setting_not_effecting_element_call.md | 5 +++++ src/app/hooks/useCallEmbed.ts | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .changeset/fix_picture_in_picture_setting_not_effecting_element_call.md diff --git a/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md b/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md new file mode 100644 index 00000000..b9416bb4 --- /dev/null +++ b/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md @@ -0,0 +1,5 @@ +--- +sable: minor +--- + +# Fix picture in picture setting not effecting element-call diff --git a/src/app/hooks/useCallEmbed.ts b/src/app/hooks/useCallEmbed.ts index e04182dd..280d2095 100644 --- a/src/app/hooks/useCallEmbed.ts +++ b/src/app/hooks/useCallEmbed.ts @@ -2,6 +2,8 @@ import { createContext, RefObject, useCallback, useContext, useEffect, useState import { MatrixRTCSession } from 'matrix-js-sdk/lib/matrixrtc/MatrixRTCSession'; import { MatrixClient, Room } from 'matrix-js-sdk'; import { useSetAtom } from 'jotai'; +import { settingsAtom } from '$state/settings'; +import { useSetting } from '$state/hooks/settings'; import { CallEmbed, ElementCallThemeKind, @@ -77,6 +79,19 @@ export const useCallStart = (dm = false) => { export const useCallJoined = (embed?: CallEmbed): boolean => { const [joined, setJoined] = useState(embed?.joined ?? false); + const [allowPip] = useSetting(settingsAtom, 'allowPipVideos'); + + if (embed && allowPip) { + const removeDisablePictureInPicture = (mutated: any) => { + mutated.forEach((event: any) => { + Array.from(event.target.getElementsByTagName('video')).forEach((video: any) => { + video.removeAttribute('disablepictureinpicture'); + }); + }); + }; + const pipObserver = new MutationObserver(removeDisablePictureInPicture); + pipObserver.observe(embed.iframe.contentDocument!, { subtree: true, childList: true }); + } useClientWidgetApiEvent( embed?.call, From 14bcc4454ccd4d596e78873fe2c2b2a88ec7a4ed Mon Sep 17 00:00:00 2001 From: wrigglebug <133191472+wrigglebug@users.noreply.github.com> Date: Sun, 8 Mar 2026 03:47:13 -0700 Subject: [PATCH 08/43] Adjust media sizing and URL preview layout --- src/app/components/media/media.css.ts | 2 +- .../components/message/MsgTypeRenderers.tsx | 13 ++- .../message/attachment/Attachment.css.ts | 2 +- .../components/url-preview/UrlPreview.css.tsx | 1 - .../components/url-preview/UrlPreviewCard.tsx | 109 ++++++++---------- 5 files changed, 62 insertions(+), 65 deletions(-) diff --git a/src/app/components/media/media.css.ts b/src/app/components/media/media.css.ts index b563ef3e..aad194fd 100644 --- a/src/app/components/media/media.css.ts +++ b/src/app/components/media/media.css.ts @@ -4,7 +4,7 @@ import { DefaultReset } from 'folds'; export const Image = style([ DefaultReset, { - objectFit: 'cover', + objectFit: 'contain', width: '100%', height: '100%', }, diff --git a/src/app/components/message/MsgTypeRenderers.tsx b/src/app/components/message/MsgTypeRenderers.tsx index 275cfefe..66656f94 100644 --- a/src/app/components/message/MsgTypeRenderers.tsx +++ b/src/app/components/message/MsgTypeRenderers.tsx @@ -250,19 +250,26 @@ export function MImage({ content, renderImageContent, outlined }: MImageProps) { if (typeof mxcUrl !== 'string') { return ; } - const height = scaleYDimension(imgInfo?.w || 400, 400, imgInfo?.h || 400); + const MAX_SIZE = 400; + const imgW = imgInfo?.w ?? MAX_SIZE; + const imgH = imgInfo?.h ?? MAX_SIZE; + const aspectRatio = imgInfo?.w && imgInfo?.h ? `${imgW} / ${imgH}` : undefined; + // this garbage is for portrait images, we cap the width so the card doesn't exceed the bounds of the image + const displayWidth = imgH > imgW ? Math.round(MAX_SIZE * (imgW / imgH)) : MAX_SIZE; return ( {renderImageContent({ @@ -306,7 +313,7 @@ export function MVideo({ content, renderAsFile, renderVideoContent, outlined }: return ; } - const height = scaleYDimension(videoInfo.w || 400, 400, videoInfo.h || 400); + const height = Math.min(scaleYDimension(videoInfo.w || 400, 400, videoInfo.h || 400), 400); const filename = content.filename ?? content.body ?? 'Video'; diff --git a/src/app/components/message/attachment/Attachment.css.ts b/src/app/components/message/attachment/Attachment.css.ts index 4c417611..dad95f61 100644 --- a/src/app/components/message/attachment/Attachment.css.ts +++ b/src/app/components/message/attachment/Attachment.css.ts @@ -23,7 +23,7 @@ export const Attachment = recipe({ export type AttachmentVariants = RecipeVariants; export const AttachmentHeader = style({ - padding: config.space.S300, + padding: config.space.S100, }); export const AttachmentBox = style([ diff --git a/src/app/components/url-preview/UrlPreview.css.tsx b/src/app/components/url-preview/UrlPreview.css.tsx index 3192dc49..90adc127 100644 --- a/src/app/components/url-preview/UrlPreview.css.tsx +++ b/src/app/components/url-preview/UrlPreview.css.tsx @@ -5,7 +5,6 @@ export const UrlPreview = style([ DefaultReset, { width: toRem(400), - minHeight: toRem(102), backgroundColor: color.SurfaceVariant.Container, color: color.SurfaceVariant.OnContainer, border: `${config.borderWidth.B300} solid ${color.SurfaceVariant.ContainerLine}`, diff --git a/src/app/components/url-preview/UrlPreviewCard.tsx b/src/app/components/url-preview/UrlPreviewCard.tsx index 3855085d..2d59eed4 100644 --- a/src/app/components/url-preview/UrlPreviewCard.tsx +++ b/src/app/components/url-preview/UrlPreviewCard.tsx @@ -54,69 +54,14 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number; mediaType?: s return ( - {(prev['og:video'] && ( - ); }; @@ -197,9 +190,7 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number; mediaType?: s maxWidth: '100%', margin: 0, } - : { - width: '600px', - } + : undefined } > {previewContent} From 387d28fb771470a2b5c819d2eb184e130b7cb415 Mon Sep 17 00:00:00 2001 From: wrigglebug <133191472+wrigglebug@users.noreply.github.com> Date: Sun, 8 Mar 2026 03:54:48 -0700 Subject: [PATCH 09/43] forgot about url preview images --- .../components/url-preview/UrlPreviewCard.tsx | 58 ++++++++++++------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/src/app/components/url-preview/UrlPreviewCard.tsx b/src/app/components/url-preview/UrlPreviewCard.tsx index 2d59eed4..0aaa5f7d 100644 --- a/src/app/components/url-preview/UrlPreviewCard.tsx +++ b/src/app/components/url-preview/UrlPreviewCard.tsx @@ -108,28 +108,42 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number; mediaType?: s renderThumbnail={() => } /> )} - {!prev['og:video'] && prev['og:image'] && ( - - } - renderImage={(p) => ( - - )} - /> - - )} + {!prev['og:video'] && prev['og:image'] && (() => { + const ogW = prev['og:image:width'] as number | undefined; + const ogH = prev['og:image:height'] as number | undefined; + const aspectRatio = ogW && ogH ? `${ogW} / ${ogH}` : undefined; + return ( + + } + renderImage={(p) => ( + + )} + /> + + ); + })()} {!prev['og:video'] && !prev['og:image'] && prev['og:audio'] && ( Date: Sun, 8 Mar 2026 03:58:46 -0700 Subject: [PATCH 10/43] is this what knope wanted --- .changeset/embeddeningpt1.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .changeset/embeddeningpt1.md diff --git a/.changeset/embeddeningpt1.md b/.changeset/embeddeningpt1.md new file mode 100644 index 00000000..292a3937 --- /dev/null +++ b/.changeset/embeddeningpt1.md @@ -0,0 +1,28 @@ +--- +sable: minor +--- + +# The embeddening part 1 + +#241 by @wrigglebug + +### Description + + + +Adjust media sizing and URL preview layout + +#### Type of change + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ x] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +### Checklist: + +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings From 55e83065767645ed7cd510a6f4b5cf4733b000b4 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sun, 8 Mar 2026 22:00:35 +1100 Subject: [PATCH 11/43] Display call member speaking status on bottom bar (#2742) * add mutation observer hok * add hook to read speaking member by observing iframe content * display speaking member name in call status bar and improve layout * fix shrining --- src/app/features/call-status/CallControl.tsx | 19 ++--- src/app/features/call-status/CallStatus.tsx | 43 +++++++--- src/app/features/call-status/MemberGlance.tsx | 5 +- .../features/call-status/MemberSpeaking.tsx | 78 +++++++++++++++++++ src/app/features/call-status/styles.css.ts | 4 + src/app/hooks/useCallSpeakers.ts | 60 ++++++++++++++ src/app/hooks/useMutationObserver.ts | 37 +++++++++ src/app/plugins/call/CallEmbed.ts | 4 + 8 files changed, 229 insertions(+), 21 deletions(-) create mode 100644 src/app/features/call-status/MemberSpeaking.tsx create mode 100644 src/app/hooks/useCallSpeakers.ts create mode 100644 src/app/hooks/useMutationObserver.ts diff --git a/src/app/features/call-status/CallControl.tsx b/src/app/features/call-status/CallControl.tsx index 39cd975b..097d00c9 100644 --- a/src/app/features/call-status/CallControl.tsx +++ b/src/app/features/call-status/CallControl.tsx @@ -20,12 +20,12 @@ function MicrophoneButton({ enabled, onToggle }: MicrophoneButtonProps) { {(anchorRef) => ( onToggle()} - outlined={!enabled} + outlined > @@ -51,12 +51,12 @@ function SoundButton({ enabled, onToggle }: SoundButtonProps) { {(anchorRef) => ( onToggle()} - outlined={!enabled} + outlined > ( onToggle()} - outlined={enabled} + outlined > ( setEnabled(!enabled)} - outlined={enabled} + outlined > @@ -144,9 +144,6 @@ export function CallControl({ callEmbed }: { callEmbed: CallEmbed }) { onToggle={() => callEmbed.control.toggleMicrophone()} /> callEmbed.control.toggleSound()} /> - - - callEmbed.control.toggleVideo()} /> {false && } diff --git a/src/app/features/call-status/CallStatus.tsx b/src/app/features/call-status/CallStatus.tsx index e2a17222..2b8b809f 100644 --- a/src/app/features/call-status/CallStatus.tsx +++ b/src/app/features/call-status/CallStatus.tsx @@ -12,6 +12,8 @@ import { MemberGlance } from './MemberGlance'; import { StatusDivider } from './components'; import { CallEmbed } from '../../plugins/call/CallEmbed'; import { useCallJoined } from '../../hooks/useCallEmbed'; +import { useCallSpeakers } from '../../hooks/useCallSpeakers'; +import { MemberSpeaking } from './MemberSpeaking'; type CallStatusProps = { callEmbed: CallEmbed; @@ -23,28 +25,51 @@ export function CallStatus({ callEmbed }: CallStatusProps) { const callMembers = useCallMembers(room, callSession); const screenSize = useScreenSize(); const callJoined = useCallJoined(callEmbed); + const speakers = useCallSpeakers(callEmbed); + + const compact = screenSize === ScreenSize.Mobile; + + const memberVisible = callJoined && callMembers.length > 0; return ( - - {callJoined && callMembers.length > 0 ? ( - - + + {memberVisible ? ( + ) : ( )} - - + + + {speakers.size > 0 && !compact && ( + <> + + + + + )} + + {memberVisible && ( + + + + )} - + {memberVisible && !compact && } + diff --git a/src/app/features/call-status/MemberGlance.tsx b/src/app/features/call-status/MemberGlance.tsx index f4991f93..2e65069a 100644 --- a/src/app/features/call-status/MemberGlance.tsx +++ b/src/app/features/call-status/MemberGlance.tsx @@ -10,13 +10,15 @@ import { useMediaAuthentication } from '../../hooks/useMediaAuthentication'; import { StackedAvatar } from '../../components/stacked-avatar'; import { useOpenUserRoomProfile } from '../../state/hooks/userRoomProfile'; import { getMouseEventCords } from '../../utils/dom'; +import * as css from './styles.css'; type MemberGlanceProps = { room: Room; members: CallMembership[]; + speakers: Set; max?: number; }; -export function MemberGlance({ room, members, max = 6 }: MemberGlanceProps) { +export function MemberGlance({ room, members, speakers, max = 6 }: MemberGlanceProps) { const mx = useMatrixClient(); const useAuthentication = useMediaAuthentication(); const openUserProfile = useOpenUserRoomProfile(); @@ -38,6 +40,7 @@ export function MemberGlance({ room, members, max = 6 }: MemberGlanceProps) { return ( ; +}; +export function MemberSpeaking({ room, speakers }: MemberSpeakingProps) { + const speakingNames = Array.from(speakers).map( + (userId) => getMemberDisplayName(room, userId) ?? getMxIdLocalPart(userId) ?? userId + ); + return ( + + + + {speakingNames.length === 1 && ( + <> + {speakingNames[0]} + + {' is speaking...'} + + + )} + {speakingNames.length === 2 && ( + <> + {speakingNames[0]} + + {' and '} + + {speakingNames[1]} + + {' are speaking...'} + + + )} + {speakingNames.length === 3 && ( + <> + {speakingNames[0]} + + {', '} + + {speakingNames[1]} + + {' and '} + + {speakingNames[2]} + + {' are speaking...'} + + + )} + {speakingNames.length > 3 && ( + <> + {speakingNames[0]} + + {', '} + + {speakingNames[1]} + + {', '} + + {speakingNames[2]} + + {' and '} + + {speakingNames.length - 3} others + + {' are speaking...'} + + + )} + + + ); +} diff --git a/src/app/features/call-status/styles.css.ts b/src/app/features/call-status/styles.css.ts index 26b08f0b..dd32bc3d 100644 --- a/src/app/features/call-status/styles.css.ts +++ b/src/app/features/call-status/styles.css.ts @@ -15,3 +15,7 @@ export const CallStatus = style([ export const ControlDivider = style({ height: toRem(16), }); + +export const SpeakerAvatarOutline = style({ + boxShadow: `0 0 0 ${config.borderWidth.B600} ${color.Success.Main}`, +}); diff --git a/src/app/hooks/useCallSpeakers.ts b/src/app/hooks/useCallSpeakers.ts new file mode 100644 index 00000000..24003678 --- /dev/null +++ b/src/app/hooks/useCallSpeakers.ts @@ -0,0 +1,60 @@ +import { useCallback, useEffect, useMemo, useState } from 'react'; +import { CallEmbed } from '../plugins/call'; +import { useMutationObserver } from './useMutationObserver'; +import { isUserId } from '../utils/matrix'; +import { useCallMembers, useCallSession } from './useCall'; +import { useCallJoined } from './useCallEmbed'; + +export const useCallSpeakers = (callEmbed: CallEmbed): Set => { + const [speakers, setSpeakers] = useState(new Set()); + const callSession = useCallSession(callEmbed.room); + const callMembers = useCallMembers(callEmbed.room, callSession); + const joined = useCallJoined(callEmbed); + + const videoContainers = useMemo(() => { + if (callMembers && joined) return callEmbed.document?.querySelectorAll('[data-video-fit]'); + return undefined; + }, [callEmbed, callMembers, joined]); + + const mutationObserver = useMutationObserver( + useCallback( + (mutations) => { + const s = new Set(); + + mutations.forEach((mutation) => { + if (mutation.type !== 'attributes') return; + const el = mutation.target as HTMLElement; + + const style = callEmbed.iframe.contentWindow?.getComputedStyle(el, '::before'); + if (!style) return; + const tileBackgroundImage = style.getPropertyValue('background-image'); + const speaking = tileBackgroundImage !== 'none'; + if (!speaking) return; + + const speakerId = el.querySelector('[aria-label]')?.getAttribute('aria-label'); + if (speakerId && isUserId(speakerId)) { + s.add(speakerId); + } + }); + + setSpeakers(s); + }, + [callEmbed] + ) + ); + + useEffect(() => { + videoContainers?.forEach((element) => { + mutationObserver.observe(element, { + attributes: true, + attributeFilter: ['class', 'style'], + }); + }); + + return () => { + mutationObserver.disconnect(); + }; + }, [videoContainers, mutationObserver]); + + return speakers; +}; diff --git a/src/app/hooks/useMutationObserver.ts b/src/app/hooks/useMutationObserver.ts new file mode 100644 index 00000000..5d0ce2ab --- /dev/null +++ b/src/app/hooks/useMutationObserver.ts @@ -0,0 +1,37 @@ +import { useEffect, useMemo } from 'react'; + +export type OnMutationCallback = (mutations: MutationRecord[]) => void; + +export const getMutationRecord = ( + target: Node, + mutations: MutationRecord[] +): MutationRecord | undefined => mutations.find((mutation) => mutation.target === target); + +export const useMutationObserver = ( + onMutationCallback: OnMutationCallback, + observeElement?: Node | null | (() => Node | null), + options?: MutationObserverInit +): MutationObserver => { + const mutationObserver = useMemo( + () => new MutationObserver(onMutationCallback), + [onMutationCallback] + ); + + useEffect(() => () => mutationObserver?.disconnect(), [mutationObserver]); + + useEffect(() => { + const element = typeof observeElement === 'function' ? observeElement() : observeElement; + + if (element) { + mutationObserver.observe(element, options); + } + + return () => { + if (element) { + mutationObserver.disconnect(); + } + }; + }, [mutationObserver, observeElement, options]); + + return mutationObserver; +}; diff --git a/src/app/plugins/call/CallEmbed.ts b/src/app/plugins/call/CallEmbed.ts index b852e3ef..f01cd685 100644 --- a/src/app/plugins/call/CallEmbed.ts +++ b/src/app/plugins/call/CallEmbed.ts @@ -163,6 +163,10 @@ export class CallEmbed { return this.room.roomId; } + get document(): Document | undefined { + return this.iframe.contentDocument ?? this.iframe.contentWindow?.document; + } + public setTheme(theme: ElementCallThemeKind) { return this.call.transport.send(WidgetApiToWidgetAction.ThemeChange, { name: theme, From a68832ea48cbef792a5224653081c929795e2fee Mon Sep 17 00:00:00 2001 From: wrigglebug <133191472+wrigglebug@users.noreply.github.com> Date: Sun, 8 Mar 2026 04:00:57 -0700 Subject: [PATCH 12/43] prettier --- .../components/url-preview/UrlPreviewCard.tsx | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/src/app/components/url-preview/UrlPreviewCard.tsx b/src/app/components/url-preview/UrlPreviewCard.tsx index 0aaa5f7d..4c12486c 100644 --- a/src/app/components/url-preview/UrlPreviewCard.tsx +++ b/src/app/components/url-preview/UrlPreviewCard.tsx @@ -108,42 +108,44 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number; mediaType?: s renderThumbnail={() => } /> )} - {!prev['og:video'] && prev['og:image'] && (() => { - const ogW = prev['og:image:width'] as number | undefined; - const ogH = prev['og:image:height'] as number | undefined; - const aspectRatio = ogW && ogH ? `${ogW} / ${ogH}` : undefined; - return ( - - } - renderImage={(p) => ( - - )} - /> - - ); - })()} + {!prev['og:video'] && + prev['og:image'] && + (() => { + const ogW = prev['og:image:width'] as number | undefined; + const ogH = prev['og:image:height'] as number | undefined; + const aspectRatio = ogW && ogH ? `${ogW} / ${ogH}` : undefined; + return ( + + } + renderImage={(p) => ( + + )} + /> + + ); + })()} {!prev['og:video'] && !prev['og:image'] && prev['og:audio'] && ( Date: Sun, 8 Mar 2026 04:04:31 -0700 Subject: [PATCH 13/43] eslint --- src/app/components/url-preview/UrlPreviewCard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/url-preview/UrlPreviewCard.tsx b/src/app/components/url-preview/UrlPreviewCard.tsx index 4c12486c..129614ce 100644 --- a/src/app/components/url-preview/UrlPreviewCard.tsx +++ b/src/app/components/url-preview/UrlPreviewCard.tsx @@ -111,8 +111,8 @@ export const UrlPreviewCard = as<'div', { url: string; ts: number; mediaType?: s {!prev['og:video'] && prev['og:image'] && (() => { - const ogW = prev['og:image:width'] as number | undefined; - const ogH = prev['og:image:height'] as number | undefined; + const ogW = prev['og:image:width']; + const ogH = prev['og:image:height']; const aspectRatio = ogW && ogH ? `${ogW} / ${ogH}` : undefined; return ( Date: Sun, 8 Mar 2026 13:37:14 +0100 Subject: [PATCH 14/43] fix: use absolute path for script tag to fix SSO redirect loading error --- ...directed_to_the_app_after_sso_authentication_completes.md | 5 +++++ index.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md diff --git a/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md b/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md new file mode 100644 index 00000000..2f920c4c --- /dev/null +++ b/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +# Fixed an issue where the app would fail to load after completing SSO login (e.g., logging in with matrix.org). Users are now correctly redirected to the app after SSO authentication completes. diff --git a/index.html b/index.html index 403a0618..21c34e6d 100644 --- a/index.html +++ b/index.html @@ -92,6 +92,6 @@
- + From cb807c2ef2f5a13931151671df53073a137707b9 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 10:48:22 -0500 Subject: [PATCH 15/43] Update changeset for picture in picture setting fix --- ...x_picture_in_picture_setting_not_effecting_element_call.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md b/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md index b9416bb4..ce411992 100644 --- a/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md +++ b/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md @@ -1,5 +1,5 @@ --- -sable: minor +sable: patch --- -# Fix picture in picture setting not effecting element-call +Fix picture in picture setting not effecting element-call From 51c23306558a538965be551bfb158d401e481486 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 10:52:10 -0500 Subject: [PATCH 16/43] changeset --- ..._redirected_to_the_app_after_sso_authentication_completes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md b/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md index 2f920c4c..6cc21891 100644 --- a/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md +++ b/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md @@ -2,4 +2,4 @@ sable: patch --- -# Fixed an issue where the app would fail to load after completing SSO login (e.g., logging in with matrix.org). Users are now correctly redirected to the app after SSO authentication completes. +Fixed an issue where the app would fail to load after completing SSO login (e.g., logging in with matrix.org). Users are now correctly redirected to the app after SSO authentication completes. From 6525e8db28d619a98a30cb0a9308f5472b70e908 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 18:07:18 +0100 Subject: [PATCH 17/43] add HTML escape and unescape utility functions --- src/app/utils/transformation.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/app/utils/transformation.ts diff --git a/src/app/utils/transformation.ts b/src/app/utils/transformation.ts new file mode 100644 index 00000000..86fb866f --- /dev/null +++ b/src/app/utils/transformation.ts @@ -0,0 +1,19 @@ +// some common transformations + +export function escapeHTML(str: string) { + return str + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + +export function unescapeHTML(str: string) { + return str + .replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, "'"); +} \ No newline at end of file From d9ba107c2da2129f926fe6a66a5b06e7fa013636 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 18:07:45 +0100 Subject: [PATCH 18/43] added cute events as used in for example fluffychat and commet --- src/app/hooks/useCommands.ts | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index fb171874..bd1eb715 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -34,6 +34,8 @@ import { parsePronounsInput } from '$utils/pronouns'; import { useRoomNavigate } from './useRoomNavigate'; import { enrichWidgetUrl } from './useRoomWidgets'; import { useUserProfile } from './useUserProfile'; +import { escapeHTML } from '$utils/transformation'; +import { use } from 'i18next'; export const SHRUG = '¯\\_(ツ)_/¯'; export const TABLEFLIP = '(╯°□°)╯︵ ┻━┻'; @@ -241,6 +243,9 @@ export enum Command { SetExt = 'setext', DelExt = 'delext', DiscardSession = 'discardsession', + // Cute Events + Hug = 'hug', + Cuddle = 'cuddle', } export type CommandContent = { @@ -1295,6 +1300,41 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { } }, }, + // Cute Events + [Command.Hug]: { + name: Command.Hug, + description: 'Send a hug to someone. Example: /hug [@user:example.org]', + exe: async (payload) => { + const target = payload.trim(); + await mx.sendMessage(room.roomId, { + msgtype: 'im.fluffychat.cute_event', + 'm.mentions': { + user_ids: target ? [target] : [], + }, + cute_type: 'hug', + body: `🤗`, + format: 'org.matrix.custom.html', + formatted_body: `hugs ${escapeHTML(target) ?? 'you'}`, + } as any); + }, + }, + [Command.Cuddle]: { + name: Command.Cuddle, + description: 'Send a cuddle to someone. Example: /cuddle [@user:example.org]', + exe: async (payload) => { + const target = payload.trim(); + await mx.sendMessage(room.roomId, { + msgtype: 'im.fluffychat.cute_event', + cute_type: 'cuddle', + 'm.mentions': { + user_ids: target ? [target] : [], + }, + body: `😊`, + format: 'org.matrix.custom.html', + formatted_body: `cuddles ${escapeHTML(target) ?? 'you'}`, + } as any); + }, + }, }), [mx, navigateRoom, room, profile.displayName, profile.avatarUrl, developerTools] ); From a38ad8995e49eec90506e1b7ad7fea2cd1602434 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 18:08:39 +0100 Subject: [PATCH 19/43] fix fmt issue and remove unused import --- src/app/hooks/useCommands.ts | 3 +-- src/app/utils/transformation.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index bd1eb715..c4a30421 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -31,11 +31,10 @@ import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; import { createRoomEncryptionState } from '$components/create-room'; import { parsePronounsInput } from '$utils/pronouns'; +import { escapeHTML } from '$utils/transformation'; import { useRoomNavigate } from './useRoomNavigate'; import { enrichWidgetUrl } from './useRoomWidgets'; import { useUserProfile } from './useUserProfile'; -import { escapeHTML } from '$utils/transformation'; -import { use } from 'i18next'; export const SHRUG = '¯\\_(ツ)_/¯'; export const TABLEFLIP = '(╯°□°)╯︵ ┻━┻'; diff --git a/src/app/utils/transformation.ts b/src/app/utils/transformation.ts index 86fb866f..70968dc6 100644 --- a/src/app/utils/transformation.ts +++ b/src/app/utils/transformation.ts @@ -16,4 +16,4 @@ export function unescapeHTML(str: string) { .replace(/>/g, '>') .replace(/"/g, '"') .replace(/'/g, "'"); -} \ No newline at end of file +} From 979414ae8cd5b5c305d23a7406a1a998e2f119be Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 12:12:29 -0500 Subject: [PATCH 20/43] update changeset --- .changeset/caddy_port_8080.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.changeset/caddy_port_8080.md b/.changeset/caddy_port_8080.md index bfb93d2f..2307ad0c 100644 --- a/.changeset/caddy_port_8080.md +++ b/.changeset/caddy_port_8080.md @@ -2,10 +2,4 @@ sable: patch --- -Fix container startup failure under hardened deployments (e.g. matrix-docker-ansible-deploy) that run with `--cap-drop=ALL` and `--read-only`. - -Two issues were present: - -1. `caddy:2-alpine` sets `cap_net_bind_service=+ep` as a file capability on `/usr/bin/caddy`. With an empty bounding capability set (`--cap-drop=ALL`), the kernel refuses to exec the binary entirely, producing `exec /usr/bin/caddy: operation not permitted`. Fixed by stripping the file capability in the Dockerfile (`setcap -r /usr/bin/caddy`). - -2. The Caddyfile was listening on `:80`, which is a privileged port. The container runs as a non-root user and with `CAP_NET_BIND_SERVICE` dropped, so port 80 is unavailable. Beyond that constraint, binding to low-numbered ports inside a container is generally discouraged — production deployments sit behind a reverse proxy that handles 80/443 externally. Fixed by changing the Caddyfile to listen on `:8080`. +Swap Caddy port to 8080 + fixes for MDAD setups. From df6b274d7e2693ae92b41fe34002439ec42f4a9c Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 18:49:07 +0100 Subject: [PATCH 21/43] add MCuteEvent component and implement cute event commands (wave, poke) --- src/app/components/RenderMessageContent.tsx | 10 ++++ src/app/components/message/MCuteEvent.tsx | 58 +++++++++++++++++++++ src/app/hooks/useCommands.ts | 38 ++++++++++++-- 3 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 src/app/components/message/MCuteEvent.tsx diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx index 5fcfb472..2d7ab40d 100644 --- a/src/app/components/RenderMessageContent.tsx +++ b/src/app/components/RenderMessageContent.tsx @@ -33,6 +33,7 @@ import { ImageViewer } from './image-viewer'; import { PdfViewer } from './Pdf-viewer'; import { TextViewer } from './text-viewer'; import { ClientSideHoverFreeze } from './ClientSideHoverFreeze'; +import { MCuteEvent } from './message/MCuteEvent'; type RenderMessageContentProps = { displayName: string; @@ -348,6 +349,15 @@ function RenderMessageContentInternal({ if (msgType === MsgType.Location) return ; if (msgType === 'm.bad.encrypted') return ; + // cute events + if (msgType === 'im.fluffychat.cute_event') + return ( + + ); return ; } diff --git a/src/app/components/message/MCuteEvent.tsx b/src/app/components/message/MCuteEvent.tsx new file mode 100644 index 00000000..885bba05 --- /dev/null +++ b/src/app/components/message/MCuteEvent.tsx @@ -0,0 +1,58 @@ +// rendering for cute events (e.g. hug, cuddle, etc.) + +import { MessageTextBody } from './layout'; + +enum CuteEventType { + Hug = 'hug', + Cuddle = 'cuddle', + Wave = 'wave', + Poke = 'poke', + // currently unused, but could be added in the future if there's demand for it + Kiss = 'kiss', +} + +type MCuteEventProps = { + // Content is only used to check if the event is valid, the actual text is generated based on the type and mentioned users + content: string | undefined; + // The type of cute event (e.g. hug, cuddle, etc.) + type: CuteEventType; + // The user IDs mentioned in the event (e.g. the target of the hug/cuddle/etc.) + mentionedUserIds?: string[]; +}; + +export function MCuteEvent({ content, type, mentionedUserIds }: MCuteEventProps) { + if (!content) return null; + + let cuteText = ''; + switch (type) { + case CuteEventType.Hug: + cuteText = `hugs ${mentionedUserIds?.[0] || 'you'}`; + break; + case CuteEventType.Cuddle: + cuteText = `cuddles ${mentionedUserIds?.[0] || 'you'}`; + break; + case CuteEventType.Kiss: + // in here for future expansion + // would need some kind of filtering to prevent abuse (e.g. someone sending a kiss event with a random user ID to harass them) + // cuteText = `kisses ${mentionedUserIds?.[0] || 'you'}`; + cuteText = + 'currently disabled kiss event, in light of potential abuse, may be added in the future with proper filtering'; + break; + case CuteEventType.Wave: + cuteText = `waves at ${mentionedUserIds?.[0] || 'you'}`; + break; + case CuteEventType.Poke: + cuteText = `pokes ${mentionedUserIds?.[0] || 'you'}`; + break; + default: + cuteText = `sends ${mentionedUserIds?.[0] || 'you'} a cute event`; + } + + return ( + + + {cuteText} + + + ); +} diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index c4a30421..f0dc75ca 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -31,7 +31,6 @@ import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; import { createRoomEncryptionState } from '$components/create-room'; import { parsePronounsInput } from '$utils/pronouns'; -import { escapeHTML } from '$utils/transformation'; import { useRoomNavigate } from './useRoomNavigate'; import { enrichWidgetUrl } from './useRoomWidgets'; import { useUserProfile } from './useUserProfile'; @@ -245,6 +244,9 @@ export enum Command { // Cute Events Hug = 'hug', Cuddle = 'cuddle', + // our own cute events, not part of FluffyChat or other clients + Wave = 'wave', + Poke = 'poke', } export type CommandContent = { @@ -1312,8 +1314,6 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { }, cute_type: 'hug', body: `🤗`, - format: 'org.matrix.custom.html', - formatted_body: `hugs ${escapeHTML(target) ?? 'you'}`, } as any); }, }, @@ -1329,8 +1329,36 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { user_ids: target ? [target] : [], }, body: `😊`, - format: 'org.matrix.custom.html', - formatted_body: `cuddles ${escapeHTML(target) ?? 'you'}`, + } as any); + }, + }, + [Command.Wave]: { + name: Command.Wave, + description: 'Send a wave to someone. Example: /wave [@user:example.org]', + exe: async (payload) => { + const target = payload.trim(); + await mx.sendMessage(room.roomId, { + msgtype: 'im.fluffychat.cute_event', + cute_type: 'wave', + 'm.mentions': { + user_ids: target ? [target] : [], + }, + body: `👋`, + } as any); + }, + }, + [Command.Poke]: { + name: Command.Poke, + description: 'Send a poke to someone. Example: /poke [@user:example.org]', + exe: async (payload) => { + const target = payload.trim(); + await mx.sendMessage(room.roomId, { + msgtype: 'im.fluffychat.cute_event', + cute_type: 'poke', + 'm.mentions': { + user_ids: target ? [target] : [], + }, + body: `🫵`, } as any); }, }, From d375a26db09ebbf72e25b3914f95e65d14274b3d Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 18:49:49 +0100 Subject: [PATCH 22/43] refactor comment for kiss event to clarify abuse prevention measures --- src/app/components/message/MCuteEvent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/message/MCuteEvent.tsx b/src/app/components/message/MCuteEvent.tsx index 885bba05..1294a0a5 100644 --- a/src/app/components/message/MCuteEvent.tsx +++ b/src/app/components/message/MCuteEvent.tsx @@ -33,7 +33,7 @@ export function MCuteEvent({ content, type, mentionedUserIds }: MCuteEventProps) break; case CuteEventType.Kiss: // in here for future expansion - // would need some kind of filtering to prevent abuse (e.g. someone sending a kiss event with a random user ID to harass them) + // would need some kind of filtering to prevent abuse (e.g. someone sending a kiss event to a random user to harass them) // cuteText = `kisses ${mentionedUserIds?.[0] || 'you'}`; cuteText = 'currently disabled kiss event, in light of potential abuse, may be added in the future with proper filtering'; From aa54f879af1d5c21eb271c94fef52698e4a76cd2 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 19:00:36 +0100 Subject: [PATCH 23/43] fix wrong reference --- src/app/components/RenderMessageContent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx index 2d7ab40d..4bf72235 100644 --- a/src/app/components/RenderMessageContent.tsx +++ b/src/app/components/RenderMessageContent.tsx @@ -355,7 +355,7 @@ function RenderMessageContentInternal({ ); return ; From 2542694d815c7bb570fe9a8b7e802c47d75f7fa5 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 19:03:36 +0100 Subject: [PATCH 24/43] delete unused file --- src/app/utils/transformation.ts | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 src/app/utils/transformation.ts diff --git a/src/app/utils/transformation.ts b/src/app/utils/transformation.ts deleted file mode 100644 index 70968dc6..00000000 --- a/src/app/utils/transformation.ts +++ /dev/null @@ -1,19 +0,0 @@ -// some common transformations - -export function escapeHTML(str: string) { - return str - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} - -export function unescapeHTML(str: string) { - return str - .replace(/&/g, '&') - .replace(/</g, '<') - .replace(/>/g, '>') - .replace(/"/g, '"') - .replace(/'/g, "'"); -} From 65545d1dd7337868315698917ee10ccdb636ad69 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 19:13:08 +0100 Subject: [PATCH 25/43] add changeset for the pr https://github.com/7w1/sable/pull/250 --- .changeset/add_cute_events.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/add_cute_events.md diff --git a/.changeset/add_cute_events.md b/.changeset/add_cute_events.md new file mode 100644 index 00000000..62c231a5 --- /dev/null +++ b/.changeset/add_cute_events.md @@ -0,0 +1,5 @@ +--- +sable: minor +--- + +Add `/hug`, `/cuddle`, `/wave`, and `/poke` slash commands. From ce73e612c2f6eb441fcab2863862ab0d1c52f986 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 13:15:49 -0500 Subject: [PATCH 26/43] satisfy knope --- .changeset/embeddeningpt1.md | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/.changeset/embeddeningpt1.md b/.changeset/embeddeningpt1.md index 292a3937..0e3f6979 100644 --- a/.changeset/embeddeningpt1.md +++ b/.changeset/embeddeningpt1.md @@ -1,28 +1,5 @@ --- -sable: minor +sable: patch --- -# The embeddening part 1 - -#241 by @wrigglebug - -### Description - - - Adjust media sizing and URL preview layout - -#### Type of change - -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ x] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] This change requires a documentation update - -### Checklist: - -- [ ] My code follows the style guidelines of this project -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings From 7b2772eb8a3e5bdf9e11bf83141769544bb08699 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 19:29:51 +0100 Subject: [PATCH 27/43] add headpat cute event command and integrate into message rendering --- .changeset/add_cute_events.md | 2 +- src/app/components/RenderMessageContent.tsx | 10 +++++++++- src/app/components/message/MCuteEvent.tsx | 6 +++++- src/app/hooks/useCommands.ts | 17 +++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.changeset/add_cute_events.md b/.changeset/add_cute_events.md index 62c231a5..0700ef8b 100644 --- a/.changeset/add_cute_events.md +++ b/.changeset/add_cute_events.md @@ -2,4 +2,4 @@ sable: minor --- -Add `/hug`, `/cuddle`, `/wave`, and `/poke` slash commands. +Add `/hug`, `/cuddle`, `/wave`, `/headpat`, and `/poke` slash commands. diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx index 4bf72235..3c2ded07 100644 --- a/src/app/components/RenderMessageContent.tsx +++ b/src/app/components/RenderMessageContent.tsx @@ -33,7 +33,7 @@ import { ImageViewer } from './image-viewer'; import { PdfViewer } from './Pdf-viewer'; import { TextViewer } from './text-viewer'; import { ClientSideHoverFreeze } from './ClientSideHoverFreeze'; -import { MCuteEvent } from './message/MCuteEvent'; +import { CuteEventType, MCuteEvent } from './message/MCuteEvent'; type RenderMessageContentProps = { displayName: string; @@ -358,6 +358,14 @@ function RenderMessageContentInternal({ mentionedUserIds={content?.['m.mentions']?.user_ids} /> ); + if (msgType === 'fyi.cisnt.headpat') + return ( + + ); return ; } diff --git a/src/app/components/message/MCuteEvent.tsx b/src/app/components/message/MCuteEvent.tsx index 1294a0a5..0cfa8463 100644 --- a/src/app/components/message/MCuteEvent.tsx +++ b/src/app/components/message/MCuteEvent.tsx @@ -2,11 +2,12 @@ import { MessageTextBody } from './layout'; -enum CuteEventType { +export enum CuteEventType { Hug = 'hug', Cuddle = 'cuddle', Wave = 'wave', Poke = 'poke', + Headpat = 'headpat', // currently unused, but could be added in the future if there's demand for it Kiss = 'kiss', } @@ -44,6 +45,9 @@ export function MCuteEvent({ content, type, mentionedUserIds }: MCuteEventProps) case CuteEventType.Poke: cuteText = `pokes ${mentionedUserIds?.[0] || 'you'}`; break; + case CuteEventType.Headpat: + cuteText = `gives headpats to ${mentionedUserIds?.[0] || 'you'}`; + break; default: cuteText = `sends ${mentionedUserIds?.[0] || 'you'} a cute event`; } diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index f0dc75ca..11a7936e 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -247,6 +247,7 @@ export enum Command { // our own cute events, not part of FluffyChat or other clients Wave = 'wave', Poke = 'poke', + Headpat = 'headpat', } export type CommandContent = { @@ -1362,6 +1363,22 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { } as any); }, }, + [Command.Headpat]: { + name: Command.Headpat, + description: 'Send a headpat to someone. Example: /headpat [@user:example.org]', + // not really like any of the other cute events, but it was too good not to include + // using a custom msgtype to avoid confusion with the other existing cute events + exe: async (payload) => { + const target = payload.trim(); + await mx.sendMessage(room.roomId, { + msgtype: 'fyi.cisnt.headpat', + 'm.mentions': { + user_ids: target ? [target] : [], + }, + body: `*pat pat*`, + } as any); + }, + }, }), [mx, navigateRoom, room, profile.displayName, profile.avatarUrl, developerTools] ); From f3ca62b5d25a19c1106f56a8749ac6a4c2b01837 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Sun, 8 Mar 2026 14:40:06 -0400 Subject: [PATCH 28/43] fix: default badge unread counts to off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit showUnreadCounts defaults to false — unread badges show a number only for direct mentions (Discord-style). Users can opt in to full counts in Notifications settings. --- .changeset/fix-notification-defaults.md | 7 +++++++ src/app/state/settings.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-notification-defaults.md diff --git a/.changeset/fix-notification-defaults.md b/.changeset/fix-notification-defaults.md new file mode 100644 index 00000000..f5ffbb65 --- /dev/null +++ b/.changeset/fix-notification-defaults.md @@ -0,0 +1,7 @@ +--- +sable: patch +--- + +fix: default badge unread counts to off + +Change `showUnreadCounts` default from `true` to `false`. Unread badges now show a number only for direct mentions by default (Discord-style). Users can re-enable full unread counts in Notifications settings. diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index a9c1f2ec..7174b981 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -157,7 +157,7 @@ const defaultSettings: Settings = { rightSwipeAction: RightSwipeAction.Reply, hideMembershipInReadOnly: true, useRightBubbles: false, - showUnreadCounts: true, + showUnreadCounts: false, badgeCountDMsOnly: false, showPingCounts: true, hideReads: false, From 41c779484852d3c937e0aecdb1cb98aa19edda74 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 20:01:33 +0100 Subject: [PATCH 29/43] fix: properly apply blockquotes so that custom html also gets forwarded --- .../message/modals/MessageForward.tsx | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/src/app/components/message/modals/MessageForward.tsx b/src/app/components/message/modals/MessageForward.tsx index d113cbec..84979272 100644 --- a/src/app/components/message/modals/MessageForward.tsx +++ b/src/app/components/message/modals/MessageForward.tsx @@ -153,26 +153,52 @@ export function MessageForwardInternal({ room, mEvent, onClose }: MessageForward type SendEventContent = Parameters[3]; const eventType = mEvent.getType() as SendEventType; + const originalContent = mEvent.getContent(); + const isTextMessage = originalContent.msgtype === 'm.text'; // using reference relation to indicate that this is a forwarded message, // which allows clients to display it as such - const bodyModifText = `(Forwarded message from ${isPrivate ? 'a private room' : (getRoom(room.roomId)?.name ?? 'a room')})`; + const originalBody = typeof originalContent.body === 'string' ? originalContent.body : ''; + const originalFormattedBody = + originalContent.format === 'org.matrix.custom.html' && + typeof originalContent.formatted_body === 'string' + ? originalContent.formatted_body + : undefined; + + const bodyModifText = `(Forwarded message from ${ + isPrivate ? 'a private room' : (getRoom(room.roomId)?.name ?? 'a room') + })`; + let newBodyPlain = ''; let newBodyHtml = ''; // transform if msgtype is m.text - if (mEvent.getContent().msgtype === 'm.text') { - const original = mEvent.getContent().body; - newBodyPlain = `${bodyModifText}\n\n${original + if (isTextMessage) { + const quotedBody = originalBody .split('\n') - .map((l: string) => `> ${l}`) - .join('\n')}`; - const safeHtml = sanitizeCustomHtml(original).replace(/\n/g, '
'); + .map((line) => `> ${line}`) + .join('\n'); + + newBodyPlain = originalBody.length > 0 ? `${bodyModifText}\n\n${quotedBody}` : bodyModifText; + + const safeHtml = + originalFormattedBody !== undefined + ? sanitizeCustomHtml(originalFormattedBody) + : sanitizeCustomHtml(originalBody).replace(/\n/g, '
'); + newBodyHtml = - `
` + + `
` + `

${sanitizeCustomHtml(bodyModifText)}

` + `
${safeHtml}
` + `
`; } + // the quoted body + const forwardedTextContent = isTextMessage + ? { + body: newBodyPlain, + format: 'org.matrix.custom.html', + formatted_body: newBodyHtml, + } + : {}; let content; // handle privacy stuff if (isPrivate) { @@ -180,9 +206,7 @@ export function MessageForwardInternal({ room, mEvent, onClose }: MessageForward // we can still include the original message content in the body of the message, so we'll just use a fallback text/plain content with the original message body content = { ...mEvent.getContent(), - body: newBodyPlain, - format: 'org.matrix.custom.html', - formatted_body: newBodyHtml, + ...forwardedTextContent, 'moe.sable.message.forward': { v: 1, is_forwarded: true, @@ -193,9 +217,7 @@ export function MessageForwardInternal({ room, mEvent, onClose }: MessageForward } else { content = { ...mEvent.getContent(), - body: newBodyPlain, - format: 'org.matrix.custom.html', - formatted_body: newBodyHtml, + ...forwardedTextContent, 'm.relates_to': { rel_type: 'm.reference', event_id: eventId, From d80d1f2e8896300ec134ade60c6bddc841a7970e Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 14:04:17 -0500 Subject: [PATCH 30/43] changesets --- .changeset/add_cute_events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/add_cute_events.md b/.changeset/add_cute_events.md index 0700ef8b..186180d3 100644 --- a/.changeset/add_cute_events.md +++ b/.changeset/add_cute_events.md @@ -1,5 +1,5 @@ --- -sable: minor +sable: patch --- Add `/hug`, `/cuddle`, `/wave`, `/headpat`, and `/poke` slash commands. From c36a51a6ae65d0c885df3d9a67467878c934570a Mon Sep 17 00:00:00 2001 From: "knope-bot[bot]" <152252888+knope-bot[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:06:25 +0000 Subject: [PATCH 31/43] Release packages --- .changeset/add_cute_events.md | 5 ----- .changeset/caddy_port_8080.md | 5 ----- .changeset/embeddeningpt1.md | 5 ----- ...re_in_picture_setting_not_effecting_element_call.md | 5 ----- ...ed_to_the_app_after_sso_authentication_completes.md | 5 ----- CHANGELOG.md | 10 ++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 8 files changed, 13 insertions(+), 28 deletions(-) delete mode 100644 .changeset/add_cute_events.md delete mode 100644 .changeset/caddy_port_8080.md delete mode 100644 .changeset/embeddeningpt1.md delete mode 100644 .changeset/fix_picture_in_picture_setting_not_effecting_element_call.md delete mode 100644 .changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md diff --git a/.changeset/add_cute_events.md b/.changeset/add_cute_events.md deleted file mode 100644 index 186180d3..00000000 --- a/.changeset/add_cute_events.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Add `/hug`, `/cuddle`, `/wave`, `/headpat`, and `/poke` slash commands. diff --git a/.changeset/caddy_port_8080.md b/.changeset/caddy_port_8080.md deleted file mode 100644 index 2307ad0c..00000000 --- a/.changeset/caddy_port_8080.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Swap Caddy port to 8080 + fixes for MDAD setups. diff --git a/.changeset/embeddeningpt1.md b/.changeset/embeddeningpt1.md deleted file mode 100644 index 0e3f6979..00000000 --- a/.changeset/embeddeningpt1.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Adjust media sizing and URL preview layout diff --git a/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md b/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md deleted file mode 100644 index ce411992..00000000 --- a/.changeset/fix_picture_in_picture_setting_not_effecting_element_call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Fix picture in picture setting not effecting element-call diff --git a/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md b/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md deleted file mode 100644 index 6cc21891..00000000 --- a/.changeset/fixed_an_issue_where_the_app_would_fail_to_load_after_completing_sso_login_eg_logging_in_with_matrixorg_users_are_now_correctly_redirected_to_the_app_after_sso_authentication_completes.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Fixed an issue where the app would fail to load after completing SSO login (e.g., logging in with matrix.org). Users are now correctly redirected to the app after SSO authentication completes. diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d092d27..d30fe089 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Sable Client Changelog +## 1.5.2 (2026-03-08) + +### Fixes + +* Add `/hug`, `/cuddle`, `/wave`, `/headpat`, and `/poke` slash commands. +* Swap Caddy port to 8080 + fixes for MDAD setups. +* Adjust media sizing and URL preview layout +* Fix picture in picture setting not effecting element-call +* Fixed an issue where the app would fail to load after completing SSO login (e.g., logging in with matrix.org). Users are now correctly redirected to the app after SSO authentication completes. + ## 1.5.1 (2026-03-08) ### Fixes diff --git a/package-lock.json b/package-lock.json index 76cc709f..677d29b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sable", - "version": "1.5.1", + "version": "1.5.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sable", - "version": "1.5.1", + "version": "1.5.2", "hasInstallScript": true, "license": "AGPL-3.0-only", "dependencies": { diff --git a/package.json b/package.json index fb527cd3..2c31bdd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sable", - "version": "1.5.1", + "version": "1.5.2", "description": "Yet another matrix client fork", "type": "module", "packageManager": "npm@11.11.0", From 35c0d451b71a570f90f1ab74b088b3ecdc201176 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 8 Mar 2026 20:09:15 +0100 Subject: [PATCH 32/43] added changeset for https://github.com/7w1/sable/pull/257 --- ...y_block_quotes_so_that_custom_html_also_gets_forwarded.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md diff --git a/.changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md b/.changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md new file mode 100644 index 00000000..38943b4c --- /dev/null +++ b/.changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +custom emojis are now also visible in forwards, instead of being reduced to it's shortcode From 932947077ce4212d61d4c25e4f048a0639a0cc42 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 14:33:14 -0500 Subject: [PATCH 33/43] changeset --- .changeset/a_mergeupstream.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/a_mergeupstream.md diff --git a/.changeset/a_mergeupstream.md b/.changeset/a_mergeupstream.md new file mode 100644 index 00000000..b4ac7fe0 --- /dev/null +++ b/.changeset/a_mergeupstream.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Merge upstream call fixes From e6e892cf6db33f512e7f69e89dbf21a516968388 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 14:40:03 -0500 Subject: [PATCH 34/43] lint and docs --- README.md | 4 ++-- src/app/features/call-status/MemberSpeaking.tsx | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e29839ce..606258a1 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Prebuilt images are published to `ghcr.io/7w1/sable`. Run the latest image with: ```sh -docker run --rm -p 8080:80 ghcr.io/7w1/sable:latest +docker run --rm -p 8080:8080 ghcr.io/7w1/sable:latest ``` Then open `http://localhost:8080`. @@ -42,7 +42,7 @@ services: sable: image: ghcr.io/7w1/sable:latest ports: - - '8080:80' + - '8080:8080' volumes: - ./config.json:/app/config.json:ro ``` diff --git a/src/app/features/call-status/MemberSpeaking.tsx b/src/app/features/call-status/MemberSpeaking.tsx index ddde7e6e..431bdb12 100644 --- a/src/app/features/call-status/MemberSpeaking.tsx +++ b/src/app/features/call-status/MemberSpeaking.tsx @@ -1,5 +1,4 @@ import { Room } from 'matrix-js-sdk'; -import React from 'react'; import { Box, Icon, Icons, Text } from 'folds'; import { getMemberDisplayName } from '../../utils/room'; import { getMxIdLocalPart } from '../../utils/matrix'; From a7e8223896ad6ca249b75383f4f2d80f89ded3fc Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 16:20:44 -0500 Subject: [PATCH 35/43] fix scroll when clicking message links --- .changeset/a_fix_scroll_links.md | 5 +++ src/app/features/room/RoomTimeline.tsx | 53 ++++++++++++-------------- 2 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 .changeset/a_fix_scroll_links.md diff --git a/.changeset/a_fix_scroll_links.md b/.changeset/a_fix_scroll_links.md new file mode 100644 index 00000000..035098f5 --- /dev/null +++ b/.changeset/a_fix_scroll_links.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Fix message links sometimes scrolling to bottom of timeline instead of message + maybe other scroll bugs. diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 4ea606b8..51e155a5 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -620,9 +620,13 @@ export function RoomTimeline({ } const atBottomAnchorRef = useRef(null); - const [atBottom, setAtBottom] = useState(true); + + const [atBottom, setAtBottomState] = useState(true); const atBottomRef = useRef(atBottom); - atBottomRef.current = atBottom; + const setAtBottom = useCallback((val: boolean) => { + setAtBottomState(val); + atBottomRef.current = val; + }, []); const scrollRef = useRef(null); const scrollToBottomRef = useRef({ @@ -734,6 +738,7 @@ export function RoomTimeline({ if (!alive()) return; const evLength = getTimelinesEventsCount(lTimelines); + setAtBottom(false); setFocusItem({ index: evtAbsIndex, scrollTo: true, @@ -747,7 +752,7 @@ export function RoomTimeline({ }, }); }, - [alive] + [alive, setAtBottom] ), useCallback(() => { if (!alive()) return; @@ -829,6 +834,8 @@ export function RoomTimeline({ evtTimeline && getEventIdAbsoluteIndex(timeline.linkedTimelines, evtTimeline, evtId); if (typeof absoluteIndex === 'number') { + setAtBottom(false); + const scrolled = scrollToItem(absoluteIndex, { behavior: reducedMotion ? 'instant' : 'smooth', align: 'center', @@ -837,14 +844,14 @@ export function RoomTimeline({ if (onScroll) onScroll(scrolled); setFocusItem({ index: absoluteIndex, - scrollTo: false, + scrollTo: !scrolled, highlight, }); } else { loadEventTimeline(evtId); } }, - [room, timeline, scrollToItem, loadEventTimeline, reducedMotion] + [room, timeline, scrollToItem, loadEventTimeline, reducedMotion, setAtBottom] ); useLiveTimelineRefresh( @@ -911,11 +918,15 @@ export function RoomTimeline({ }, [mx, room, hideReads]); const debounceSetAtBottom = useDebounce( - useCallback((entry: IntersectionObserverEntry) => { - if (!entry.isIntersecting) setAtBottom(false); - }, []), + useCallback( + (entry: IntersectionObserverEntry) => { + if (!entry.isIntersecting) setAtBottom(false); + }, + [setAtBottom] + ), { wait: 1000 } ); + useIntersectionObserver( useCallback( (entries) => { @@ -932,7 +943,7 @@ export function RoomTimeline({ } } }, - [debounceSetAtBottom, tryAutoMarkAsRead] + [debounceSetAtBottom, tryAutoMarkAsRead, setAtBottom] ), useCallback( () => ({ @@ -1006,36 +1017,20 @@ export function RoomTimeline({ const contentEl = scrollEl?.firstElementChild as HTMLElement; if (!scrollEl || !contentEl) return () => {}; - let lastScrollTop = scrollEl.scrollTop; - let userIsScrollingUp = false; - - // Track if user is scrolling up - const handleScroll = () => { - if (scrollEl.scrollTop < lastScrollTop) { - userIsScrollingUp = true; - } else if (scrollEl.scrollHeight - scrollEl.scrollTop <= scrollEl.clientHeight + 10) { - userIsScrollingUp = false; - } - lastScrollTop = scrollEl.scrollTop; - }; - const forceScroll = () => { // if the user isn't scrolling jump down to latest content - if (!userIsScrollingUp) { - scrollToBottom(scrollEl, 'instant'); - } + if (!atBottomRef.current) return; + scrollToBottom(scrollEl, 'instant'); }; const resizeObserver = new ResizeObserver(() => { requestAnimationFrame(forceScroll); }); - scrollEl.addEventListener('scroll', handleScroll, { passive: true }); resizeObserver.observe(contentEl); return () => { resizeObserver.disconnect(); - scrollEl.removeEventListener('scroll', handleScroll); }; }, [room]); @@ -1090,7 +1085,9 @@ export function RoomTimeline({ // reach the true bottom (e.g. after images finish loading or the // virtual keyboard shifts the viewport). if (behavior === 'instant') { - setTimeout(() => scrollToBottom(scrollEl, 'instant'), 80); + setTimeout(() => { + scrollToBottom(scrollEl, 'instant'); + }, 80); } } } From 47bed673969da35e9c816aec16e0293ed1ede5fb Mon Sep 17 00:00:00 2001 From: Trash Panda Date: Sun, 8 Mar 2026 14:26:10 -0700 Subject: [PATCH 36/43] Add MSC4144 per-message-profile rendering --- src/app/features/room/message/Message.tsx | 27 ++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index a556ee0a..a027d12e 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -349,6 +349,18 @@ function MessageInternal( const mx = useMatrixClient(); const useAuthentication = useMediaAuthentication(); + const pmp = useMemo( + () => + mEvent.event.content?.['com.beeper.per_message_profile'] as + | { + avatar_url: string | undefined; + displayname: string | undefined; + id: string | undefined; + } + | undefined, + [mEvent] + ); + // Profiles and Colors const profile = useUserProfile(senderId, room); const { color: usernameColor, font: usernameFont } = useSableCosmetics(senderId, room); @@ -358,9 +370,14 @@ function MessageInternal( // avatar so per-room avatar overrides are respected in the timeline. const avatarUrl = useMemo(() => { if (collapse) return undefined; - const mxc = getMemberAvatarMxc(room, senderId) || profile.avatarUrl; + const mxc = pmp?.avatar_url || getMemberAvatarMxc(room, senderId) || profile.avatarUrl; return mxc ? mxcUrlToHttp(mx, mxc, useAuthentication, 48, 48, 'crop') : undefined; - }, [collapse, profile.avatarUrl, senderId, mx, room, useAuthentication]); + }, [pmp, collapse, profile.avatarUrl, senderId, mx, room, useAuthentication]); + + const displayName = useMemo( + () => pmp?.displayname || senderDisplayName, + [pmp, senderDisplayName] + ); const cachedAvatar = useBlobCache(avatarUrl ?? undefined); @@ -424,7 +441,7 @@ function MessageInternal( onClick={onUsernameClick} > - {senderDisplayName} + {displayName} {showPronouns && ( @@ -467,7 +484,7 @@ function MessageInternal( } /> @@ -873,7 +890,7 @@ function MessageInternal( autoFocus value={nickDraft} onChange={(e) => setNickDraft(e.target.value)} - placeholder={senderDisplayName} + placeholder={displayName} onKeyDown={(e) => { if (e.key === 'Enter') { setNickname(senderId, nickDraft || undefined, mx); From 4b9d903d580b192cb2f62da9bd706b1f282de864 Mon Sep 17 00:00:00 2001 From: Trash Panda Date: Sun, 8 Mar 2026 14:28:15 -0700 Subject: [PATCH 37/43] Add changeset documentation --- .changeset/add_msc4144_per_message_profile_rendering.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/add_msc4144_per_message_profile_rendering.md diff --git a/.changeset/add_msc4144_per_message_profile_rendering.md b/.changeset/add_msc4144_per_message_profile_rendering.md new file mode 100644 index 00000000..335a2f49 --- /dev/null +++ b/.changeset/add_msc4144_per_message_profile_rendering.md @@ -0,0 +1,5 @@ +--- +sable: minor +--- + +Add rendering of per-message-profiles. From e5f28d2c3023c403049cb7458ad42b911179410b Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 17:06:00 -0500 Subject: [PATCH 38/43] fix crash when invalid location sent --- .changeset/aa_fix_invalid_location_crash.md | 5 +++++ src/app/components/message/MsgTypeRenderers.tsx | 3 +++ src/app/utils/common.ts | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100644 .changeset/aa_fix_invalid_location_crash.md diff --git a/.changeset/aa_fix_invalid_location_crash.md b/.changeset/aa_fix_invalid_location_crash.md new file mode 100644 index 00000000..4e6711ea --- /dev/null +++ b/.changeset/aa_fix_invalid_location_crash.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Fix crash when invalid location events are sent. diff --git a/src/app/components/message/MsgTypeRenderers.tsx b/src/app/components/message/MsgTypeRenderers.tsx index 66656f94..44b4b83c 100644 --- a/src/app/components/message/MsgTypeRenderers.tsx +++ b/src/app/components/message/MsgTypeRenderers.tsx @@ -462,7 +462,10 @@ type MLocationProps = { export function MLocation({ content }: MLocationProps) { const geoUri = content.geo_uri; if (typeof geoUri !== 'string') return ; + const location = parseGeoUri(geoUri); + if (!location) return ; + return ( {geoUri} diff --git a/src/app/utils/common.ts b/src/app/utils/common.ts index 678f1b6e..8507e06c 100644 --- a/src/app/utils/common.ts +++ b/src/app/utils/common.ts @@ -87,9 +87,17 @@ export const scaleYDimension = (x: number, scaledX: number, y: number): number = }; export const parseGeoUri = (location: string) => { + if (!location) return null; + const [, data] = location.split(':'); + if (!data) return null; + const [cords] = data.split(';'); + if (!cords) return null; + const [latitude, longitude] = cords.split(','); + if (!latitude || !longitude) return null; + return { latitude, longitude, From de8c20af638078a4e4967b2529cb1c346350118e Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 17:21:02 -0500 Subject: [PATCH 39/43] fix scroll clamping to bottom of timeline --- src/app/features/room/RoomTimeline.tsx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 51e155a5..350f7adf 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -917,33 +917,26 @@ export function RoomTimeline({ } }, [mx, room, hideReads]); - const debounceSetAtBottom = useDebounce( - useCallback( - (entry: IntersectionObserverEntry) => { - if (!entry.isIntersecting) setAtBottom(false); - }, - [setAtBottom] - ), - { wait: 1000 } - ); - useIntersectionObserver( useCallback( (entries) => { const target = atBottomAnchorRef.current; if (!target) return; const targetEntry = getIntersectionObserverEntry(target, entries); - if (targetEntry) debounceSetAtBottom(targetEntry); - if (targetEntry?.isIntersecting) { - // Track scroll position independently of atLiveEndRef so that atBottom - // is always accurate. tryAutoMarkAsRead still requires atLiveEndRef. + if (!targetEntry) return; + + if (targetEntry.isIntersecting) { + // User has reached the bottom setAtBottom(true); if (atLiveEndRef.current && document.hasFocus()) { tryAutoMarkAsRead(); } + } else { + // User has intentionally scrolled up. + setAtBottom(false); } }, - [debounceSetAtBottom, tryAutoMarkAsRead, setAtBottom] + [tryAutoMarkAsRead, setAtBottom] ), useCallback( () => ({ From 8219fab32f26729e64063be39b3efd3fc2a8be6b Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 17:23:43 -0500 Subject: [PATCH 40/43] unused import --- src/app/features/room/RoomTimeline.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 350f7adf..c6736e27 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -103,7 +103,6 @@ import { useIntersectionObserver, } from '$hooks/useIntersectionObserver'; import { markAsRead } from '$utils/notifications'; -import { useDebounce } from '$hooks/useDebounce'; import { getResizeObserverEntry, useResizeObserver } from '$hooks/useResizeObserver'; import { inSameDay, minuteDifference, timeDayMonthYear, today, yesterday } from '$utils/time'; import { createMentionElement, isEmptyEditor, moveCursor } from '$components/editor'; From 098caada938a98848056bd8accf5e65360e1ce75 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 17:26:09 -0500 Subject: [PATCH 41/43] changeset --- .changeset/a_fix_scroll_behaviour.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/a_fix_scroll_behaviour.md diff --git a/.changeset/a_fix_scroll_behaviour.md b/.changeset/a_fix_scroll_behaviour.md new file mode 100644 index 00000000..b652cb64 --- /dev/null +++ b/.changeset/a_fix_scroll_behaviour.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Fix scroll clamping to bottom while scrolling up. From fbaa36e9b3b95d79fa290d5e6ffa4a23357baf40 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sun, 8 Mar 2026 17:28:48 -0500 Subject: [PATCH 42/43] swap to patch so i have excuse to update sooner --- .changeset/add_msc4144_per_message_profile_rendering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/add_msc4144_per_message_profile_rendering.md b/.changeset/add_msc4144_per_message_profile_rendering.md index 335a2f49..8e9403c6 100644 --- a/.changeset/add_msc4144_per_message_profile_rendering.md +++ b/.changeset/add_msc4144_per_message_profile_rendering.md @@ -1,5 +1,5 @@ --- -sable: minor +sable: patch --- Add rendering of per-message-profiles. From 290f6eab04d70bc1563f48908c80c808f5fc340b Mon Sep 17 00:00:00 2001 From: "knope-bot[bot]" <152252888+knope-bot[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 22:30:18 +0000 Subject: [PATCH 43/43] Release packages --- .changeset/a_fix_scroll_behaviour.md | 5 ----- .changeset/a_fix_scroll_links.md | 5 ----- .changeset/a_mergeupstream.md | 5 ----- .changeset/aa_fix_invalid_location_crash.md | 5 ----- .../add_msc4144_per_message_profile_rendering.md | 5 ----- .changeset/fix-notification-defaults.md | 7 ------- ...uotes_so_that_custom_html_also_gets_forwarded.md | 5 ----- CHANGELOG.md | 13 +++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 10 files changed, 16 insertions(+), 40 deletions(-) delete mode 100644 .changeset/a_fix_scroll_behaviour.md delete mode 100644 .changeset/a_fix_scroll_links.md delete mode 100644 .changeset/a_mergeupstream.md delete mode 100644 .changeset/aa_fix_invalid_location_crash.md delete mode 100644 .changeset/add_msc4144_per_message_profile_rendering.md delete mode 100644 .changeset/fix-notification-defaults.md delete mode 100644 .changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md diff --git a/.changeset/a_fix_scroll_behaviour.md b/.changeset/a_fix_scroll_behaviour.md deleted file mode 100644 index b652cb64..00000000 --- a/.changeset/a_fix_scroll_behaviour.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Fix scroll clamping to bottom while scrolling up. diff --git a/.changeset/a_fix_scroll_links.md b/.changeset/a_fix_scroll_links.md deleted file mode 100644 index 035098f5..00000000 --- a/.changeset/a_fix_scroll_links.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Fix message links sometimes scrolling to bottom of timeline instead of message + maybe other scroll bugs. diff --git a/.changeset/a_mergeupstream.md b/.changeset/a_mergeupstream.md deleted file mode 100644 index b4ac7fe0..00000000 --- a/.changeset/a_mergeupstream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Merge upstream call fixes diff --git a/.changeset/aa_fix_invalid_location_crash.md b/.changeset/aa_fix_invalid_location_crash.md deleted file mode 100644 index 4e6711ea..00000000 --- a/.changeset/aa_fix_invalid_location_crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Fix crash when invalid location events are sent. diff --git a/.changeset/add_msc4144_per_message_profile_rendering.md b/.changeset/add_msc4144_per_message_profile_rendering.md deleted file mode 100644 index 8e9403c6..00000000 --- a/.changeset/add_msc4144_per_message_profile_rendering.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -Add rendering of per-message-profiles. diff --git a/.changeset/fix-notification-defaults.md b/.changeset/fix-notification-defaults.md deleted file mode 100644 index f5ffbb65..00000000 --- a/.changeset/fix-notification-defaults.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -sable: patch ---- - -fix: default badge unread counts to off - -Change `showUnreadCounts` default from `true` to `false`. Unread badges now show a number only for direct mentions by default (Discord-style). Users can re-enable full unread counts in Notifications settings. diff --git a/.changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md b/.changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md deleted file mode 100644 index 38943b4c..00000000 --- a/.changeset/fix_properly_apply_block_quotes_so_that_custom_html_also_gets_forwarded.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -sable: patch ---- - -custom emojis are now also visible in forwards, instead of being reduced to it's shortcode diff --git a/CHANGELOG.md b/CHANGELOG.md index d30fe089..f5481d8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Sable Client Changelog +## 1.5.3 (2026-03-08) + +### Fixes + +* Fix scroll clamping to bottom while scrolling up. +* Fix message links sometimes scrolling to bottom of timeline instead of message + maybe other scroll bugs. +* Merge upstream call fixes +* Fix crash when invalid location events are sent. +* Add rendering of per-message-profiles. +* custom emojis are now also visible in forwards, instead of being reduced to it's shortcode + +* fix: default badge unread counts to off + ## 1.5.2 (2026-03-08) ### Fixes diff --git a/package-lock.json b/package-lock.json index 677d29b6..5683a6d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sable", - "version": "1.5.2", + "version": "1.5.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sable", - "version": "1.5.2", + "version": "1.5.3", "hasInstallScript": true, "license": "AGPL-3.0-only", "dependencies": { diff --git a/package.json b/package.json index 2c31bdd9..2667d148 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sable", - "version": "1.5.2", + "version": "1.5.3", "description": "Yet another matrix client fork", "type": "module", "packageManager": "npm@11.11.0",