Commit Graph
203 Commits
Author SHA1 Message Date
hazre 26755262cd feat: add reusable settings selectors and code block themes 2026-03-28 20:02:00 +01:00
hazre 20c941e951 test: preserve code language metadata during sanitization 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
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 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
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
hazre b7f9b851ff refactor: replace millify with Intl compact formatter 2026-03-25 15:26:32 +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
Evie Gauthier 540e78cc8b style: remove box-drawing comment decorators, rename _echo field to synctoken 2026-03-24 23:33:56 -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 8966d459ca chore: prettier 2026-03-24 23:33:31 -04:00
Evie Gauthier 6dd62575b0 fix: case-insensitive matching, remove double tooltip, mobile tap-to-pin
- 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)
2026-03-24 23:33:24 -04:00
Evie Gauthier 4c1dccf648 fix: case-sensitive abbreviation matching with word boundaries
- 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
2026-03-24 23:33:23 -04:00
Evie Gauthier 4460047365 feat: add room abbreviations with hover tooltips (#403)
- 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
2026-03-24 23:33:22 -04:00
Evie Gauthier 6409005229 fix(sentry): scrub percent-encoded Matrix IDs and opaque base64url tokens from URLs 2026-03-24 23:31:58 -04:00
Rose e8559efc8b Add maskable icons for better iOS/Android PWA appearance (#473)
### Description

I've added maskable icons to the selection of app icons. Maskable icons
are designed to be cropped into any shape, like on various Android
launchers, and this distinction additionally makes them work well on
iOS.

Here is a screenshot for comparison, with the new icon on the left :
<img width="522" height="323" alt="image"
src="https://github.com/user-attachments/assets/a647c9a3-c2cf-4f8a-8fee-5a5c15829be5"
/>

In the process of doing this, I've adjusted the structure of the
directories containing the app icons (they are no longer sorted by
Android/Apple, since any platform can pull from either format under
different circumstances). On that note, it looks like many of the
resolutions could probably be pruned... I kept all of the existing ones,
though.

I've also removed the dots from the paths in the HTML file, since this
was causing major issues in the `dev` run. I haven't been able to do a
proper build and test by hosting the /dist folder, so if this does break
anything in that scenario, I can revert that change.

I've tested this to completion on Linux and iOS so far, and I will edit
this part as I test more platforms (assuming it isn't merged by then).
- [ ] Android: Seems to work; a bit stretched, though? Edge might just
be bad at making PWAs. Should try more browsers.
- [ ] Windows:
- [ ] macOS:
- [ ] iPadOS:

#### 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-22 19:19:44 +00:00
Septicity 41c5ef9868 Added maskable icons for Android/iOS PWAs 2026-03-22 00:23:15 -05:00
Henk c20d63c8a6 M4A file support 2026-03-22 03:13:51 +01:00
Kace Cottam efb81a5404 Reapply "feat: Improve subspace nesting display"
This reverts commit b41b8d237d.
2026-03-20 09:22:18 -07:00
7w1 b41b8d237d Revert "feat: Improve subspace nesting display" 2026-03-20 03:02:48 -05:00
7w1 b91d18d8f0 Merge pull request #252 from KaceCottam/improve-space
feat: Improve subspace nesting display
2026-03-20 06:40:53 +00:00
7w1 1cd3850a26 lint stuff 2026-03-19 22:18:52 -05:00
7w1 6334cce92c various checks and things 2026-03-19 22:16:11 -05:00
7w1 267e6073cb stricter regex 2026-03-19 22:09:41 -05:00
7w1 54f6fbc4d8 Merge pull request #175 from SableClient/timeline-rewrite
Timeline rewrite to fix all bugs ever
2026-03-19 21:57:12 -05:00
7w1 f1b00880c3 Update time.test.ts 2026-03-19 21:19:33 -05:00
7w1 45e20847c4 Update time.ts 2026-03-19 21:17:36 -05:00
7w1 cff49b9e67 fix messages collapsing and deete the slop 2026-03-19 21:00:44 -05:00
Kace Cottam ab1fc15a48 Merge branch 'dev' into improve-space 2026-03-19 11:00:53 -07:00
Rye c836e90338 Merge remote-tracking branch 'fork-new/dev' into feat/allow-setting-pmp 2026-03-18 14:58:41 +01:00
7w1 b396ccec70 remove the comments >:D and merge the updated roomtimeline to have the new stuff and use the util file and yes 2026-03-18 00:52:10 -05:00
7w1 13bd62a8c8 make better yes 2026-03-18 00:44:21 -05:00
7w1 1ef961e084 begin pulling apart the giant timeline file smh 2026-03-17 23:27:33 -05:00
7w1 74ece9e6ac merge 2026-03-17 23:18:55 -05:00
7w1 c851eb4e11 cache things 2026-03-17 21:23:18 -05:00
Kace Cottam e69fc1250f another lint check 2026-03-17 13:04:09 -07:00
Rose e3120287f5 Merge branch 'dev' into feat/allow-setting-pmp 2026-03-17 20:17:48 +01:00
hazre f81fdd38af chore: merge dev into nyxsutsn 2026-03-17 18:54:18 +01:00
Rye 26bc3744bc add pronouns support to PerMessageProfile; update editor and hooks for pronoun management 2026-03-17 16:24:46 +01:00
Didi 1b243b24ac Make Mac OS, macOS in user-agent 2026-03-17 18:26:03 +10:30
Didi 3f51f7a72d Revert Broken Changes 2026-03-17 17:58:28 +10:30
Didi ca3b1602b0 Fix OS name check from 'Mac OS' to 'macOS' 2026-03-17 16:36:35 +10:30
Evie Gauthier 4714518514 test(sentry): unit tests for scrubbers and TelemetryConsentBanner
- Extract scrubMatrixIds/scrubDataObject/scrubMatrixUrl from instrument.ts
  into src/app/utils/sentryScrubbers.ts so they can be tested independently
- Add 43 unit tests covering token redaction, Matrix entity ID scrubbing,
  URL path scrubbing (API + app routes + percent-encoded deep-links),
  and scrubDataObject recursive traversal
- Add 12 RTL integration tests for TelemetryConsentBanner: visibility
  gating (no DSN, pre-existing pref), Got it, dismiss, and Opt out flows
2026-03-16 22:44:37 -04:00
Evie Gauthier 57eedcbf60 chore: resolve merge conflicts with dev; document telemetry consent banner 2026-03-16 22:27:17 -04:00
Evie Gauthier 62925c8d7e Merge pull request #310 from SableClient/fix/quick-issues-batch-1
fix: Quick issues batch 1 — UI/UX polish
2026-03-17 01:10:31 +00:00
Evie Gauthier ec5e9812aa fix: quick issues batch 1 (#2 #44 #45 #52 #66 #67 #69 #79 #35 #103 #120 #168) 2026-03-16 17:16:04 -04:00
Rose 5b1245c4ee Merge branch 'dev' into sonarqube/maintainability-2026-03-14 2026-03-16 21:42:24 +01:00
Evie Gauthier 67f0b9b319 Merge pull request #296 from dozro/compat/msc4268
Refactor sendFeedback utility and add ShareE2EEHistory command
2026-03-16 19:26:15 +00:00
Evie Gauthier cf4c3905c8 Merge pull request #297 from SableClient/feat/testing-setup
Add Vitest testing infrastructure
2026-03-16 18:27:56 +00:00