Commit Graph
3861 Commits
Author SHA1 Message Date
hazre 4e07ec15dc feat: add shared arborium code renderer 2026-03-27 12:31:55 +01:00
hazre c3cf613a2c fix: restore prism body theme classes 2026-03-27 12:31:55 +01:00
hazre dda1be44be fix: use arborium dist theme urls 2026-03-27 12:31:54 +01:00
hazre 9148978326 feat: add arborium theme bridge 2026-03-27 12:31:54 +01:00
hazre 20c941e951 test: preserve code language metadata during sanitization 2026-03-27 12:31:54 +01:00
hazre bce5b50a24 fix: treat escaped arborium output as plain 2026-03-27 12:31:54 +01:00
hazre 0e0290f557 fix: align arborium runtime api with spec 2026-03-27 12:31:54 +01:00
hazre 286b85c434 fix: align arborium runtime api with spec 2026-03-27 12:31:54 +01:00
hazre c78beb8cb5 feat: add arborium runtime wrapper 2026-03-27 12:31:54 +01:00
7w1 95cdfa1b23 feat: room abbreviations with hover tooltips and space inheritance (#514)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

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

Fixes #

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

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

### AI disclosure:

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

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

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

this is a tiny fix to a potentially confusing "problem" that i thought
of when going to sleep last night, previously if you enabled client side
embeds in both unencrypted and encrypted rooms, and then turned off the
main client side embeds toggle, the encrypted rooms setting would remain
on, even though it would be hidden in the setting ui

feel free to just close if this is stupid

#### 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
- [X] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
2026-03-26 21:17:16 +00:00
7w1 64082c4cec Add better parsing for youtube embed links (#534)
### Description

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

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

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

### AI disclosure:

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

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

Fixes #539 (hopefully)

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

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

### AI disclosure:

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

no AI was used for this PR
2026-03-26 10:13:26 -05:00
7w1 7b76e27e8f fix(sentry): scrub percent-encoded Matrix IDs and opaque base64url tokens from URLs (#531)
### Description

Extends `scrubMatrixUrl` with two additional patterns that were leaking
through the existing scrubber.

**1. Opaque Matrix IDs with percent-encoded colon (`%3A`)**

Device IDs, filter tokens, and other Matrix IDs that lack a sigil prefix
but follow the `localpart%3Aserver` pattern were not matched by the
existing sigil-based patterns. For example:

```
/Gj3Wy2D8gAi8jTIyR%3Asable.moe  →  /[MATRIX_ID]
```

**2. Long opaque base64url path segments**

Access tokens, Curve25519 keys, MSC3575 session tokens, and push
endpoints appear as 30+ character base64url strings in URL path
segments. These were passing through unscrubbed. For example:

```
/vI02CuiDNpaYEhUIVLbqE8vdKqm2ZwqIR5Y6NwNY_Rg/  →  /[REDACTED]/
```

The new pattern runs last so the earlier sigil-based patterns already
handle known Matrix IDs first.

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

### AI disclosure:

- [ ] Partially AI assisted
- [x] Fully AI generated

Two regex patterns added to `scrubMatrixUrl` in `sentryScrubbers.ts`.
The first matches path segments containing a bare `localpart%3Aserver`
form (no sigil) and replaces with `[MATRIX_ID]`. The second matches any
path segment of 30 or more base64url characters and replaces with
`[REDACTED]`, covering access tokens, crypto keys, and opaque session
identifiers. Both are appended after the existing patterns so known
sigil-prefixed IDs are handled first.
2026-03-25 20:54:54 +00:00
Rye e8572015f4 fix(MessageForwarding): removed null from forwarding metadata 2026-03-25 20:32:55 +01:00
7w1 2c7433ec5c fix: unread badge positioning (#484)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

This fixes unread badge positioning by deriving sidebar badge layout
from the same settings-aware mode that decides whether unread badges
render as dots or counts, so toggling badge display no longer leaves the
offset wrong. It also includes the related unread count formatting
cleanup, an Appearance toggle for large-count badge behavior, and
replaces `millify` dependency with a shared `Intl.NumberFormat` compact
formatter.

### Screenshots
<img width="68" height="463" alt="image"
src="https://github.com/user-attachments/assets/89f19c25-f6aa-46c2-8172-9748f43f605d"
/>


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

- [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).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
2026-03-25 12:56:52 -05:00
7w1 06a523439a Add black theme (#437)
<!-- Please read
https://github.com/ajbura/cinny/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 black theme (high contrast dark theme)

I used
https://github.com/7w1/sable/pull/51/changes/6f2d63046a57908b7d5d8c21c6eefe3dff160e43
as a reference of how to do this.

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
2026-03-25 17:46:16 +00:00
7w1 b6306c8cc9 feat: sync app settings across devices via Matrix account data (#515)
### Description

Adds cross-device settings sync by storing Sable's app settings in a
Matrix account data event (`moe.sable.app.settings`). Change a setting
on one device and it propagates to your other sessions automatically.

Fixes #

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

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

### AI disclosure:

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

**What the generated code does:**

`settingsSync.ts` — Serialise/deserialise helpers that convert the
settings state to/from the account data wire format. Unknown keys are
preserved so older clients don't silently drop data from newer ones.

`useSettingsSync.ts` — The main sync hook. On mount it reads any
existing account data and merges it into local state. It then listens
for live updates from other devices via `ClientEvent.AccountData`.
Uploads are debounced by 2 seconds and each one embeds a random
`synctoken`; when the server echoes the event back, the hook recognises
its own token and skips re-applying it. Exposes `settingsSyncStatusAtom`
and `settingsSyncLastSyncedAtom` for UI feedback.

`General.tsx` — Adds a "Sync settings across devices" toggle and a JSON
export/import section for manually backing up and restoring settings.

`ClientNonUIFeatures.tsx` — Mounts the sync hook once at the client root
so it stays active for the whole session.

`settings.ts` — Adds `settingsSyncEnabled: boolean` (default `false`) to
the settings atom.

Type files — Registers `moe.sable.app.settings` in the account data type
registry so SDK callbacks are typed correctly.

Tests cover the serialise/deserialise helpers, load-on-mount, merge
behaviour, echo-loop skipping, debounced uploads, and error states.
2026-03-25 17:06:06 +00:00
Evie Gauthier bf9deae8a1 fix(abbreviations): fix lint, typecheck, and format errors 2026-03-25 12:49:18 -04:00
Evie Gauthier 18a7ca092b fix(abbreviations): highlight terms in HTML-formatted messages
Previously, abbreviation term highlighting was skipped for any message
that has a formatted_body (virtually all messages from modern clients
using a rich-text editor), because RenderBody returned early from the
customBody path before reaching the abbreviation logic.

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

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

### Description

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

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

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

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

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
2026-03-25 09:31:06 -05:00
hazre b7f9b851ff refactor: replace millify with Intl compact formatter 2026-03-25 15:26:32 +01:00
hazre 514535ca35 feat: cap unread badges and something extra :) 2026-03-25 15:26:32 +01:00
Thunder a7a34981cf simplify if statement 2026-03-25 15:58:45 +02:00
hazre 9e46cd2547 chore: add changeset for sidebar badge alignment fix 2026-03-25 14:06:16 +01:00
hazre 638e4d06d2 fix: sync sidebar unread badge mode and positioning 2026-03-25 14:06:15 +01:00
Evie GauthierandRose 6c4804c201 Update src/app/utils/sentryScrubbers.ts
Co-authored-by: Rose <[email protected]>
2026-03-25 07:48:32 -04:00
Thunder 1dd0246d2a fix confusing ui for client side embed settings
previously you could enable client side embeds in encrypted rooms,
while disabling them in unencrypted rooms, even though turning off the
unencrypted room toggle hid the encrypted rooms toggle
2026-03-25 12:51:10 +02:00
Thunder e72a40f1c9 add better parsing for youtube embed links
also introduces support for timestamps, playlists and youtube music
links, tracking info is still stripped, embeds use the timestamp
2026-03-25 12:49:38 +02:00
Evie Gauthier 540e78cc8b style: remove box-drawing comment decorators, rename _echo field to synctoken 2026-03-24 23:33:56 -04:00
Evie Gauthier 5900df51c0 fix: prevent continuous re-upload loop in settings sync 2026-03-24 23:33:55 -04:00
Evie Gauthier 970ad46fc6 fix: prevent multi-device settings sync echo loop 2026-03-24 23:33:54 -04:00
Evie Gauthier 13096e8f6d Fix formatting in settings sync changeset 2026-03-24 23:33:53 -04:00
Evie Gauthier 7c00453252 fix: format useSettingsSync files and name anonymous wrapper function 2026-03-24 23:33:52 -04:00
Evie Gauthier f4111659ba fix: remove as never casts by registering SableSettings in AccountDataEvents 2026-03-24 23:33:51 -04:00
Evie Gauthier 8faf1e6681 feat: sync app settings across devices via Matrix account data
- Add SableSettings account data event type (moe.sable.app.settings)
- Add settingsSyncEnabled setting (default off, device-local)
- serializeForSync/deserializeFromSync utilities with versioned schema
- Echo-token loop prevention: own uploads don't re-apply on echo
- Debounced (2 s) upload on settings change
- JSON export (browser download) and import (file picker)
- SettingsSyncSection in General settings with sync toggle, status, and export/import buttons
- 39 new tests covering utilities and hook behaviour
2026-03-24 23:33:50 -04:00
Evie Gauthier 6d68944f9a chore: simplify changeset to one-line description 2026-03-24 23:33:34 -04:00
Evie Gauthier d1834267f1 ci: trigger re-check after dev format fix 2026-03-24 23:33:33 -04:00
Evie Gauthier f3aa949d46 Fix formatting in room abbreviations changeset 2026-03-24 23:33:32 -04:00
Evie Gauthier 8966d459ca chore: prettier 2026-03-24 23:33:31 -04:00
Evie Gauthier 97aaac9a49 fix(abbreviations): restore ancestor duplicate check; clear stale validity on input change 2026-03-24 23:33:30 -04:00
Evie Gauthier 4207f82aa6 fix: allow overriding inherited space abbreviations at room level 2026-03-24 23:33:29 -04:00
Evie Gauthier 0767c18a17 fix: correct Chip size prop and add changeset heading 2026-03-24 23:33:28 -04:00
Evie Gauthier 3bf51a2eb2 feat: multi-level space abbreviation inheritance + flat settings list
- useMergedAbbreviations: drop space param; use getAllParents+roomToParentsAtom
  to traverse the full ancestor chain and subscribe to state events at every
  level (not just direct parent) via useStateEventCallback on the mx client
- Room.tsx: drop parentSpace/useSpaceOptionally — hook handles it internally
- RoomAbbreviations settings: replace two-section layout with a single flat
  list; room entries shown without badge, inherited entries show a
  'Space - <SpaceName>' chip badge; supports arbitrary nesting depth
  (mirrors the useImagePackRooms multi-level pattern)
2026-03-24 23:33:27 -04:00
Evie Gauthier 920a992740 fix: abbr dotted underline + space settings label fixes
- Add textDecoration: 'underline dotted' and cursor: 'help' to <abbr>
  elements in AbbreviationTerm so users can see the hover indicator
- RoomAbbreviations: add isSpace prop; when true, show 'Space Abbreviations'
  / 'space-level' labels and hide the inherited-from-space section
- SpaceSettings: pass isSpace to RoomAbbreviations
2026-03-24 23:33:26 -04:00