Commit Graph
571 Commits
Author SHA1 Message Date
Shea Duma e0c61ebdcc making the md checker happi 2026-04-11 20:51:05 +03:00
Shea Duma 9d77e8ab9f small fix sticking and showing the wrong item in the preview 2026-04-11 20:43:34 +03:00
github-actions[bot] d6def47b4d chore: prepare release 1.14.0 2026-04-10 03:16:07 +00:00
7w1 ff8d1c73b2 Update donation links to Open Collective
Updated support links for donations.
2026-04-09 22:12:00 -05:00
7w1 882876e9ff feat(threads): thread drawer, thread browser, live reply counts, and unread badges (#564)
📝 **Docs:** Already live at [Threads — Sable
Docs](https://docs.sable.moe/new-features/threads/) — no separate docs
PR needed.

---

### Description

Expands Matrix thread support with a full thread drawer, server-side
thread browser, live reply counts, unread badges, and several UX fixes.

#### ThreadDrawer

- Slide-in drawer for reading and replying in threads without leaving
the main room
- Thread root message shown at top with full reply history below
- Up-arrow edit-last-message: pressing ↑ in the thread input edits the
user's last own message in that thread
- Reactions add/remove trigger immediate re-renders without manual
refresh (handles the fact that reaction events carry
`m.relates_to.event_id` not `threadRootId` directly — fetches target
event to check thread membership)
- Thread root message box sized to content with `maxHeight: 200px` to
avoid dead whitespace on short messages

#### ThreadBrowser

- Lists all threads in the room; calls `room.fetchRoomThreads()` on
mount to load threads beyond the local timeline window
- Load-more button when the server has additional thread pages
- Each thread preview shows sender avatar, display name, reply count,
and last message body with ellipsis truncation
- Jump button navigates to the thread root in the main timeline (via
`useRoomNavigate`) instead of re-opening the drawer
- Thread unread badges on each preview item via
`room.getThreadUnreadNotificationCount()`

#### ThreadReplyChip (main timeline)

- Shows unread badge for threads with unseen replies via
`room.getThreadUnreadNotificationCount()`

#### Thread button (RoomViewHeader)

- If a thread drawer is open, button closes the drawer and opens the
thread browser (allows going from a single thread to the full list)
- If no thread is open, button toggles the thread browser as before
- `aria-pressed` reflects both thread browser state and open thread
drawer

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

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

ThreadDrawer/ThreadBrowser/thread-chip iterations were partially AI
assisted; I reviewed and adjusted logic for timeline processing, thread
loading, and event rendering behavior.
2026-04-10 03:01:30 +00:00
7w1 f590b99339 fix: use file name instead of 'a voice message' for non-voice audio (#651)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

Only labels audio files as "a voice message" when they actually are
voice messages (have waveform data). Regular audio files (music,
podcasts) now use the file name as the body text instead.

Fixes #543

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

- [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).

The `isVoice` check logic was written alongside an AI tool. It checks
whether the audio message event contains `waveform` data in
`content.info` to distinguish voice messages from regular audio file
uploads. If waveform data is absent, the message body falls back to the
file name from `content.body` instead of the hardcoded "a voice message"
string.
2026-04-10 02:41:59 +00:00
7w1 72da551ae0 fix(timeline): fix blank room timeline when app returns from background (#657)
## Description

When the app returns from background, `retryImmediately()` triggers a
fresh sliding sync response. If the server includes `initial: true` for
the currently open room, the SDK emits `RoomEvent.TimelineReset`,
replacing the live timeline with a new empty one. `eventsLength` drops
to 0 but `isReady` stays `true`, leaving the message list visually blank
for ~500 ms until events re-arrive from the server.

### Changes

**`RoomTimeline.tsx`**

- Added a `useLayoutEffect` that detects `eventsLength` dropping to 0
while the timeline is already visible (`isReady === true`). It
immediately sets `isReady = false` and resets `hasInitialScrolledRef`,
re-arming the existing initial-scroll logic. Uses `useLayoutEffect` so
the transition happens before the browser paints — the blank frame is
never shown.

- Expanded `showLoadingPlaceholders`, `vListItemCount`, and the
container `opacity` to include the `!isReady` case, so skeleton
placeholders are shown immediately during the reload rather than leaving
an invisible list.

### Before / After

| Before | After |
|--------|-------|
| Room goes blank for ~500 ms on foreground return | Skeleton
placeholders appear instantly, then content fades in |

Fixes #

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

## AI disclosure:

Fully AI generated (explain what all the generated code does in moderate
detail).

The `useLayoutEffect` guard and the three `!isReady` condition
expansions were fully AI generated. The effect fires synchronously
before paint when `eventsLength` drops to 0 on an already-visible
timeline, hides content and resets the initial-scroll flag. The existing
80 ms scroll timer then re-runs once events refill and calls
`setIsReady(true)`. The `showLoadingPlaceholders` / `vListItemCount`
changes ensure VList renders 3 placeholder skeleton rows (matching the
existing pagination-loading behaviour) while events are absent.
2026-04-10 02:41:17 +00:00
7w1 35e147a564 Feat: Add the ability to set Global Name Colors dependent on the theme (dark/light) (#656)
<!-- 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. -->
This PR proposes the ability to set up different Global Name Colors with
the purpose of making names easier to read for everyone independent on
which theme they might choose to use.

The Global Name Colors options are the General for legacy puroses, Dark
and Light Theme.

(example of the issue)
<img width="620" height="565" alt="image"
src="https://github.com/user-attachments/assets/ba3e5abd-b390-4fea-864d-ff290507efd3"
/>
Here the names of 7w1, Shea, Lunia and potentially Haz are hard to read
if one chooses to use a Light theme.

(example of the name Shea being corrected for using this PR)
<img width="619" height="568" alt="image"
src="https://github.com/user-attachments/assets/11720d83-573d-442f-9ee6-139e294089ab"
/>

This PR also reorganizes the setting for the Global Name Colors location
in order to align it more to the style of the other settings:
<img width="817" height="696" alt="image"
src="https://github.com/user-attachments/assets/ef25c513-9503-4a05-bed9-0ba81a10e188"
/>

And puts the Save button to the left as to not move the text box and the
selector button when it appears:
<img width="816" height="699" alt="image"
src="https://github.com/user-attachments/assets/9df3e1bc-1951-4d7a-a931-44a05e9156b1"
/>

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

### 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. -->
My anxiety about the future helped me overthink the solution into
existence
2026-04-10 02:40:19 +00:00
Evie Gauthier 3aacd916db chore: add changeset for timeline-blank-on-foreground fix 2026-04-09 15:13:11 -04:00
7w1 f82446a2c6 fix: prevent iOS overscroll on root element (#650)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

Adds `overscroll-behavior: none` to the `html` element to prevent the
elastic bounce-back scroll on iOS from competing with the timeline
scroll.

Fixes #500

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

- [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).

The CSS property addition (`overscroll-behavior: none` on the `html`
selector) was suggested by an AI tool. It sets the browser's overscroll
behavior to prevent the elastic bounce effect on iOS from propagating to
the root element, which was causing the timeline scroll to fight with
the page-level bounce-back.
2026-04-09 16:21:04 +00:00
7w1 1ac0b08294 fix: constrain bug report modal to viewport height (#652)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

Constrains the bug report modal to 90vh max height so it doesn't
overflow the viewport, which was cropping the close button and header
text.

Fixes #629

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

- [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).

The `maxHeight` and `overflow` style additions to `BugReportModal.tsx`
were written alongside an AI tool. The changes add `maxHeight: '90vh'`
to the MUI Modal component and its inner Box container, with `overflow:
'hidden'` on the Box to prevent the modal from growing beyond the
viewport. The inner content area uses `overflowY: 'auto'` so the form
fields remain scrollable within the constrained modal.
2026-04-09 16:20:22 +00:00
7w1 55d5ed9972 Fix dm navigation breaking (#653)
<!-- 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 the DMs button in the side bar taking you to a page than isn't a
dm.
The DM button just restores a page navigation from local storage, so if
that local storage is messed up somehow, then you can't get to dms. This
adds a check to ensure you always go to dms.

How this happened to me? I have no idea.

#### 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).
<!-- 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-04-09 11:19:48 -05:00
Shea Duma 8143a17d6d added changeset 2026-04-09 07:26:24 +03:00
Matt Van Horn 027f6ae1c0 docs: add changeset for bug report modal fix 2026-04-07 12:26:20 -07:00
Matt Van Horn ea59ca2395 docs: add changeset for audio description fix 2026-04-07 12:26:06 -07:00
Matt Van Horn fb8450ec8b docs: add changeset for iOS overscroll fix 2026-04-07 12:25:37 -07:00
7w1 5e96ce071a Add DM custom images, DM statuses, Member Tile statuses (#644)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description
Adds DM custom images and topics because i loved them when i was using
fluffy, present under a new setting that is on by default, so that
within DM navigation one can have any image as the DM's icon, helping me
personally at least with secrecy when screensharing.

(example where in the background it is visible that it is a dm with
someone but it has a custom image)
<img width="1859" height="1080" alt="image"
src="https://github.com/user-attachments/assets/ca654cdb-c300-4660-b304-91a19cedb3ba"
/>

(example with some spaces that have custom images, one having an
intentionally ZWS description)
<img width="1859" height="1080" alt="image"
src="https://github.com/user-attachments/assets/5b1bbad9-a19c-44d1-bf07-550b4283c08e"
/>

(example of dms with statuses, offline being marked as not showing a
badge)
<img width="243" height="107" alt="image"
src="https://github.com/user-attachments/assets/e986dd05-5647-4de1-ac86-1fe8ef97c294"
/>

(example of the new look of the member drawer)
<img width="811" height="687" alt="image"
src="https://github.com/user-attachments/assets/bf575ba9-2a2b-4526-85fb-4bf673afd963"
/>
<img width="414" height="693" alt="image"
src="https://github.com/user-attachments/assets/8127d9d2-c407-415a-952c-daecfefc1a3c"
/>

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

### 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. -->
My generalized brain fog coalesced into the implementation.
2026-04-07 15:39:41 +00:00
7w1 09fe8d9298 markdown file not dm file... 2026-04-07 10:36:24 -05:00
7w1 dfe096b2bf fix dms nav 2026-04-07 10:30:24 -05:00
Shea Duma dd842d63cb merge 2026-04-07 00:56:23 +03:00
Evie Gauthier 76333bdb6d chore: add changeset for feat-thread-enhancements 2026-04-06 12:53:55 -04:00
Shea Duma d92f47a96f add changeset and statuses in member tile 2026-04-06 06:02:23 +03:00
Septicity 73c139f719 Re-introduce custom HTML formatting for long messages
- The issue that this was originally removed to fix was actually only related to jumbo emojis.
- Since I've kept the safety mechanisms for jumbo emojis, there should be no regression.
2026-04-05 06:05:45 -05:00
Shea Duma a2c6eeb1b7 fix invisible names 2026-04-05 05:42:40 +03:00
7w1 72fcd1ae61 fix: preserve linkification in formatted body text (#632)
### Description

Fixes the regression caused by
https://github.com/SableClient/Sable/commit/18a7ca092 that makes urls
not get dedicated in `formatted_body`

- preserve auto-linking for bare URLs in `formatted_body` text nodes
when abbreviation replacement runs
- keep URL tokens intact when an abbreviation term appears inside the
URL itself
- add regression coverage for adjacent-to-URL and inside-URL
abbreviation cases

#### 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).
- [x] Fully AI generated (explain what all the generated code does in
moderate detail).
2026-04-04 01:00:16 +00:00
7w1 4ff8b3c8e7 Add setting to collapse folders by default (#624)
<!-- 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. -->

Adds a setting to visual tweaks that allows collapsing folders by
default instead of the current behavior of saving the state of
opened/closed folders

Fixes #616

#### 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).
- [ ] 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-04-03 19:54:21 -05:00
7w1 0ed196dd46 Add a dismiss button to command messages (#625)
<!-- 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. -->

Adds a dismiss button to command feedback messages and clarifies that
they're client side

Fixes #594

#### 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).
- [ ] 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-04-03 19:53:56 -05:00
7w1 9ffeedd8d6 Fix focus when replying to messages (#623)
<!-- 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. -->

Recaptures input box focus when replying to a message.

Fixes #621

#### 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).
<!-- 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-04-03 19:53:38 -05:00
hazre 00c454424a docs: add changeset for formatted body links 2026-04-02 14:02:13 +02:00
Septicity 93165ad8d4 fix: Make scrolling in encrypted rooms with many PMP messages no longer "sticky" 2026-04-01 21:04:48 -05:00
7w1 88af897062 Merge branch 'dev' into feat/collapse-folders-setting 2026-04-01 17:30:59 -05:00
7w1 67093c5b1e feat: route settings and add setting links (#577)
### Description

This PR reworks settings into route-driven navigation instead of local
component state. Settings now use canonical `/settings/<section>` URLs,
render as a shallow modal on desktop, render full-page on mobile, and
use route-based open, close, and back behavior so the shell and history
handling stay consistent.

It also adds shareable settings links with `?focus=` targets. Those
links can be copied from setting rows, render as internal setting-link
pills in chat, route back into the app, and flash the targeted setting
after navigation. The settings link base URL is configurable, dynamic
per-device rows do not expose copy links because they are not stable
across clients, and the settings-specific `Permalink` naming has been
cleaned up to `SettingLink` for consistency.

### Screenshots

https://github.com/user-attachments/assets/3a876046-1b7d-42b9-aa09-a1d89b92c9b2

#### 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
- [ ] 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).

This PR moves settings state into the router, adds the shallow desktop
modal route renderer and mobile full-page settings flow, introduces
canonical settings-link parsing/building plus chat
rendering/interception for those links, adds focus-target highlighting
and configurable settings-link base URL handling, and polishes the
row-level copy-link controls and naming so the settings-link codepath is
internally consistent.
2026-04-01 22:20:29 +00:00
7w1 77c3cccbc1 add dismiss button to messages 2026-04-01 16:56:28 -05:00
7w1 8c0646ffa1 add setting to collapse folders by default 2026-04-01 16:27:16 -05:00
7w1 fe09f2a2d2 add changeset 2026-04-01 16:08:01 -05:00
Septicity 2e5663b4ac fix: Make right clicking no longer drag images in the image viewer 2026-04-01 07:03:07 -05:00
Rose ab80d3388e feat: center image zooming on the cursor (#602)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

This PR makes the image zooming via double-click or mouse wheel centered
on the cursor position rather than the center of the image.
Clicking the zoom % label (between + and - buttons) now resets the image
zoom and pan.
Zooming was also changed from being additive to multiplicative, which
makes the "zooming speed" feel consistent.

In the process of doing this I merged the zoom and pan state into one,
making it possible to change them at the same time.
The `setPan` and `setZoom` functions were recreated for compatibility.
`resetTransforms` was added for convenience.
`handleWheel` was moved from the ImageViewer into the image gestures
hook.

#### 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
- [ ] 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-31 13:44:54 +00:00
hazre 0c4face49e Merge remote-tracking branch 'origin/dev' into hazre/feat/settings-routing-links
# Conflicts:
#	src/app/plugins/react-custom-html-parser.test.tsx
2026-03-31 14:07:53 +02:00
mini-bomba 2e2c8a795d fix: make zoom buttons zoom towards the center of the screen 2026-03-31 11:30:09 +02:00
Shea Duma 8aef658bbb Merge remote-tracking branch 'upstream/dev' into msc4095 2026-03-31 02:39:29 +03:00
mini-bomba 88408aec59 feat: center image zooming on the cursor 2026-03-31 00:52:37 +02:00
hazre 3bb692fdb0 Merge branch 'dev' of github.com:SableClient/Sable into hazre/feat/arborium-migration
# Conflicts:
#	src/app/plugins/react-custom-html-parser.test.tsx
#	src/app/plugins/react-custom-html-parser.tsx
#	src/app/utils/sanitize.test.ts
#	src/app/utils/sanitize.ts
2026-03-30 23:30:29 +02:00
github-actions[bot] 7661bfa2e4 chore: prepare release 1.13.1 2026-03-30 03:33:46 +00:00
7w1 4a110ea05d revert extraneous changes 2026-03-29 22:25:47 -05:00
7w1 4d2fcfccbe fix: harden Matrix HTML sanitization (#571)
### Description

- switch Matrix custom HTML sanitization from `sanitize-html` to
`DOMPurify`
- enforce the Matrix v1.18 tag and attribute allowlist exactly,
including scheme and `mxc://` restrictions
- sanitize reply previews before trimming/parsing so untrusted
`formatted_body` never reaches the reply extraction path unsanitized
- move `data-mx-color` and `data-mx-bg-color` translation to render time
and explicitly ignore incoming `style` in the HTML parser
- use `sanitizeText` for plain-text interpolation paths that were
previously running through the HTML sanitizer
- add regression tests for sanitizer allowlist behavior, reply preview
sanitization, parser color translation, and parser-side style stripping

#### 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).
- [x] Fully AI generated (explain what all the generated code does in
moderate detail).

This PR replaces the Matrix custom HTML sanitizer with a DOMPurify-based
implementation that matches the Matrix v1.18 allowlist instead of the
broader legacy rules. The sanitizer now validates tag-specific
attributes, rejects incoming `style`, limits links to
`https/http/ftp/mailto/magnet`, limits images to `mxc://`, strips
`mx-reply`, and keeps the existing nesting guard. Reply previews now
sanitize `formatted_body` before any reply trimming or parsing. The
React HTML parser now turns `data-mx-color` and `data-mx-bg-color` into
React styles at render time and ignores raw incoming `style` attributes
even if unsanitized HTML somehow reaches the parser. The plain-text HTML
interpolation paths in forwarding, the room composer, and the message
editor now use text escaping instead of the HTML allowlist sanitizer.
The new tests lock down the sanitizer contract, the reply-preview
regression, parser color translation, and parser-side style stripping.
2026-03-30 02:50:05 +00:00
Shea Duma 0ccc5a7b1d added changeset 2026-03-30 00:19:38 +03:00
Rye dae8e6ac29 fix(PMP, ID): changed pmp id handling and generation 2026-03-29 03:29:56 +02:00
Shea c2de0c5e4e Merge branch 'SableClient:dev' into links-msc4095 2026-03-29 00:01:33 +02:00
Shea Duma f4ddda6048 added general fallback 2026-03-28 22:08:54 +02:00
hazre a458be5daf chore: clarify Arborium changeset summary 2026-03-28 20:21:46 +01:00