Commit Graph
520 Commits
Author SHA1 Message Date
Evie Gauthier 282de15601 fix: recover profile and avatar loading 2026-03-28 01:19:39 -04:00
7w1 f0ad4f5b33 Fix message forwarding by removing relation to avoid issues (#558)
### Description

This pull request fixes an issue with forwarding messages for users on
Synapse homeservers by ensuring that relations and mentions are properly
removed from forwarded messages. The changes focus on improving privacy
and preventing confusion when messages are forwarded to other rooms.

#### Forwarding and privacy improvements

- Removed the `m.relates_to` and `m.mentions` fields from the forwarded
message content to avoid leaking relations or mentions from the original
message.
- Removed the addition of a new `m.relates_to` relation when
constructing the forwarded message, preventing references to the
original event in the forwarded message.

Fixes #539

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] 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:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->

no AI was used in the creation of this PR
2026-03-27 22:59:45 +00:00
Rye 9c61f4c62e fix(message forwarding): remove relation from the forwarded message, to avoid synapse weirdness 2026-03-27 16:13:26 +01:00
7w1 95cdfa1b23 feat: room abbreviations with hover tooltips and space inheritance (#514)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

Adds a room abbreviations feature: moderators can define term/definition
pairs in room settings. Defined terms are highlighted with a dotted
underline in messages and show a tooltip on hover (tap-to-pin on
mobile). Abbreviations defined in a parent space are inherited by child
rooms and nested spaces, with overrides allowed at each level. The
settings UI shows a flat list of inherited and locally-defined entries.

Fixes #

#### 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:

- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [X] Fully AI generated (explain what all the generated code does in
moderate detail).

<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->

The code adds changes that allow for setting and viewing room
abbreviations, with an on-hover tooltip (or press on mobile -
semi-persistent). It stores these in the room state under a new key, and
recursively fetches abbreviations from the space level. This also adds
regex so that abbreviations correctly work at word boundaries. Also adds
the needed hooks to `room.ts` and `slidingSync.ts`
2026-03-26 21:18:00 +00:00
7w1 64082c4cec Add better parsing for youtube embed links (#534)
### Description

Replace the previous hacky regex method with a slightly better link
parser. Add support for timestamps, playlists and youtube music links,
tracking info is still stripped and embeds use the timestamp. Previously
none of these features were supported, this might also be slightly more
robust.

#### 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
- [X] 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
- [X] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
2026-03-26 21:16:50 +00:00
Evie Gauthier cc2c51a95b fix: replace for...of with Array.from().forEach() to satisfy no-restricted-syntax 2026-03-26 16:50:52 -04:00
Evie Gauthier 5ddb05e1b4 fix: address review comments on room abbreviations PR 2026-03-26 16:40:33 -04:00
7w1 746f777d3d Remove null value from message forwarding metadata (#540)
### Description

not setting `sender` to `null` anymore but just not setting it.

Fixes #539 (hopefully)

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] 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:

- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).

no AI was used for this PR
2026-03-26 10:13:26 -05:00
Rye e8572015f4 fix(MessageForwarding): removed null from forwarding metadata 2026-03-25 20:32:55 +01:00
Evie Gauthier bf9deae8a1 fix(abbreviations): fix lint, typecheck, and format errors 2026-03-25 12:49:18 -04:00
Evie Gauthier 18a7ca092b fix(abbreviations): highlight terms in HTML-formatted messages
Previously, abbreviation term highlighting was skipped for any message
that has a formatted_body (virtually all messages from modern clients
using a rich-text editor), because RenderBody returned early from the
customBody path before reaching the abbreviation logic.

The fix adds an optional replaceTextNode callback to
getReactCustomHtmlParser. Since opts closes over itself, renderChildren
inside element handlers recurses through the same replace function, so
text nodes nested inside <p>, <strong>, <em>, list items, etc. are all
processed correctly.

buildAbbrReplaceTextNode is exported from RenderBody.tsx and wired
into both RoomTimeline and ThreadDrawer via useRoomAbbreviationsContext.
2026-03-25 12:13:21 -04:00
hazre d8817696d6 docs: clarify resolveUnreadBadgeMode usage 2026-03-25 15:57:34 +01:00
hazre f24cf52378 chore: merge dev into hazre/fix/sidebar-count-badge-positioning 2026-03-25 15:47:50 +01:00
7w1 d3b7751aca Add forwarding error messages (#532)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->

Hopefully should help us actually figure out why many people seemingly
can't forward messages.

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] 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

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
2026-03-25 09:31:06 -05:00
hazre b7f9b851ff refactor: replace millify with Intl compact formatter 2026-03-25 15:26:32 +01:00
hazre 514535ca35 feat: cap unread badges and something extra :) 2026-03-25 15:26:32 +01:00
Thunder a7a34981cf simplify if statement 2026-03-25 15:58:45 +02:00
hazre 638e4d06d2 fix: sync sidebar unread badge mode and positioning 2026-03-25 14:06:15 +01:00
Thunder e72a40f1c9 add better parsing for youtube embed links
also introduces support for timestamps, playlists and youtube music
links, tracking info is still stripped, embeds use the timestamp
2026-03-25 12:49:38 +02:00
Evie Gauthier 920a992740 fix: abbr dotted underline + space settings label fixes
- Add textDecoration: 'underline dotted' and cursor: 'help' to <abbr>
  elements in AbbreviationTerm so users can see the hover indicator
- RoomAbbreviations: add isSpace prop; when true, show 'Space Abbreviations'
  / 'space-level' labels and hide the inherited-from-space section
- SpaceSettings: pass isSpace to RoomAbbreviations
2026-03-24 23:33:26 -04:00
Evie Gauthier 6dd62575b0 fix: case-insensitive matching, remove double tooltip, mobile tap-to-pin
- Revert to case-insensitive matching (gi flag, lowercase map keys) and
  update tests and duplicate-entry check accordingly
- Remove title attribute from <abbr> — was causing native browser tooltip
  to overlap with our custom TooltipProvider tooltip
- Extract AbbreviationTerm component; adds click/tap handler that pins
  the definition as a PopOut positioned above the term
  - Desktop: hover still shows tooltip via TooltipProvider
  - Mobile: tap pins the tooltip open; tap anywhere else dismisses it
    (one-shot document click listener, stopped by e.stopPropagation so
    the opening click does not immediately close it)
2026-03-24 23:33:24 -04:00
Evie Gauthier 4460047365 feat: add room abbreviations with hover tooltips (#403)
- Add StateEvent.RoomAbbreviations ('moe.sable.room.abbreviations')
- Include abbreviations event in sliding sync required state
- Add AbbreviationsPage to RoomSettingsPage enum
- New RoomAbbreviations settings page (add/remove term+definition pairs)
- Wire page into RoomSettings.tsx menu
- New useRoomAbbreviations hook + RoomAbbreviationsContext
- Provide context in Room.tsx
- RenderBody.tsx: highlight defined terms in plain-text messages with
  TooltipProvider+abbr tooltip; HTML messages unaffected
2026-03-24 23:33:22 -04:00
7w1 764210dd5a add forwarding errors 2026-03-24 22:29:59 -05:00
7w1 28d8e942ac fix jumbo emojis for messages sent with a per-message-profile (#530)
### Description

added a regex to the rendering of messages to detect jumbo emojis. the
regex used is:

```
^(<img[^>]*data-mx-emoticon[^>]*\/>){1,20}$
```

Fixes https://github.com/SableClient/Sable/issues/458

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] 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:

- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).

no AI was used in the creation of this PR
2026-03-25 03:12:30 +00:00
Rye 7338be259a fix(Message rederer): jumbo emojis for messages sent with a Per-Message-Profile
added a RegEx to match emoticons, if a message contains 1 to 20 emoticons
2026-03-25 03:34:17 +01:00
Cassie 8ad6b8b19b Feat: add quickreply keybindings 2026-03-24 15:24:36 -06:00
7w1 fec777aed4 Decode urls safely to avoid crashes (#512)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->

Fixes #510 

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] 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

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
2026-03-24 10:00:23 -05:00
7w1 6ac65cc1f8 stupid linter 2026-03-24 09:58:09 -05:00
7w1 418fe2cc1a unduplicate code 2026-03-24 09:56:13 -05:00
7w1 80c207fc0d linter 2026-03-24 09:51:08 -05:00
7w1 7a6c74eeee decode urls safely! 2026-03-24 09:45:14 -05:00
Shea Duma ad9997756a fixed message edit overtaking the autocomplete for enter 2026-03-24 07:46:00 +02:00
Shea Duma 61151ae909 Merge remote-tracking branch 'upstream/dev' into emoji-scrolling
Updated to the latest version
2026-03-24 07:29:58 +02:00
7w1 f5d9e4a9c7 Fix: Add max height to state events (#491)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description
This PR wants to cap the height of an event to prevent one single event
taking the entire screensize.

(before the PR)
<img width="1331" height="867" alt="image"
src="https://github.com/user-attachments/assets/b299cacd-85ff-4496-ac28-174c9f511faa"
/>

(after the PR)
<img width="1321" height="769" alt="image"
src="https://github.com/user-attachments/assets/abbdcab2-b375-4572-909c-d59ff6e294b5"
/>

Fixes #

#### Type of change
prevents

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] 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:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
2026-03-24 05:25:24 +00:00
7w1 70fade9189 fix standard embeds not rendering 2026-03-24 00:23:57 -05:00
Shea Duma e2959e663a redone the formatting to focus it as a short variant while maximizing information provided 2026-03-24 07:12:30 +02:00
Thunder 57208c9e00 fix final lints, add changeset 2026-03-24 00:46:24 +02:00
Thunderandtaskylizard 8cef4107b0 fix lints
Co-authored-by: taskylizard <[email protected]>
2026-03-24 00:22:55 +02:00
Thunder 17263e712a fixup 2026-03-24 00:22:55 +02:00
Thunder eefc4cdb38 don't nest ternary 2026-03-24 00:22:55 +02:00
Thunder f24bcb1bf5 formatting 2026-03-24 00:22:55 +02:00
Thunder c20479b689 cleanup and finalization ish 2026-03-24 00:22:55 +02:00
Thunder e5906183d7 horrendous state but it kind of works hopefully i can squash these 2026-03-24 00:22:55 +02:00
Shea Duma 6e490460d8 fixed the file description field being way too small when having the new editor 2026-03-23 14:15:00 +02:00
7w1 1451be371c fix my merge :3 2026-03-23 00:22:35 -05:00
7w1 1a7b555baf Merge branch 'dev' into more-styled-events 2026-03-23 00:20:15 -05:00
7w1 e5fe0813ce Merge branch 'dev' into more-styled-events 2026-03-23 00:11:31 -05:00
7w1 03daf81868 feat: reply mention indicator (#465)
<!-- Please read
https://github.com/ajbura/cinny/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

in yet another episode of "mini_bomba yoinks discord features into
sable":
reply mention indicators (the @ before the username, not the yellow
highlight)
<img width="239" height="124" alt="image"
src="https://github.com/user-attachments/assets/95a7a25a-7d70-4913-8cf8-c560f8605fcd"
/>

proudly vibecoded using my brain, while referencing matrix client docs

#### 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:

- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings
2026-03-23 05:09:42 +00:00
7w1 43ef337d2c Add knocking support (#470)
<!-- Please read
https://github.com/ajbura/cinny/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

This adds support for room knocking to Sable from both space hierarchy
and the room card (as seen when joining from address, clicking a room
mention, or in the featured page of discovery). It additionally adds a
new modal type that may be used for all knock attempts.

Fixes #

#### 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:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
2026-03-23 05:01:25 +00:00
7w1 4fbcfef90d feat: add editor multiline mode and many edge case fixes (#476)
### Description

Fixes #350

This adds a dynamic multiline layout to `CustomEditor`. When the message
input grows past a single line (word wrap, explicit newlines, or
multiple blocks), the editor shifts from a single-row layout into a
two-row grid, before/textarea on top, with responsive content spanning
the full width below. It drops back to single-row once the text fits on
one line again.

The old `replacementContent` prop (which swapped out the textarea on
mobile during voice recording) is gone. It's replaced by
`responsiveAfter`, which renders inline next to the send button in
single-line mode and moves down to the footer row in multiline mode.
There's also a `forceMultilineLayout` prop for when you want to push
into multiline immediately, which is what we use when the audio recorder
opens. This means the recorder now takes the same code path on desktop
and mobile instead of having a separate mobile-only branch.

A few other things got fixed along the way:

- Holding the record button on mobile was selecting the "following the
conversation" text underneath it. Fixed with `userSelect: none`.
(related to #350)
- The stop button's `onClick` was being skipped on mobile entirely, so
if `pointerup` got lost mid-drag there was no way to stop recording. Now
`onClick` works as a fallback when recording is already active. (a form
of recovery in case more situations like #350 happen again)
- The waveform bar count is now calculated from the actual container
width via `ResizeObserver` instead of a hardcoded number.
- `cleanupMediaRecorder` wasn't being called in all the
stop/delete/restart/error/unmount paths, which could leave the mic track
open. That's fixed.
- Firefox couldn't seek voice messages because `audio/webm` doesn't
include a seek index. Codec preference now puts `audio/ogg;codecs=opus`
first so Firefox records seekable blobs. Also added a `seekTo` helper
that waits for `loadedmetadata` if the audio element isn't ready yet,
and `audio.preload = 'auto'` + `audio.load()` on mount so Firefox parses
metadata right away.
- Multiline wrap detection is now debounced through
`requestAnimationFrame` and uses a `ResizeObserver` on the scroll
container to cut down on flicker and extra re-renders.
- Added cloudflared tunnels for easier testing on mobile

Also sorry for the cursed line height measurer, there was legit no other
way to detect it that didn't cause other issues.

Good amount of this was created with help of AI (like figuring out
options on how to fix the edge cases), especially the edge case unit
tests, but It had to be fixed by hand in many places and frankly I can't
tell you exactly where was what. I've been working on this for couple
days now.. (losing my mind over it)

### Screenshots:

https://github.com/user-attachments/assets/bcff3766-6c60-46c7-ac9e-a8b943a665d3

https://github.com/user-attachments/assets/367cdcc4-666e-4324-8e81-1b415feb0aca

#### Type of change
- [x] 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:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings

### AI disclosure:

- [x] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
2026-03-23 04:02:36 +00:00