The Matrix SDK for sliding sync deliberately does not call resetLiveTimeline()
on limited:true (the handling is in a commented-out TODO block). This means
events from a previous visit remain in the live timeline and new events get
appended after them, with the backward pagination token pointing to the gap
between old and new events rather than to before all events. The result is
that new messages appear out of order or the gap is unreachable via the UI.
Two fixes:
1. useSlidingSyncActiveRoom: reset the live timeline synchronously before
the subscription request is sent on room navigation. This ensures the
fresh initial:true response populates a clean timeline, not one polluted
with events from the previous visit. Also removes the 100ms delay that
was added as an incomplete workaround for the same issue.
2. SlidingSyncManager.onLifecycle: in RequestFinished state (fires before
any room data listeners run), reset the live timeline for active-room
subscriptions that receive initial:true or limited:true. This covers the
reconnect/background case where the pos token expires and all active rooms
get a fresh initial:true in the same sync cycle.
### 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.
<!-- 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. -->
<!-- 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
### 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.
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.
<!-- 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. -->
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
- 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)
- 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
- Revert to case-insensitive matching (gi flag, lowercase map keys) and
update tests and duplicate-entry check accordingly
- Remove title attribute from <abbr> — was causing native browser tooltip
to overlap with our custom TooltipProvider tooltip
- Extract AbbreviationTerm component; adds click/tap handler that pins
the definition as a PopOut positioned above the term
- Desktop: hover still shows tooltip via TooltipProvider
- Mobile: tap pins the tooltip open; tap anywhere else dismisses it
(one-shot document click listener, stopped by e.stopPropagation so
the opening click does not immediately close it)
- buildAbbreviationsMap now stores exact-case keys (no .toLowerCase())
- splitByAbbreviations regex uses 'g' flag instead of 'gi' — user-defined
casing is matched exactly (FOSS won't match 'foss' in text)
- Word boundaries (\b) still prevent matching inside longer words
- RoomAbbreviations settings page duplicate check updated to exact match
- Add 19 unit tests covering edge cases: empty map, no-match, start/mid/end
splits, case sensitivity, word boundaries, longest-match priority
- Add StateEvent.RoomAbbreviations ('moe.sable.room.abbreviations')
- Include abbreviations event in sliding sync required state
- Add AbbreviationsPage to RoomSettingsPage enum
- New RoomAbbreviations settings page (add/remove term+definition pairs)
- Wire page into RoomSettings.tsx menu
- New useRoomAbbreviations hook + RoomAbbreviationsContext
- Provide context in Room.tsx
- RenderBody.tsx: highlight defined terms in plain-text messages with
TooltipProvider+abbr tooltip; HTML messages unaffected