Commit Graph
2636 Commits
Author SHA1 Message Date
Shea Duma e582e429ab update all pages to show the right room image 2026-04-06 05:26:27 +03:00
Shea Duma 31fec891f7 added presence and setting 2026-04-06 04:54:14 +03:00
Shea Duma 88fffdbc4d added statuses to dms 2026-04-06 03:00:32 +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 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 5ab31d8dbd capture focus when replying to messages 2026-04-01 15:31:54 -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 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
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
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 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
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
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
hazre 0f7a28bf42 refactor: split code block themes into their own section 2026-03-28 22:36:32 +01:00
Shea Duma f4ddda6048 added general fallback 2026-03-28 22:08:54 +02:00
Shea Duma 8b287644d9 added /shorts/ support to stop sable from crashing 2026-03-28 22:04:54 +02:00
hazre 13bf74da87 feat: add system and manual code block theme modes 2026-03-28 20:45:50 +01:00
hazre 6bd125be5d Merge origin/dev into codex/settings-routing-links 2026-03-28 20:06:12 +01:00
hazre 26755262cd feat: add reusable settings selectors and code block themes 2026-03-28 20:02:00 +01:00
hazre 8bfe21ab6e refactor: rename settings permalinks to setting links 2026-03-28 19:54:04 +01:00
hazre 50542e9e91 fix: polish settings permalink controls 2026-03-28 19:42:14 +01:00
hazre 149550639c Merge remote-tracking branch 'origin/dev' into hazre/fix/matrix-html-sanitization
# Conflicts:
#	src/app/components/message/Reply.tsx
#	src/app/features/room/RoomInput.tsx
2026-03-28 17:33:33 +01:00
hazre ee1b718737 fix: harden Matrix HTML sanitization 2026-03-28 17:11:25 +01:00
7w1 14b2e34f33 fix: recover profile and avatar loading (#566)
### Description

Fixes profile and avatar loading regressions introduced around the
MSC4440 bio compatibility work.

This PR addresses two related problems:

- Own profile data could disappear when `useUserProfile` encountered
`gay.fomx.biography` in an unexpected shape or when the field was
missing entirely.
- Avatar components could get stuck in fallback mode after a transient
image load failure, causing the account avatar and other avatars to
disappear until a full reload.

The fix does three things:

- parses `gay.fomx.biography` defensively with optional access instead
of assuming `m.text[0].body` always exists
- retries profile fetches when the cache was previously poisoned into an
`_fetched`-only state after normalization failed
- resets avatar error state when the image `src` changes so transient
media/auth failures can recover on later renders

This was verified against the broken Account settings / account switcher
behavior where avatar, banner, bio, status, and pronouns could appear
missing.

Fixup of #559

#### 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 (GitHub Copilot)

`useUserProfile.ts`: Hardened MSC4440 bio parsing so missing or
malformed `gay.fomx.biography` data does not throw during normalization,
and allowed refetching when the profile cache only contains `_fetched:
true` from a prior failed normalization.

`UserAvatar.tsx` and `RoomAvatar.tsx`: Reset local image error state
when `src` changes so a temporary image load failure does not
permanently lock the component into fallback rendering.
2026-03-28 15:26:37 +00:00
Rose 5433f293c1 FIX dev branch error with loading youtube links that have no params (#570)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description
This is a quick and dirty fix to youtube links not having parameters

**This fixes a branch issue**

#### 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. -->
I have asked God for the solution
2026-03-28 15:26:10 +00:00
Shea Duma e286911a6a removed redundant fallback 2026-03-28 17:24:29 +02:00
7w1 748794cedc fix: scroll-to-bottom regression and timeline pagination fixes (#529)
### Description

Fixes several timeline bugs introduced after the
timeline-reset-on-navigation refactor:

- Scroll-to-bottom no longer gets stuck after navigating to a room
- Timeline pagination no longer uses a stale timeline chain after a
sliding sync reset
- URL preview requests are deduplicated so the same URL only fires one
network request
- Removed a redundant spidering call that was generating an extra
sliding sync request per room visit

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
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings

### AI disclosure:

- [x] Partially AI assisted (GitHub Copilot)

`RoomTimeline.tsx`: Added a `liveTimelineLinked` guard so the initial
scroll doesn't fire with stale data from the previous room, and a
`pendingReadyRef` that defers `setIsReady(true)` when `processedEvents`
is still empty (preventing the room opening at position 0).
`useTimelineSync.ts`: A `useEffect` resets the timeline state on room
change so revisited rooms aren't stuck with `liveTimelineLinked =
false`. Reads `linkedTimelines` fresh after each `await` in pagination
so a sliding sync reset mid-paginate doesn't cause count comparisons on
a detached chain. A `continuing` flag prevents two concurrent pagination
calls from racing on the lock. URL preview dedup uses a module-level
`Map` to share in-flight promises for the same URL. Removed a redundant
`startSpidering` subscription call in the sync setup path.
2026-03-28 10:23:55 -05:00
Evie Gauthier 724b45fd61 fix: remove extra blank line in useUserProfile.ts 2026-03-28 11:09:29 -04:00
Shea Duma 705adf0d6e fix youtube video links missing params in dev branch 2026-03-28 16:59:24 +02:00