4011 Commits
Author SHA1 Message Date
Dragon 38a46b246d Remove package-lock.json from tracking
Build / build (push) Failing after 2m12s
2026-04-06 07:29:59 -06:00
Dragon 0f5515ae6a Revert EncryptedContent change - original code is correct
Build / build (push) Has been cancelled
After deeper analysis of matrix-js-sdk internals, the original
EncryptedContent implementation is correct. The SDK's Rust crypto layer
handles retry automatically:

1. Events are added to eventsPendingKey when decryption fails
2. When new room keys arrive, onRoomKey() retries all pending events
3. attemptDecryption emits MatrixEventEvent.Decrypted on success
4. The existing handleDecrypted listener picks this up and re-renders

The real decryption issues are likely:
- Key backup not restoring properly (Cinny #2203)
- Megolm sessions never shared to new devices
- Cross-signing verification not triggering key share
- Sliding sync delaying event delivery vs key delivery

The EncryptedContent component was not the problem.
2026-04-06 07:29:51 -06:00
Dragon ab91754e7e Fix: force re-render of encrypted message content after decryption
Build / build (push) Has been cancelled
The EncryptedContent component was not updating its rendered output after
successful decryption. When decryptEventIfNeeded() resolved, the mEvent
object was mutated to contain plaintext content, but React did not
re-evaluate the children() render function because the component
structure appeared unchanged to the reconciler.

Fix:
- Added a decryptedVer counter state that increments each time
  decryption completes (either via Decrypted event or resolve of
  decryptEventIfNeeded)
- Used this counter as part of a React key on the fragment wrapping
  children(), forcing React to re-evaluate the render function when
  the key changes
- Added a 2-second retry after DecryptionFailure events, handling
  the case where keys arrive shortly after the initial decrypt attempt
- Added pendingDecrypt guard to prevent concurrent decrypt attempts

Also adds .gitea/workflows/build.yml for Gitea Actions CI.
2026-04-06 07:00:59 -06:00
7w1 8d5521598d Re-introduce custom HTML formatting for long messages (#641)
CodeQL Advanced / Analyze (actions) (push) Failing after 12m37s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1m16s
Build and publish Docker image / build-and-push (push) Failing after 3m7s
Create Release PR / prepare-release (push) Failing after 16s
Quality checks / Format check (push) Failing after 11m13s
Quality checks / Lint (push) Successful in 10m25s
Quality checks / Typecheck (push) Successful in 9m59s
Quality checks / Knip (push) Successful in 9m55s
Quality checks / Tests (push) Successful in 10m0s
Quality checks / Build (push) Successful in 10m23s
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

For long formatted messages (specifically, messages with over 8000
characters in their internal source), styles are disabled. I personally
noticed this when trying to use `/rainbow` messages.

I noticed that this regression was caused by [this
commit](https://github.com/7w1/sable/commit/d97a6c6cc345c58b4c21813560951595bb708e32);
while sanitizing the formatted body of a long message was safe for the
specific message in the channel that was linked in the issue, it ended
up disabling _all_ HTML formatting for longer messages.

Here, you can see the result of my fix:
<img width="50%" alt="image"
src="https://github.com/user-attachments/assets/a5ed26b4-bf55-492a-83d1-93c747226d74"
/><img width="50%" height="877" alt="image"
src="https://github.com/user-attachments/assets/84312b48-c426-4508-8341-6445fb9460ec"
/>

Specifically, I've determined that the cause of the original crash was
specifically only related to jumbo emojis; as I've kept the safeguard
regarding jumbo emojis, this still prevents the crash, as well as
keeping any spacing or line breaks in a message with many emojis. Here's
the difference:
<img width="50%" alt="image"
src="https://github.com/user-attachments/assets/35dbd824-f14a-4a61-9dfa-93593e01a1e1"
/><img width="50%" alt="image"
src="https://github.com/user-attachments/assets/873429bb-1166-418d-b7fd-b0c9f102e285"
/>

_(I'm considering this a breaking change because, as far as I can tell,
this does _technically_ make emojis no longer jumbo in longer messages.
I could be wrong, though.)_

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] 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-05 21:35:43 +00: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
7w1 0ae47b689d Fix invisible names (#640)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description
Small change to attempt to default to the right name so that they do not
show as being blank

Had to be a hard list because there does not seem to be a list of
characters that are supposed to be blank within the \p type

#### 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] 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. -->
A million monkeys spent a million years typing out the implementation
2026-04-05 02:57:30 +00: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
7w1 8c62746576 Fix "sticky scrolling" issue in encrypted rooms with many PMP messages (#626)
### Description

Previously, in encrypted rooms with many PMP messages, scrolling to the
bottom of the page resulted in the view "sticking"; you would need to
scroll either very quickly or manually with the scrollbar to get
"unstuck".

This stemmed from a part of the logic for grouping PMP messages together
in encrypted rooms; a timeline update seemed to be erroneously
triggered, re-rendering the timeline repeatedly (effectively sending you
back to the bottom).

I've removed the offending line, and the original functionality of the
change (i.e. PMP messages continuing to be grouped both as they are
sent, edited, and re-rendered) seems to still be present.

#### 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).
2026-04-02 17:13:33 +00:00
hazre 00c454424a docs: add changeset for formatted body links 2026-04-02 14:02:13 +02:00
hazre a5251818d3 fix: preserve linkification in formatted body text 2026-04-02 13:49:48 +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 81b0233c78 add focusId to setting 2026-04-01 17:31: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
7w1 5ab31d8dbd capture focus when replying to messages 2026-04-01 15:31:54 -05:00
7w1 45cda45343 fix: Make right clicking no longer drag images in the image viewer (#620)
### Description

As per typical UX conventions, right clicking no longer drags images in
the image preview.

Fixes #555

#### 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).
2026-04-01 17:50:50 +00: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 ae66ba6bec fix: hide desktop settings back button 2026-03-31 14:19:05 +02: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
7w1 f04fff486c Harden YouTube URL handling in embed feature (#599)
### Description

This pull request refactors the `parseYoutubeLink` function in
`ClientPreview.tsx` to use the standard `URL` API for parsing YouTube
URLs. This change improves the reliability and maintainability of the
code by handling edge cases and reducing manual string manipulation.

#### Improvements to YouTube URL parsing

- Refactored `parseYoutubeLink` to use the `URL` API for robust parsing
of YouTube URLs, improving error handling and supporting more YouTube
link formats.
- Enhanced extraction of video ID, playlist, and timestamp by using
`URL` search parameters instead of manual string splitting, making the
code more readable and less error-prone.

Fixes https://github.com/SableClient/Sable/security/code-scanning/9

#### 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 involved
2026-03-31 00:03:21 +00:00
7w1 82f9c8d7d0 Change code block highlighting from Prism to Arborium (#576)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

I was inspired by this tweet.
https://fxtwitter.com/DiscordPreviews/status/2036671398265995336

- replace Prism-based code block highlighting with Arborium for timeline
code blocks and text previews
- add Arborium theme metadata, runtime wiring, and a code block theme
setting that matches the existing System Theme pattern, with system
light/dark selections plus a single manual override
- extract a reusable `SettingMenuSelector`, remove
`NotificationModeSwitcher`, and reuse the shared selector in
notification, room, and theme settings
- wrap rendered code blocks so long lines break in both highlighted
messages and text previews instead of forcing wide horizontal overflow

The cool thing about Arborium is that all the language support and
themes are loaded from a CDN. So you basically ship nothing and on
demand, it downloads the proper grammer for each language that shows up
in the messages. fallback is just no syntax highlighting.

### Sceenshots

https://github.com/user-attachments/assets/1185d147-50ad-4b77-87c2-50660899c4b8

<img width="593" height="411" alt="image"
src="https://github.com/user-attachments/assets/b2eb8915-59dc-4198-a6de-7c8ae8c8d1d5"
/>

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

The main change in this PR is replacing the old Prism-based highlighting
path with Arborium for rendered message code blocks and text previews.
The message renderer and text viewer now go through the Arborium-backed
code highlight renderer, Arborium themes are loaded through the new
theme bridge instead of the old Prism theme classes, and unsupported or
failed language/theme loads still fall back safely to plain rendered
code. The settings work in this PR now exposes code block theming with
the same structure as the existing app theme controls: a System Theme
toggle that keeps separate light and dark Arborium theme selections,
plus a single Manual Theme selector that can override them when system
mode is off. The reusable `SettingMenuSelector` extraction is supporting
cleanup that lets the same dropdown pattern drive notification settings,
room notification controls, and the theme pickers while removing the
older one-off switcher component. The wrapping changes are the last part
of that migration work: Arborium-rendered code now wraps in both
timeline messages and text previews so long lines stay readable without
forcing wide overflow. The tests cover Arborium theme selection and
loading, selector reuse, notification option reuse, and the
message/text-viewer code block regressions.
2026-03-30 23:56:59 +00: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
hazre be8912675b Merge remote-tracking branch 'origin/dev' into hazre/feat/settings-routing-links
# Conflicts:
#	src/app/plugins/react-custom-html-parser.test.tsx
#	src/app/plugins/react-custom-html-parser.tsx
2026-03-30 23:29:26 +02:00
Rye 4048d4d8c9 fix(youtube embed): hardening of youtube url handling 2026-03-30 17:23:50 +02:00
7w1 6d6d163c05 Fix keyboard shortcut modifiers (removing redundant identity replacement) (#597)
fix for https://github.com/SableClient/Sable/security/code-scanning/1
removed the redundant replacement with it self.

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

codeql was used, if that counts, but it was a one line change, so no AI
was used
2026-03-30 05:06:06 +00:00
Rose 7213aff4fc Fix keyboard shortcut modifiers for Mac users
fix for https://github.com/SableClient/Sable/security/code-scanning/1
2026-03-30 06:37:55 +02:00
7w1 63afb74a48 chore: prepare release 1.13.1 (#581)
> [!IMPORTANT]
> Merging this PR will create a new release.

## Fixes

* Add youtube shorts support to stop it from crashing sable.
([#578](https://github.com/SableClient/Sable/pull/578) by @nushea)
* Fix rich-text reply previews and custom-formatted messages so unsafe
HTML is filtered more strictly and Matrix colors render correctly.
([#571](https://github.com/SableClient/Sable/pull/571) by @hazre)
* Fix crash when previewing non-video YouTube URLs (channels, @handles,
etc.) that lack query parameters.
([#584](https://github.com/SableClient/Sable/pull/584) by @Just-Insane)
* fix id handling and id generation for Personas
([#583](https://github.com/SableClient/Sable/pull/583) by @dozro)
2026-03-30 03:55:05 +00:00
github-actions[bot] 7661bfa2e4 chore: prepare release 1.13.1 2026-03-30 03:33:46 +00:00
7w1 f60bd221f9 fix(url-preview): guard against undefined query string in YouTube URL parser (#584)
### Description

Fixes a crash when any non-video YouTube URL is previewed — channels
(`youtube.com/@handle`), channel IDs (`youtube.com/channel/...`), or any
URL path without a `?` query string.

The existing code (even after #578) had:
```ts
params = path.split('?')[1].split('&');
```
When there is no `?` in the URL, `split('?')[1]` returns `undefined`,
and calling `.split('&')` on it throws:
> `TypeError: Cannot read properties of undefined (reading 'split')`

Fixed with optional chaining + nullish fallback:
```ts
params = path.split('?')[1]?.split('&') ?? [];
```

This causes `videoId` to remain `undefined` for non-video URLs, which is
handled correctly by the existing `if (!videoId) return null` guard —
the preview simply doesn't render rather than crashing the entire app.

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

AI identified the root cause after reviewing the PR #578 diff — the
shorts fix added the `/shorts/` branch but left the original
`youtube.com` branch with the same unguarded `.split()` call. The
one-line fix (`?.split('&') ?? []`) was AI-suggested; I reviewed and
confirmed it is correct.
2026-03-30 03:31:15 +00:00
7w1 4a110ea05d revert extraneous changes 2026-03-29 22:25:47 -05:00
Rose 4be43b5e88 Add CodeQL analysis workflow configuration (#567)
adds a workflow to run codeql as ci job
2026-03-30 02:59:12 +00: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
hazre 153a4903d3 fix: default dark code block theme to dracula 2026-03-30 00:03:57 +02:00
hazre fb1732ce82 fix: harden MXC image rendering and simplify HTML paths 2026-03-29 23:42:17 +02:00
7w1 fcff9ef378 Fix PMP ID handling and generation (#583)
### Description

This pull request addresses issues with ID handling and generation for
Personas by standardizing the way short IDs are generated and used
throughout the codebase. It replaces the use of `crypto.randomUUID()`
with a new utility function, `generateShortId`, ensuring IDs are shorter
and more consistent. Additionally, it improves command parsing for
Persona-related commands.

#### ID Generation Improvements

- Introduced a new utility function `generateShortId` in
`src/app/utils/shortIdGen.ts` to generate short, consistent IDs by
truncating UUIDs.
- Replaced all instances of `crypto.randomUUID()` with
`generateShortId(5)` when creating new Persona or member IDs in
`PerMessageProfileOverview.tsx` and `PKitCommandMessageHandler.ts`,
ensuring all IDs are now short and uniform.

#### Command Parsing Enhancements

- Updated regular expressions in `useCommands.ts` to use `\S+` instead
of `\w+` for Persona IDs, allowing IDs with a broader set of characters
and improving robustness of command parsing.

Fixes #582

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

No AI was used for this PR
2026-03-29 03:05:30 +00:00
Rose 99630e0579 Update CodeQL action versions in codeql.yml
Updated CodeQL action versions in the workflow file.
2026-03-29 03:56:56 +02:00
Rye dae8e6ac29 fix(PMP, ID): changed pmp id handling and generation 2026-03-29 03:29:56 +02:00
7w1 a8ddeb6061 Fix Youtube Previewing Crashing by adding shorts support (#578)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description
Added basic shorts support and a fallback to fix it from crashing on
shorts.

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] 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. -->
Athena has cursed me with the wisdom to fix this.
2026-03-28 22:04:25 +00:00
Shea c2de0c5e4e Merge branch 'SableClient:dev' into links-msc4095 2026-03-29 00:01:33 +02:00
hazre 0f7a28bf42 refactor: split code block themes into their own section 2026-03-28 22:36:32 +01:00