Commit Graph
4143 Commits
Author SHA1 Message Date
Shea Duma 2e6418ddcd fix checks 2026-04-23 16:45:27 +03:00
Shea Duma 0278d109b0 merge upstream 2026-04-23 16:41:46 +03:00
Shea Duma abba98f725 add checking for name colors and hovering buttons with good styling 2026-04-23 16:30:27 +03:00
7w1 005bbce905 Migrate to oxlint and oxfmt (#696)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

Migrates from eslint and prettier to oxlint and oxfmt + some rule
hardening and - some rules that don't exist in oxlint, but I decided it
probably wasn't worth running both in parallel just for a few rules.

Notably, got rid of many "as any"s and swapped to .toSorted() for safer
stuff and "type" in imports. Added comments to all the existing lint
issues (console logging and the alert for app updates) and the few
places "as any" was justified (test cases) and some message object
whatnots.

Also notably, fmt now takes a second or two, and linting now takes no
more than a few seconds. Yay!

Recommended vscode plugins, workflows, and configs should all be updated
assuming I didn't miss anything.

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

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change - breaking I guess since not all rules exist? I
don't really know exactly what I uh... didn't include.
- [ ] 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).
- [ ] 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 deployed a swarm of silly AIs to fix many of the simpler as any casts
and subsequent typechecks because there were hundreds and I'm not doing
that manually :p. I did review it, mostly just seamless swapping to the
correct cast type instead of as any, nothing particularly complicated.
2026-04-22 22:57:12 -05:00
7w1 8396fedb14 fix room sorting and lint issues 2026-04-22 22:54:22 -05:00
Shea Duma c44f0ff7ff small linting fix 2026-04-23 03:09:12 +03:00
Shea Duma 3cfbb99ece add checking for bad choices 2026-04-23 03:05:51 +03:00
Shea Duma 49e8d6f85a more complex edgecasing maybe 2026-04-23 02:41:31 +03:00
Shea Duma 3446423ed9 edgecase of setting the color to #000 2026-04-23 02:17:19 +03:00
hazre d4474cc474 fix: avoid post-login preview stalls when service worker registration fails 2026-04-23 00:49:32 +02:00
Shea Duma 6a000a42c1 fix wording 2026-04-23 01:44:16 +03:00
Shea Duma 7546c22d2f add changeset 2026-04-23 01:43:20 +03:00
Shea Duma b4bd3a5f8b add setting button 2026-04-23 01:39:37 +03:00
Shea Duma b6b967bb30 fix message button look 2026-04-23 00:46:40 +03:00
Shea Duma e32376b6d5 make chips, and messages have the right formatting 2026-04-23 00:38:52 +03:00
Shea Duma 51d476672c set the username color to respect the hero in brightness 2026-04-22 22:37:07 +03:00
Shea Duma 67a2d7ccb3 introduced basic typechecking 2026-04-22 19:49:17 +03:00
Shea Duma b8e6b796c9 inner coloring 2026-04-22 19:26:28 +03:00
Shea Duma e5fcc494c7 basic color rendering 2026-04-22 15:52:10 +03:00
hazre 840ff239b2 refactor: align matrix event types with sdk primitives 2026-04-21 22:29:46 +02:00
hazre bb9d59d7f6 Merge remote-tracking branch 'origin/dev' into migrate-oxlint-oxfmt
# Conflicts:
#	src/app/components/RenderMessageContent.tsx
#	src/app/components/url-preview/UrlPreviewCard.tsx
#	src/app/components/user-profile/UserRoomProfile.tsx
#	src/app/features/settings/Settings.test.tsx
#	src/app/features/settings/general/SettingsLinkBaseUrlSetting.test.tsx
#	src/app/features/settings/general/SettingsLinkBaseUrlSetting.tsx
#	src/app/features/settings/settingsLink.ts
2026-04-21 16:35:04 +02:00
7w1 4e9c349066 Feat - Separate embed settings and add multiple embeds (#667)
<!-- 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. -->

This PR proposes the moving of embed settings to their own category
under General:
<img width="810" height="694" alt="image"
src="https://github.com/user-attachments/assets/972eec7b-1517-4c76-991c-c652cea6a3ab"
/>

Additionally it adds multiple embeds in one message:
<img width="1321" height="480" alt="image"
src="https://github.com/user-attachments/assets/59a6da99-e7a1-4740-a9d8-29b37a2ef8dc"
/>

Showing them all is however just a setting that may be turned off (it is
on by default) since the embeds respect the aspect ratio of the
thumbnail so a list of embeds may be uneven which might appear
unaesthetic to some, as per this example:
<img width="1294" height="751" alt="image"
src="https://github.com/user-attachments/assets/6b0b47ad-c6e7-427f-baea-0ecd4ba84527"
/>

Fixes #

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

### Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [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. -->
My pathological avoiding anxiety has empowered me to create this instead
of doing a more important task.
2026-04-20 17:56:24 +00:00
Shea Duma 2361dd5504 fix weird merge issue 2026-04-20 20:54:45 +03:00
Shea Duma ffdc3d9587 Merge remote-tracking branch 'upstream/dev' into muliple-previews
merge upstream
2026-04-20 20:47:48 +03:00
7w1 d85c9408d5 Feat - misc data styling in user heros (#663)
<!-- 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. -->

This PR proposes styling the misc data (the fields from extended profile
that sable does not recognize) in a more robust form, with json
formatting, and tapping through the options in order to have a clear
visual differentiation between it and anything else.

(current view for an example from someone using a different client and
thus having different fields)
<img width="350" height="701" alt="image"
src="https://github.com/user-attachments/assets/996bbcef-f7cf-4bbb-8667-051181d72835"
/>

(proposed new view, with the badge key selected)
<img width="344" height="661" alt="image"
src="https://github.com/user-attachments/assets/09cb347d-d287-477b-9562-5854ab09905b"
/>

(proposed new view when selecting an item)
<img width="345" height="564" alt="image"
src="https://github.com/user-attachments/assets/e52d18af-ae60-4747-9fd6-eef086373fe1"
/>
<img width="345" height="653" alt="image"
src="https://github.com/user-attachments/assets/9252b65f-d8ea-4926-8793-1b9ddff99b0a"
/>

(proposed view when there is only one key, and showing it is selected)
<img width="346" height="573" alt="image"
src="https://github.com/user-attachments/assets/4003f601-ddf4-44e9-b05d-4c07a4015033"
/>

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
- [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. -->
My partner's avocado gasped the implementation as its last breath before
rotting away
2026-04-20 17:38:57 +00:00
Shea Duma e3b8036ec9 fixed conflict in changeset 😭 2026-04-20 20:37:06 +03:00
7w1 ff01d8d5d0 Merge branch 'dev' into muliple-previews 2026-04-20 10:52:01 -05:00
7w1 a0295803a0 fix: cross-instance settings link recognition without hardcoded app.sable.moe (#695)
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

Fixes #646

Changed settings link behavior to use a query parameter marker instead,
this avoids hardcoding `app.sable.moe`, keeps links valid on non-Sable
clients, and lets self-hosted Sable instances recognize links copied
from other Sable instances without misclassifying arbitrary third-party
`/settings/...` URLs.

Example:
`https://client.example/settings/account?focus=display-name&moe.sable.client.action=settings`

Edit:

I've ended up expanding the scope of the PR. Thanks to some suggestions
from @dozro and also general QoL improvements.

- Settings link URLs now get rewritten when sent from the RoomInput by
turning bare settings URLs into markdown links, so they look better on
non-Sable clients.
- Example on non-Sable clients: [Settings > Emojis & Stickers > Select
Pack](http://localhost:8080/settings/emojis?focus=select-pack&moe.sable.client.action=settings)
- Raw markdown sent: `[Settings > Emojis & Stickers > Select
Pack](http://localhost:8080/settings/emojis?focus=select-pack&moe.sable.client.action=settings)`
- Hardened settings link detection to avoid misclassifying invalid or
malformed URLs as settings links.
- Added validation so a settings link only renders as a settings chip if
it points to a real shareable settings target that exists.
- Invalid or malformed settings-looking URLs now fall back to normal
links instead of rendering as settings chips or trying to open invalid
focus targets.
- Fixed a styling issue where the settings link chip was not vertically
aligned with surrounding text.
- Removed settings links from dynamic/user-driven rows, such as emoji
packs and similar targets that are not stable to share across clients or
instances.

Migration note:
- `settingsLinkBaseUrl` is no longer used and can be removed from
`config.json`.

#### 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-04-20 15:39:29 +00:00
hazre 51cb6ebd07 chore: replace fixable oxlint suppressions 2026-04-19 18:45:31 +02:00
hazre fed60b48b9 chore: scope no-console ignores to files 2026-04-19 17:04:29 +02:00
hazre 4a99cc50f9 test: replace stale lint suppressions with type imports 2026-04-19 16:47:34 +02:00
hazre fecf22ad5a chore: drop stale oxlint suppressions 2026-04-19 16:47:28 +02:00
hazre 70ccc6ff55 chore: switch oxfmt to ts config 2026-04-19 16:47:05 +02:00
hazre 110e615d51 test: restore mocks after oxlint migration 2026-04-19 15:56:51 +02:00
hazre 87da39efc6 Expand settings link release notes 2026-04-19 13:36:29 +02:00
hazre e4c2e0ed19 Move send-time link rewrites behind transform boundary 2026-04-19 13:01:33 +02:00
hazre 1072ece46f Ignore malformed settings focus ids 2026-04-18 18:28:25 +02:00
hazre 42a9114983 Rewrite copied settings links on send 2026-04-18 18:28:20 +02:00
hazre 4dbdb6fcc9 Harden settings link parsing and rendering 2026-04-18 18:27:16 +02:00
7w1 f2bd03f427 add promise to plugins
and disable always-return because its annoying
2026-04-17 16:36:47 -05:00
7w1 40bb35f34c linting awayy 2026-04-17 16:23:59 -05:00
7w1 144e148154 many lint fixes 2026-04-17 14:09:04 -05:00
7w1 760b19ea1d more linting 2026-04-17 12:44:11 -05:00
7w1 9c13aaa557 knip ignore oxlint config, fix array issues 2026-04-17 12:34:20 -05:00
7w1 9636e7389d swap to .config.ts and remove useless script and pushnotification lint fixes 2026-04-17 12:30:04 -05:00
7w1 27eaadf9ae typecheck and linting fixes 2026-04-17 00:37:15 -05:00
7w1 b13c9b61d4 formatting 2026-04-16 22:38:18 -05:00
7w1 1717ca872f migrate to oxlint and oxfmt
ran formatter
fixed lint issues, primarily getting rid of "any"s and swapping to .toSorted()
2026-04-16 22:15:13 -05:00
7w1 f6f63253fa fix(caddy): add cache-control headers for static assets, service worker, and index.html (#609)
> Related to closed PR #548 (`fix/media-error-handling`), which was
split into smaller focused PRs.

### Description

Without explicit `Cache-Control` headers, browsers apply heuristic
caching to all responses — including `sw.js` and `index.html`. This
causes stale service workers and stale app shells to persist after a
deploy. Three header rules added to the Caddyfile:

- `/assets/*` — `public, max-age=31536000, immutable`: content-hashed
filenames change on every build, so these are safe to cache permanently.
- `/sw.js` — `no-cache`: must always be revalidated so the browser picks
up SW updates promptly.
- `/index.html` — `no-cache`: must always be revalidated so the browser
gets the latest asset hashes on load.

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

The cache header rules were partially AI assisted. I verified the
`immutable` directive is appropriate for content-hashed assets and that
`no-cache` (revalidate-always, not no-store) is correct for `sw.js` and
`index.html`.
2026-04-16 15:10:48 +00:00
7w1 b8ef2418fa fix(pwa): re-enable Workbox precaching (remove injectionPoint override) (#611)
> Related to closed PR #548 (`fix/media-error-handling`), which was
split into smaller focused PRs.

### Description

`injectionPoint: undefined` was set in `vite.config.ts` to silence a
Workbox `AssertionError` about multiple `self.__WB_MANIFEST` occurrences
(an `if` guard in `sw.ts` plus the `precacheAndRoute()` call = two
matches; Workbox requires exactly one). The unintended consequence:
Workbox never injected the precache manifest, so **no assets were
precached** — every cold start hit the network instead of serving from
cache, and offline use was broken entirely.

Fix: remove the `if` guard in `sw.ts` (leaving exactly one
`self.__WB_MANIFEST` reference) then remove `injectionPoint: undefined`
from `vite.config.ts` to restore normal precaching behaviour.

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

The root cause diagnosis (two `self.__WB_MANIFEST` references causing
Workbox to silently skip injection) was identified with AI assistance. I
verified the fix by checking Workbox's `injectionPoint` behaviour and
confirming precaching was restored.
2026-04-16 15:10:07 +00:00