From e76139a8d115bfcce9a2e48e298abeb8880cef06 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 11:14:22 -0600 Subject: [PATCH 01/18] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de883fff..a893884f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The web app is available at [app.sable.moe](https://app.sable.moe/) and gets upd You can also download our desktop app for windows and linux from [releases](https://github.com/7w1/sable/releases/latest). ## Self-hosting -To host Cinny on your own, download this repo and built with nginx. +To host Sable on your own, download this repo and built with nginx. ```sh npm ci # Installs all dependencies From 563a31a3e5d440f3970236027fd7d8c062212dac Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 11:16:05 -0600 Subject: [PATCH 02/18] Update contribution guidelines and links --- CONTRIBUTING.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff80e4c1..b9812722 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,14 +7,13 @@ All types of contributions are encouraged and valued. Please make sure to read t > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: > > - Star the project -> - Tweet about it (tag @cinnyapp) +> - Talk abot it! > - Refer this project in your project's readme > - Mention the project at local meetups and tell your friends/colleagues -> - [Donate to us](https://cinny.in/#sponsor) ## Bug reports -Bug reports and feature suggestions must use descriptive and concise titles and be submitted to [GitHub Issues](https://github.com/ajbura/cinny/issues). Please use the search function to make sure that you are not submitting duplicates, and that a similar report or request has not already been resolved or rejected. +Bug reports and feature suggestions must use descriptive and concise titles and be submitted to [GitHub Issues](https://github.com/7w1/sable/issues). Please use the search function to make sure that you are not submitting duplicates, and that a similar report or request has not already been resolved or rejected. ## Pull requests @@ -38,7 +37,7 @@ It is not always possible to phrase every change in such a manner, but it is des Also, we use [ESLint](https://eslint.org/) for clean and stylistically consistent code syntax, so make sure your pull request follow it. -**For any query or design discussion, join our [Matrix room](https://matrix.to/#/#cinny:matrix.org).** +**For any query or design discussion, join our [Matrix room](https://matrix.to/#/#sable:sable.moe).** ## Helpful links From 47d2429c03718a9e33f3a5bf0b18c1f74126d9b8 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 13:43:59 -0600 Subject: [PATCH 03/18] fix #32 with additional check to see if an image tag is present --- CHANGELOG.md | 4 ++ .../components/message/MsgTypeRenderers.tsx | 39 ++++++++++++------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e968fe5..b69c0583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Sable Client Changelog +## 1.2.1 - in dev + +- Fix jumbo-ified non-emojis with colons. ([#32](https://github.com/7w1/sable/issues/32)) + ## 1.2.0 - Codebase cleanup ([#22](https://github.com/7w1/sable/pull/22)) diff --git a/src/app/components/message/MsgTypeRenderers.tsx b/src/app/components/message/MsgTypeRenderers.tsx index fc9acd6e..a3bc3cf4 100644 --- a/src/app/components/message/MsgTypeRenderers.tsx +++ b/src/app/components/message/MsgTypeRenderers.tsx @@ -1,4 +1,4 @@ -import React, { CSSProperties, ReactNode } from 'react'; +import React, { CSSProperties, ReactNode, useMemo } from 'react'; import { Box, Chip, Icon, Icons, Text, toRem } from 'folds'; import { IContent } from '$types/matrix-sdk'; import { JUMBO_EMOJI_REG, URL_REG } from '$appUtils/regex'; @@ -79,24 +79,37 @@ type MTextProps = { style?: CSSProperties; }; export function MText({ edited, content, renderBody, renderUrlsPreview, style }: MTextProps) { - const { body, formatted_body: customBody } = content; const [jumboEmojiSize] = useSetting(settingsAtom, 'jumboEmojiSize'); - if (typeof body !== 'string') return ; + const body = typeof content.body === 'string' ? content.body : ''; + const customBody = + typeof content.formatted_body === 'string' ? content.formatted_body : undefined; - const trimmedBody = trimReplyFromBody(body); + const trimmedBody = useMemo(() => trimReplyFromBody(body), [body]); - let safeCustomBody: string | undefined = typeof customBody === 'string' ? customBody : undefined; - if (safeCustomBody && safeCustomBody.length > 8000) { - const imageTags = safeCustomBody.match(/]*>/g); - if (imageTags) { - safeCustomBody = imageTags.join(' '); - } else { - safeCustomBody = undefined; + const safeCustomBody = useMemo(() => { + if (!customBody) return undefined; + if (customBody.length > 8000) { + const imageTags = customBody.match(/]*>/g); + return imageTags ? imageTags.join(' ') : undefined; } - } + return customBody; + }, [customBody]); + + const isJumbo = useMemo(() => { + if (!trimmedBody || trimmedBody.length >= 500) return false; + if (!JUMBO_EMOJI_REG.test(trimmedBody)) return false; + + if (trimmedBody.includes(':')) { + const hasImage = safeCustomBody && /]*>/i.test(safeCustomBody); + if (!hasImage) return false; + } + + return true; + }, [trimmedBody, safeCustomBody]); + + if (!body) return ; - const isJumbo = trimmedBody.length < 500 && JUMBO_EMOJI_REG.test(trimmedBody); const urlsMatch = renderUrlsPreview && trimmedBody.match(URL_REG); const urls = urlsMatch ? [...new Set(urlsMatch)] : undefined; From e811e20f4af8ee388df7f1b0f1397a1051df9b44 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 13:58:48 -0600 Subject: [PATCH 04/18] add title to time component showing hh:mm:ss cinnyapp#2699 --- CHANGELOG.md | 1 + src/app/components/message/Time.tsx | 19 +++++++++++++++++-- src/app/utils/time.ts | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b69c0583..46c427ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.2.1 - in dev - Fix jumbo-ified non-emojis with colons. ([#32](https://github.com/7w1/sable/issues/32)) +- Show full timestamps on hover. ([cinnyapp#2699](https://github.com/cinnyapp/cinny/issues/2699)) ## 1.2.0 diff --git a/src/app/components/message/Time.tsx b/src/app/components/message/Time.tsx index b1ba7571..37572a2a 100644 --- a/src/app/components/message/Time.tsx +++ b/src/app/components/message/Time.tsx @@ -1,6 +1,12 @@ import React, { ComponentProps } from 'react'; import { Text, as } from 'folds'; -import { timeDayMonYear, timeHourMinute, today, yesterday } from '$appUtils/time'; +import { + timeDayMonYear, + timeHourMinute, + timeHourMinuteSecond, + today, + yesterday, +} from '$appUtils/time'; export type TimeProps = { compact?: boolean; @@ -35,9 +41,18 @@ export const Time = as<'span', TimeProps & ComponentProps>( } else { time = `${timeDayMonYear(ts, dateFormatString)} ${formattedTime}`; } + const title = `${timeDayMonYear(ts, dateFormatString)} ${timeHourMinuteSecond(ts, hour24Clock)}`; return ( - + {time} ); diff --git a/src/app/utils/time.ts b/src/app/utils/time.ts index 8f1e30e9..f0beb54e 100644 --- a/src/app/utils/time.ts +++ b/src/app/utils/time.ts @@ -21,6 +21,9 @@ export const timeYear = (ts: number): string => dayjs(ts).format('YYYY'); export const timeHourMinute = (ts: number, hour24Clock: boolean): string => dayjs(ts).format(hour24Clock ? 'HH:mm' : 'hh:mm A'); +export const timeHourMinuteSecond = (ts: number, hour24Clock: boolean): string => + dayjs(ts).format(hour24Clock ? 'HH:mm:ss' : 'hh:mm:ss A'); + export const timeDayMonYear = (ts: number, dateFormatString: string): string => dayjs(ts).format(dateFormatString); From 517a81bb8fdab0eca5fb94ea965a155922d3ecf4 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 14:07:50 -0600 Subject: [PATCH 05/18] enable twitter style emojis by default imo standardized emote appearance between platforms is ideal, users that want different can manually disable them --- CHANGELOG.md | 1 + src/app/state/settings.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46c427ba..79b817dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix jumbo-ified non-emojis with colons. ([#32](https://github.com/7w1/sable/issues/32)) - Show full timestamps on hover. ([cinnyapp#2699](https://github.com/cinnyapp/cinny/issues/2699)) +- Enable Twitter-style emojis by default. ## 1.2.0 diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index 84a053ba..0ea29e16 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -72,7 +72,7 @@ const defaultSettings: Settings = { monochromeMode: false, isMarkdown: true, editorToolbar: false, - twitterEmoji: false, + twitterEmoji: true, pageZoom: 100, hideActivity: false, From 54e3d6b018b62e4fd6884203aa10359b7699029d Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 15:13:42 -0600 Subject: [PATCH 06/18] update styling on the inline editor --- CHANGELOG.md | 1 + src/app/components/editor/Toolbar.tsx | 3 ++- src/app/styles/overrides/Composer.css.ts | 10 +++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79b817dd..6627dbca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Fix jumbo-ified non-emojis with colons. ([#32](https://github.com/7w1/sable/issues/32)) - Show full timestamps on hover. ([cinnyapp#2699](https://github.com/cinnyapp/cinny/issues/2699)) - Enable Twitter-style emojis by default. +- Make inline editor buttons buttons. ## 1.2.0 diff --git a/src/app/components/editor/Toolbar.tsx b/src/app/components/editor/Toolbar.tsx index b3802581..746941c8 100644 --- a/src/app/components/editor/Toolbar.tsx +++ b/src/app/components/editor/Toolbar.tsx @@ -36,6 +36,7 @@ import { KeySymbol } from '$appUtils/key-symbol'; import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; import { stopPropagation } from '$appUtils/keyboard'; +import { floatingToolbar } from '$styles/overrides/Composer.css'; function BtnTooltip({ text, shortCode }: { text: string; shortCode?: string }) { return ( @@ -263,7 +264,7 @@ export function Toolbar() { const [isMarkdown, setIsMarkdown] = useSetting(settingsAtom, 'isMarkdown'); return ( - + <> diff --git a/src/app/styles/overrides/Composer.css.ts b/src/app/styles/overrides/Composer.css.ts index dd0c7e14..35e76d32 100644 --- a/src/app/styles/overrides/Composer.css.ts +++ b/src/app/styles/overrides/Composer.css.ts @@ -4,6 +4,10 @@ export const floatingEditor = style({ minWidth: '100%', }); +export const floatingToolbar = style({ + minWidth: '100%', +}); + globalStyle( ` ${floatingEditor} > div, @@ -18,7 +22,7 @@ globalStyle( } ); -globalStyle(`${floatingEditor} button`, { +globalStyle(`${floatingEditor} ${floatingToolbar} button`, { borderRadius: '20px', backgroundColor: 'transparent', border: 'none', @@ -27,11 +31,11 @@ globalStyle(`${floatingEditor} button`, { cursor: 'pointer', }); -globalStyle(`${floatingEditor} button *`, { +globalStyle(`${floatingEditor} ${floatingToolbar} button *`, { color: 'inherit', }); -globalStyle(`${floatingEditor} button:hover`, { +globalStyle(`${floatingEditor} ${floatingToolbar} button:hover`, { backgroundColor: 'var(--sable-surface-container-hover)', color: 'var(--sable-primary-main)', }); From eaec8f559fbf50a7f2f44d3d581395baa21ca157 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 16:42:10 -0600 Subject: [PATCH 07/18] name colors in pinned messages and linter fixes --- CHANGELOG.md | 1 + src/app/features/room/RoomViewHeader.tsx | 2 +- .../room/room-pin-menu/RoomPinMenu.tsx | 266 ++++++++++-------- 3 files changed, 149 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6627dbca..1dfe002a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Show full timestamps on hover. ([cinnyapp#2699](https://github.com/cinnyapp/cinny/issues/2699)) - Enable Twitter-style emojis by default. - Make inline editor buttons buttons. +- Name colors in pinned messages. ## 1.2.0 diff --git a/src/app/features/room/RoomViewHeader.tsx b/src/app/features/room/RoomViewHeader.tsx index d87cdec2..c3164870 100644 --- a/src/app/features/room/RoomViewHeader.tsx +++ b/src/app/features/room/RoomViewHeader.tsx @@ -82,7 +82,7 @@ async function getPinsHash(pinnedIds: string[]): Promise { return hashHex.slice(0, 10); } -interface PinReadMarker { +export interface PinReadMarker { hash: string; count: number; last_seen_id: string; diff --git a/src/app/features/room/room-pin-menu/RoomPinMenu.tsx b/src/app/features/room/room-pin-menu/RoomPinMenu.tsx index de1c0f12..12574e8c 100644 --- a/src/app/features/room/room-pin-menu/RoomPinMenu.tsx +++ b/src/app/features/room/room-pin-menu/RoomPinMenu.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/destructuring-assignment */ import React, { forwardRef, MouseEventHandler, useCallback, useMemo, useRef } from 'react'; import { MatrixEvent, Room } from '$types/matrix-sdk'; import { RoomPinnedEventsEventContent } from '$types/matrix-sdk'; @@ -76,8 +75,6 @@ import { ContainerColor } from '$styles/ContainerColor.css'; import { usePowerLevelTags } from '$hooks/usePowerLevelTags'; import { useTheme } from '$hooks/useTheme'; import { PowerIcon } from '$components/power'; -import colorMXID from '$util/colorMXID'; -import { useIsDirectRoom } from '$hooks/useRoom'; import { useRoomCreators } from '$hooks/useRoomCreators'; import { useRoomPermissions } from '$hooks/useRoomPermissions'; import { @@ -89,6 +86,8 @@ import { import { useRoomCreatorsTag } from '$hooks/useRoomCreatorsTag'; import { nicknamesAtom } from '$state/nicknames'; import { AccountDataEvent } from '$types/matrix/accountData'; +import { useSableCosmetics } from '$hooks/useSableCosmetics'; +import { PinReadMarker } from '../RoomViewHeader'; type PinnedMessageProps = { room: Room; @@ -98,110 +97,46 @@ type PinnedMessageProps = { canPinEvent: boolean; getMemberPowerTag: GetMemberPowerTag; accessibleTagColors: Map; - legacyUsernameColor: boolean; hour24Clock: boolean; dateFormatString: string; isNew: boolean; }; -function PinnedMessage({ - room, - eventId, - renderContent, - onOpen, - canPinEvent, - getMemberPowerTag, - accessibleTagColors, - legacyUsernameColor, - hour24Clock, - dateFormatString, - isNew, -}: PinnedMessageProps) { - const pinnedEvent = useRoomEvent(room, eventId); - const useAuthentication = useMediaAuthentication(); + +const PinnedMessageActiveContent = ( + props: PinnedMessageProps & { + pinnedEvent: MatrixEvent; + renderOptions: () => React.ReactNode; + handleOpenClick: MouseEventHandler; + } +) => { + const { + pinnedEvent, + room, + renderContent, + hour24Clock, + dateFormatString, + getMemberPowerTag, + renderOptions, + handleOpenClick, + } = props; + const mx = useMatrixClient(); + const useAuthentication = useMediaAuthentication(); const nicknames = useAtomValue(nicknamesAtom); - const [unpinState, unpin] = useAsyncCallback( - useCallback(() => { - const pinEvent = getStateEvent(room, StateEvent.RoomPinnedEvents); - const content = pinEvent?.getContent() ?? { pinned: [] }; - const newContent: RoomPinnedEventsEventContent = { - pinned: content.pinned.filter((id: string) => id !== eventId), - }; - - return mx.sendStateEvent(room.roomId, StateEvent.RoomPinnedEvents as any, newContent); - }, [room, eventId, mx]) - ); - - const handleOpenClick: MouseEventHandler = (evt) => { - evt.stopPropagation(); - const evtId = evt.currentTarget.getAttribute('data-event-id'); - if (!evtId) return; - onOpen(room.roomId, evtId); - }; - - const handleUnpinClick: MouseEventHandler = (evt) => { - evt.stopPropagation(); - unpin(); - }; - - const renderOptions = () => ( - - - Jump - - {canPinEvent && ( - - {unpinState.status === AsyncStatus.Loading ? ( - - ) : ( - - )} - - )} - - ); - - if (pinnedEvent === undefined) return ; - if (pinnedEvent === null) - return ( - - - Failed to load message! - - {renderOptions()} - - ); - const sender = pinnedEvent.getSender()!; + const { color: usernameColor, font: usernameFont } = useSableCosmetics(sender, room); + const displayName = getMemberDisplayName(room, sender, nicknames) ?? getMxIdLocalPart(sender) ?? sender; const senderAvatarMxc = getMemberAvatarMxc(room, sender); const getContent = (() => pinnedEvent.getContent()) as GetContentCallback; const memberPowerTag = getMemberPowerTag(sender); - const tagColor = memberPowerTag?.color - ? accessibleTagColors?.get(memberPowerTag.color) - : undefined; const tagIconSrc = memberPowerTag?.icon ? getPowerTagIconSrc(mx, useAuthentication, memberPowerTag.icon) : undefined; - const usernameColor = legacyUsernameColor ? colorMXID(sender) : tagColor; - return ( - + {displayName} @@ -251,6 +186,85 @@ function PinnedMessage({ {renderContent(pinnedEvent.getType(), false, pinnedEvent, displayName, getContent)} ); +}; + +function PinnedMessage(props: PinnedMessageProps) { + const { room, eventId, onOpen, canPinEvent } = props; + const pinnedEvent = useRoomEvent(room, eventId); + const mx = useMatrixClient(); + + const [unpinState, unpin] = useAsyncCallback( + useCallback(() => { + const pinEvent = getStateEvent(room, StateEvent.RoomPinnedEvents); + const content = pinEvent?.getContent() ?? { pinned: [] }; + const newContent: RoomPinnedEventsEventContent = { + pinned: content.pinned.filter((id: string) => id !== eventId), + }; + + return mx.sendStateEvent(room.roomId, StateEvent.RoomPinnedEvents as any, newContent); + }, [room, eventId, mx]) + ); + + const handleOpenClick: MouseEventHandler = useCallback( + (evt) => { + evt.stopPropagation(); + onOpen(room.roomId, eventId); + }, + [onOpen, room.roomId, eventId] + ); + + const handleUnpinClick: MouseEventHandler = useCallback( + (evt) => { + evt.stopPropagation(); + void unpin(); + }, + [unpin] + ); + + const renderOptions = () => ( + + + Jump + + {canPinEvent && ( + + {unpinState.status === AsyncStatus.Loading ? ( + + ) : ( + + )} + + )} + + ); + + if (pinnedEvent === undefined) return ; + + if (pinnedEvent === null) { + return ( + + + Failed to load message! + + {renderOptions()} + + ); + } + + return ( + + ); } type RoomPinMenuProps = { @@ -258,6 +272,7 @@ type RoomPinMenuProps = { requestClose: () => void; currentHash: string; }; + export const RoomPinMenu = forwardRef( ({ room, requestClose, currentHash }, ref) => { const mx = useMatrixClient(); @@ -286,26 +301,22 @@ export const RoomPinMenu = forwardRef( const [mediaAutoLoad] = useSetting(settingsAtom, 'mediaAutoLoad'); const [urlPreview] = useSetting(settingsAtom, 'urlPreview'); - const direct = useIsDirectRoom(); - const [legacyUsernameColor] = useSetting(settingsAtom, 'legacyUsernameColor'); - const [hour24Clock] = useSetting(settingsAtom, 'hour24Clock'); const [dateFormatString] = useSetting(settingsAtom, 'dateFormatString'); const { navigateRoom } = useRoomNavigate(); const scrollRef = useRef(null); - const pinMarker = useMemo(() => - room.getAccountData(AccountDataEvent.SablePinStatus)?.getContent(), - [room]); + const pinMarker = useMemo( + () => room.getAccountData(AccountDataEvent.SablePinStatus)?.getContent() as PinReadMarker, + [room] + ); const lastSeenIndex = useMemo(() => { if (!pinMarker?.last_seen_id) return -1; return pinnedEvents.indexOf(pinMarker.last_seen_id); }, [pinnedEvents, pinMarker]); - const hasNewContent = pinMarker?.hash !== currentHash; - const virtualizer = useVirtualizer({ count: sortedPinnedEvent.length, getScrollElement: () => scrollRef.current, @@ -355,9 +366,11 @@ export const RoomPinMenu = forwardRef( { [MessageEvent.RoomMessage]: (event, displayName, getContent) => { if (event.isRedacted()) { - return ( - - ); + const unsigned = event.getUnsigned(); + const redactionContent = unsigned.redacted_because?.content as + | { reason?: string } + | undefined; + return ; } return ( @@ -396,7 +409,7 @@ export const RoomPinMenu = forwardRef( {() => { if (mEvent.isRedacted()) return ; - if (mEvent.getType() === MessageEvent.Sticker) + if ((mEvent.getType() as MessageEvent) === MessageEvent.Sticker) return ( ( )} /> ); - if (mEvent.getType() === MessageEvent.RoomMessage) { + if ((mEvent.getType() as MessageEvent) === MessageEvent.RoomMessage) { const editedEvent = getEditedEvent(eventId, mEvent, evtTimeline.getTimelineSet()); - const getContent = (() => - editedEvent?.getContent()['m.new_content'] ?? - mEvent.getContent()) as GetContentCallback; + const getContent = (() => { + const eventContent = mEvent.getContent(); + const editContent = editedEvent?.getContent(); + return (editContent?.['m.new_content'] ?? eventContent) as Record< + string, + unknown + >; + }) as GetContentCallback; return ( ( /> ); } - if (mEvent.getType() === MessageEvent.RoomMessageEncrypted) + if ((mEvent.getType() as MessageEvent) === MessageEvent.RoomMessageEncrypted) return ( @@ -445,11 +463,14 @@ export const RoomPinMenu = forwardRef( ); }, - [MessageEvent.Sticker]: (event, displayName, getContent) => { + [MessageEvent.Sticker]: (event, _displayName, getContent) => { if (event.isRedacted()) { - return ( - - ); + const unsigned = event.getUnsigned(); + const redactionContent = unsigned.redacted_because?.content as + | Record + | undefined; + + return ; } return ( ( undefined, (event) => { if (event.isRedacted()) { - return ; + const unsigned = event.getUnsigned(); + const redactionContent = unsigned.redacted_because?.content as + | Record + | undefined; + return ; } return ( @@ -521,7 +546,7 @@ export const RoomPinMenu = forwardRef( isNew = originalIndex > lastSeenIndex; } else { const oldCount = pinMarker?.count ?? 0; - isNew = originalIndex >= (oldCount - 1); + isNew = originalIndex >= oldCount - 1; } } @@ -533,12 +558,14 @@ export const RoomPinMenu = forwardRef( key={vItem.index} > ( canPinEvent={canPinEvent} getMemberPowerTag={getMemberPowerTag} accessibleTagColors={accessibleTagColors} - legacyUsernameColor={legacyUsernameColor || direct} hour24Clock={hour24Clock} isNew={isNew} dateFormatString={dateFormatString} @@ -584,7 +610,7 @@ export const RoomPinMenu = forwardRef( No Pinned Messages - Users with sufficient power level can pin a messages from its context menu. + Users with sufficient power level can pin messages from the context menu. @@ -597,3 +623,5 @@ export const RoomPinMenu = forwardRef( ); } ); + +RoomPinMenu.displayName = 'RoomPinMenu'; From f50f20052ae7e5c0c70554a138eccc317cc613b3 Mon Sep 17 00:00:00 2001 From: ranidspace Date: Fri, 27 Feb 2026 18:55:43 -0500 Subject: [PATCH 08/18] Change profile pronouns to closer follow MSC4247 Fixes #23 The pronouns field is an array of pronoun sets rather than the entire array representing one set. This follows MSC4247, and aligns with the way it's displayed in gomuks and Commet. For compatibility with gomuks, the value of `language` for each is set to "en". In the future this should be set manually or use the client language. Pronoun summaries are limited to 16 characters each, and truncated to that length if it is longer. When displayed as a string, or when it is set, they are comma separated. When they are displayed next to the username in a message, they're each in an individual pill, only showing the first 3. If more than 3 are there, an extra pill showing "..." is displayed. An optional `grammatical_gender` field now exists, however it is currently unused. --- .../user-profile/UserRoomProfile.tsx | 2 +- src/app/features/room/message/Message.tsx | 33 ++++++++++--------- .../settings/account/PronounEditor.tsx | 9 ++--- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index 3d103ce8..5a32b5a9 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -63,7 +63,7 @@ function UserExtendedSection({ const clamp = (str: string, len: number) => (str.length > len ? `${str.slice(0, len)}...` : str); const [showMore, setShowMore] = useState(false); - const pronouns = profile.pronouns?.map((p: any) => clamp(p.summary, 20)).join('/'); + const pronouns = profile.pronouns?.map((p: any) => clamp(p.summary, 16)).join(', '); const timezone = profile.timezone ? clamp(profile.timezone, 64) : null; const localTime = timezone ? new Intl.DateTimeFormat([], { diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index ff7882aa..c1bc8041 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -249,20 +249,7 @@ function useMobileDoubleTap(callback: () => void, delay = 300) { ); } -function PronounTag({ pronouns, tagColor }: { pronouns?: any[]; tagColor: string }) { - if (!pronouns || pronouns.length === 0) return null; - - const clamp = (str: string, len: number) => (str.length > len ? `${str.slice(0, len)}...` : str); - - const display = clamp( - pronouns - .slice(0, 2) - .map((p) => clamp(p.summary, 48)) - .join('/'), - 128 - ); - const hasMore = pronouns.length > 2; - +function PronounPill({ summary, tagColor }: { summary: string; tagColor: string }) { return ( - {display} - {hasMore ? '...' : ''} + {summary} ); } +function PronounTag({ pronouns, tagColor }: { pronouns?: any[]; tagColor: string }) { + if (!pronouns || pronouns.length === 0) return null; + + const clamp = (str: string, len: number) => (str.length > len ? `${str.slice(0, len)}...` : str); + + const display = pronouns + .slice(0, 3) + .map((p) => ); + + if (pronouns.length > 3) { + display.push(); + } + return display; +} + function MessageInternal( { className, diff --git a/src/app/features/settings/account/PronounEditor.tsx b/src/app/features/settings/account/PronounEditor.tsx index 8cab2db2..b138c8f2 100644 --- a/src/app/features/settings/account/PronounEditor.tsx +++ b/src/app/features/settings/account/PronounEditor.tsx @@ -5,6 +5,7 @@ import { SettingTile } from '$components/setting-tile'; type PronounSet = { summary: string; language?: string; + grammatical_gender?: string; }; type PronounEditorProps = { @@ -13,7 +14,7 @@ type PronounEditorProps = { }; export function PronounEditor({ current, onSave }: PronounEditorProps) { - const initialString = current.map((p) => p.summary).join('/'); + const initialString = current.map((p) => p.summary).join(', '); const [val, setVal] = useState(initialString); useEffect(() => setVal(initialString), [initialString]); @@ -22,10 +23,10 @@ export function PronounEditor({ current, onSave }: PronounEditorProps) { if (val === initialString) return; const safeVal = val.slice(0, 128); const next = safeVal - .split('/') + .split(',') .map((s) => s.trim()) .filter(Boolean) - .map((s) => ({ summary: s.slice(0, 16) })); + .map((s) => ({ summary: s.slice(0, 16), language: "en" })); onSave(next); }; @@ -36,7 +37,7 @@ export function PronounEditor({ current, onSave }: PronounEditorProps) { return ( Date: Fri, 27 Feb 2026 20:52:20 -0500 Subject: [PATCH 09/18] Add mobile view to pronouns and refactor --- src/app/components/message/layout/Base.tsx | 4 ++ .../components/message/layout/layout.css.ts | 10 ++++ src/app/features/room/message/Message.tsx | 59 ++++++++----------- 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/app/components/message/layout/Base.tsx b/src/app/components/message/layout/Base.tsx index ac196a5b..922e704a 100644 --- a/src/app/components/message/layout/Base.tsx +++ b/src/app/components/message/layout/Base.tsx @@ -28,6 +28,10 @@ export const UsernameBold = as<'b'>(({ as: AsUsernameBold = 'b', className, ...p )); +export const PronounPill = as<'span'>(({ as: AsPronounPill = 'span', className, ...props }, ref) => ( + +)); + export const MessageTextBody = as<'div', css.MessageTextBodyVariants & { notice?: boolean }>( ({ as: asComp = 'div', className, preWrap, jumboEmoji, emote, notice, ...props }, ref) => ( void, delay = 300) { ); } -function PronounPill({ summary, tagColor }: { summary: string; tagColor: string }) { - return ( - - - {summary} - - - ); -} - -function PronounTag({ pronouns, tagColor }: { pronouns?: any[]; tagColor: string }) { +const Pronouns = as< + 'div', + { + pronouns?: any[]; + tagColor: string; + } +>(({ pronouns, tagColor, ...props }, ref) => { if (!pronouns || pronouns.length === 0) return null; const clamp = (str: string, len: number) => (str.length > len ? `${str.slice(0, len)}...` : str); + const limit = mobileOrTablet() ? 1 : 3; - const display = pronouns - .slice(0, 3) - .map((p) => ); + const display = pronouns.slice(0, limit).map((p) => ( + + {clamp(p.summary, 16)} + + )); - if (pronouns.length > 3) { - display.push(); + if (pronouns.length > limit) { + display.push( + + ... + + ); } - return display; -} + return <>{display}; +}); function MessageInternal( { @@ -405,7 +392,7 @@ function MessageInternal( {showPronouns && ( - + )} {tagIconSrc && } From 5ac46242845a74ef2f196f2f48b6a86bcc4aeacb Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 27 Feb 2026 20:27:01 -0600 Subject: [PATCH 10/18] Update 1.2.1 features & add contributor github links --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dfe002a..27171f42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.2.1 - in dev +- Update pronouns to match [MSC4247](https://github.com/matrix-org/matrix-spec-proposals/pull/4247) format better and support up to 3 pronoun pills on desktop, 1 on mobile ([#23](https://github.com/7w1/sable/issues/23), [#33](https://github.com/7w1/sable/pull/33)) - [ranidspace](https://github.com/ranidspace) + - Unfortunately, **everyone who set pronouns in Sable will need to reset them.** - Fix jumbo-ified non-emojis with colons. ([#32](https://github.com/7w1/sable/issues/32)) - Show full timestamps on hover. ([cinnyapp#2699](https://github.com/cinnyapp/cinny/issues/2699)) - Enable Twitter-style emojis by default. @@ -10,8 +12,8 @@ ## 1.2.0 -- Codebase cleanup ([#22](https://github.com/7w1/sable/pull/22)) -- Fix mono font ([#18](https://github.com/7w1/sable/pull/18)) +- Codebase cleanup ([#22](https://github.com/7w1/sable/pull/22)) - [haz](https://github.com/hazre) +- Fix mono font ([#18](https://github.com/7w1/sable/pull/18)) - [Alexia](https://github.com/cyrneko) - Merge final commits from ([cinnyapp#2599](https://github.com/cinnyapp/cinny/pull/2599)) - Unread pin counter & highlighting ([#25](https://github.com/7w1/sable/pull/25), [#31](https://github.com/7w1/sable/pull/31)) From 4730fca58aff81fbd7a56b269a8c693f4a3db640 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sat, 28 Feb 2026 01:05:06 -0600 Subject: [PATCH 11/18] Rename "Heating up" to "Petting cats" --- CHANGELOG.md | 1 + src/app/pages/ConfigConfig.tsx | 2 +- src/app/pages/client/ClientRoot.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27171f42..4e76b72c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Enable Twitter-style emojis by default. - Make inline editor buttons buttons. - Name colors in pinned messages. +- Rename "Heating up" to "Petting cats" ## 1.2.0 diff --git a/src/app/pages/ConfigConfig.tsx b/src/app/pages/ConfigConfig.tsx index dbcdca73..464b1cc3 100644 --- a/src/app/pages/ConfigConfig.tsx +++ b/src/app/pages/ConfigConfig.tsx @@ -7,7 +7,7 @@ export function ConfigConfigLoading() { - Heating up + Petting cats ); diff --git a/src/app/pages/client/ClientRoot.tsx b/src/app/pages/client/ClientRoot.tsx index a0fc61a2..9c89054b 100644 --- a/src/app/pages/client/ClientRoot.tsx +++ b/src/app/pages/client/ClientRoot.tsx @@ -50,7 +50,7 @@ function ClientRootLoading() { - Heating up + Petting cats ); From b33c3e8c11d717687b8fddd87c952044d40780d9 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sat, 28 Feb 2026 12:18:44 -0600 Subject: [PATCH 12/18] concurrency guard for profile lookups --- CHANGELOG.md | 1 + src/app/hooks/useUserProfile.ts | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e76b72c..4e83399a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Make inline editor buttons buttons. - Name colors in pinned messages. - Rename "Heating up" to "Petting cats" +- Concurrency guard for profile lookups. ## 1.2.0 diff --git a/src/app/hooks/useUserProfile.ts b/src/app/hooks/useUserProfile.ts index f1a7ea62..393fb003 100644 --- a/src/app/hooks/useUserProfile.ts +++ b/src/app/hooks/useUserProfile.ts @@ -9,6 +9,8 @@ import { useSetting } from '../state/hooks/settings'; import { settingsAtom } from '../state/settings'; import colorMXID from '$util/colorMXID'; +const inFlightProfiles = new Map>(); + export type UserProfile = { avatarUrl?: string; displayName?: string; @@ -54,9 +56,19 @@ export const useUserProfile = ( useEffect(() => { if (!needsFetch) return; + + let fetchPromise = inFlightProfiles.get(userId); + + if (!fetchPromise) { + fetchPromise = mx.getProfileInfo(userId).finally(() => { + inFlightProfiles.delete(userId); + }); + inFlightProfiles.set(userId, fetchPromise); + } + let isMounted = true; - mx.getProfileInfo(userId) + fetchPromise .then((info: any) => { if (!isMounted) return; const normalized = normalizeInfo(info); @@ -66,11 +78,13 @@ export const useUserProfile = ( })); }) .catch(() => { + if (!isMounted) return; setGlobalProfiles((prev) => ({ ...prev, [userId]: { ...prev[userId], _fetched: true }, })); }); + return () => { isMounted = false; }; From f362c2ea6d76ec6e92d3c53276fc77cfa47842e3 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sat, 28 Feb 2026 12:54:46 -0600 Subject: [PATCH 13/18] hex color input for power level editor --- CHANGELOG.md | 1 + .../permissions/PowersEditor.tsx | 35 ++++++++++++++----- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e83399a..dc6e7011 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Name colors in pinned messages. - Rename "Heating up" to "Petting cats" - Concurrency guard for profile lookups. +- Hex color input for power level editor. ## 1.2.0 diff --git a/src/app/features/common-settings/permissions/PowersEditor.tsx b/src/app/features/common-settings/permissions/PowersEditor.tsx index 1ed122a6..68cfba60 100644 --- a/src/app/features/common-settings/permissions/PowersEditor.tsx +++ b/src/app/features/common-settings/permissions/PowersEditor.tsx @@ -69,11 +69,17 @@ function EditPower({ maxPower, power, tag, onSave, onClose }: EditPowerProps) { const [iconFile, setIconFile] = useState(); const pickFile = useFilePicker(setIconFile, false); - const [tagColor, setTagColor] = useState(tag?.color); + const [tagColor, setTagColor] = useState(tag?.color || '#FFFFFF'); const [tagIcon, setTagIcon] = useState(tag?.icon); + const uploadingIcon = iconFile && !tagIcon; const tagIconSrc = tagIcon && getPowerTagIconSrc(mx, useAuthentication, tagIcon); + const handleUpdateColor = (newColor: string) => { + const sanitized = newColor.startsWith('#') ? newColor : `#${newColor}`; + setTagColor(sanitized); + }; + const iconUploadAtom = useMemo(() => { if (iconFile) return createUploadAtom(iconFile); return undefined; @@ -84,9 +90,7 @@ function EditPower({ maxPower, power, tag, onSave, onClose }: EditPowerProps) { }, []); const handleIconUploaded = useCallback((upload: UploadSuccess) => { - setTagIcon({ - key: upload.mxc, - }); + setTagIcon({ key: upload.mxc }); setIconFile(undefined); }, []); @@ -105,9 +109,11 @@ function EditPower({ maxPower, power, tag, onSave, onClose }: EditPowerProps) { const tagName = nameInput.value.trim(); if (!tagName) return; + const finalColor = /^#[0-9A-F]{6}$/i.test(tagColor) ? tagColor : undefined; + const editedTag: MemberPowerTag = { name: tagName, - color: tagColor, + color: finalColor, icon: tagIcon, }; @@ -121,10 +127,10 @@ function EditPower({ maxPower, power, tag, onSave, onClose }: EditPowerProps) { Color - + } - onRemove={() => setTagColor(undefined)} + picker={} + onRemove={() => setTagColor('#FFFFFF')} > {(openPicker, opened) => (